-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
86 lines (86 loc) · 3.55 KB
/
Copy pathindex.html
File metadata and controls
86 lines (86 loc) · 3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover, user-scalable=no"
/>
<meta name="theme-color" content="#1d2021" />
<title>ZenNotes</title>
<!-- Bundled typography fonts (Ubuntu Sans / Mono): the declarations are
a few KB and the woff2 subsets only download once a bundled family
is actually selected, so the cold-start path stays untouched. -->
<link rel="stylesheet" href="/fonts/fonts.css" />
<script>
// Minimal polyfills for stale system WebViews (Chrome <98). WebView
// updates ride Play, so devices without Play services — or with
// updates disabled — can sit years behind the OS; the API 29 emulator
// image ships WebView 91, where a missing Object.hasOwn in a vendor
// chunk rejected bootstrap's dynamic import('./main') and the app
// never painted (found while reproducing issue #12 on Android 10).
// Only the three gaps that block boot; anything older than these
// (Chrome <92) predates the syntax the bundle itself uses.
if (!Object.hasOwn) {
Object.defineProperty(Object, 'hasOwn', {
value: function (o, k) { return Object.prototype.hasOwnProperty.call(Object(o), k) },
writable: true, configurable: true
})
}
if (!Array.prototype.at) {
Object.defineProperty(Array.prototype, 'at', {
value: function (i) {
var n = Math.trunc(i) || 0
if (n < 0) n += this.length
return n < 0 || n >= this.length ? undefined : this[n]
},
writable: true, configurable: true
})
}
if (typeof structuredClone !== 'function') {
window.structuredClone = function (v) { return JSON.parse(JSON.stringify(v)) }
}
// Pre-module bootstrap. Must run before ANY app code: the app-core
// store reads localStorage at module-evaluation time, and Rollup chunk
// hoisting means no module of ours is guaranteed to run first — a
// classic script is.
;(function () {
var KEY = 'zen:prefs:v2'
try {
// First run on this device: vim off (soft keyboard; Settings can
// re-enable), skip the desktop onboarding wizard (the vault is
// auto-provisioned; theme/vim live in Settings).
if (localStorage.getItem(KEY) === null) {
localStorage.setItem(
KEY,
JSON.stringify({ vimMode: false, hasCompletedOnboarding: true })
)
}
} catch (e) {}
// Theme attributes before first paint so dark users never see a flash.
var themeId = 'dark-hard'
var themeMode = 'dark'
try {
var raw = localStorage.getItem(KEY)
if (raw) {
var prefs = JSON.parse(raw)
if (typeof prefs.themeId === 'string' && prefs.themeId) themeId = prefs.themeId
if (prefs.themeMode === 'light' || prefs.themeMode === 'dark') {
themeMode = prefs.themeMode
} else if (prefs.themeMode === 'auto') {
themeMode = window.matchMedia('(prefers-color-scheme: dark)').matches
? 'dark'
: 'light'
}
}
} catch (e) {}
document.documentElement.dataset.theme = themeId
document.documentElement.dataset.themeMode = themeMode
})()
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/bootstrap.ts"></script>
</body>
</html>