jam/public/index.html
Daniel 1343271c64
refactor: rename to Jam (#131)
* refactor: dry up app layout (#126)

* Rename and update readme

* Fix typos

* Run npm install

* Use html for header

* Update package name

* Add back alt texts

* Update title

* Add note about buggy raspiblitz

* Remove raspiblitz gotchas

* Update src/components/App.jsx

Co-authored-by: Max Hillebrand <30683012+MaxHillebrand@users.noreply.github.com>

* Update src/components/Onboarding.jsx

Co-authored-by: Max Hillebrand <30683012+MaxHillebrand@users.noreply.github.com>

* Run prettier

* Update CONTRIBUTING.md

Co-authored-by: d11n <mail@dennisreimann.de>

* Update README.md

Co-authored-by: d11n <mail@dennisreimann.de>

* Fix wording

* Update title

Co-authored-by: Max Hillebrand <30683012+MaxHillebrand@users.noreply.github.com>
Co-authored-by: d11n <mail@dennisreimann.de>
2022-03-03 12:07:45 +01:00

41 lines
2.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="base-url" href="." />
<link rel="public-url" href="%PUBLIC_URL%" data-value="%PUBLIC_URL%" />
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/apple-touch-icon.png" />
<link rel="icon" href="%PUBLIC_URL%/favicon.svg" />
<link rel="manifest" href="%PUBLIC_URL%/site.webmanifest" crossorigin="use-credentials" />
<link rel="mask-icon" href="%PUBLIC_URL%/safari-pinned-tab.svg" color="#000000" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="msapplication-TileColor" content="#ffffff" />
<meta name="theme-color" content="#ffffff" />
<title>Jam for JoinMarket</title>
<script>
window.JM = { SETTINGS_STORE_KEY: 'jm-settings', THEMES: ['light', 'dark'], THEME_ROOT_ATTR: 'data-theme' }
// determine base path depending on whether PUBLIC_URL is set
const baseHref = document.querySelector('link[rel="base-url"]').href
const publicHref = document.querySelector('link[rel="public-url"]').href
const publicUrl = document.querySelector('link[rel="public-url"]').dataset.value
const base = publicUrl.length === 0 || baseHref.length > publicHref.length ? baseHref : publicHref
window.JM.PUBLIC_PATH = base
.replace(`${window.location.protocol}//${window.location.host}`, '') // remove domain part
.replace(/\/$/, '') // remove trailing slash
// theme
const settings = JSON.parse(window.localStorage.getItem(JM.SETTINGS_STORE_KEY) || '{}')
const userColorMode = settings.theme
const systemColorMode = window.matchMedia('(prefers-color-scheme: dark)').matches ? JM.THEMES[1] : JM.THEMES[0]
const initialColorMode = JM.THEMES.includes(userColorMode) ? userColorMode : systemColorMode
if (!userColorMode) {
const updatedSettings = Object.assign(settings, { theme: initialColorMode })
window.localStorage.setItem(JM.SETTINGS_STORE_KEY, JSON.stringify(updatedSettings))
}
document.documentElement.setAttribute(JM.THEME_ROOT_ATTR, initialColorMode)
</script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>