69 lines
2.5 KiB
HTML
69 lines
2.5 KiB
HTML
<!doctype html>
|
|
<html lang="en-US">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<base href="%BASE_URL%" />
|
|
<link rel="icon" href="modern-logo/favicon.ico" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta name="theme-color" content="#000000" />
|
|
<meta
|
|
name="description"
|
|
content="The Free Adobe Acrobat alternative (10M+ Downloads)"
|
|
/>
|
|
<link rel="apple-touch-icon" href="modern-logo/logo192.png" />
|
|
<link rel="manifest" href="manifest.json" />
|
|
|
|
<title>Stirling PDF</title>
|
|
|
|
<!-- Apply theme + accent before first paint (no FOUC); mirrors ThemeProvider, which then refines it. -->
|
|
<script>
|
|
(function () {
|
|
try {
|
|
var p = JSON.parse(
|
|
localStorage.getItem("stirlingpdf_preferences") || "{}",
|
|
);
|
|
var mode = p.theme || "system";
|
|
var scheme =
|
|
mode === "light"
|
|
? "light"
|
|
: mode === "dark"
|
|
? "dark"
|
|
: window.matchMedia &&
|
|
window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
? "dark"
|
|
: "light";
|
|
var stored = scheme === "dark" ? p.darkPrimary : p.lightPrimary;
|
|
// "default" (or unset) = neutral surfaces + blue buttons; a hex tints.
|
|
var isDefault = !stored || stored === "default";
|
|
var accent = isDefault ? "#3b82f6" : stored;
|
|
var r = document.documentElement;
|
|
r.setAttribute("data-theme", scheme);
|
|
r.setAttribute("data-app-theme", "custom");
|
|
r.setAttribute("data-accent", isDefault ? "default" : "custom");
|
|
r.setAttribute("data-mantine-color-scheme", scheme);
|
|
r.style.setProperty("--user-primary", accent);
|
|
r.style.setProperty("--user-accent-fg", accent);
|
|
var h = accent.replace("#", "");
|
|
if (h.length === 3) h = h.replace(/./g, "$&$&");
|
|
var lum =
|
|
(0.2126 * parseInt(h.slice(0, 2), 16) +
|
|
0.7152 * parseInt(h.slice(2, 4), 16) +
|
|
0.0722 * parseInt(h.slice(4, 6), 16)) /
|
|
255;
|
|
r.style.setProperty(
|
|
"--user-primary-on",
|
|
lum > 0.7 ? "#000000" : "#ffffff",
|
|
);
|
|
} catch (e) {
|
|
/* first visit / unavailable storage: ThemeProvider handles it */
|
|
}
|
|
})();
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
|
<div id="root"></div>
|
|
<script type="module" src="src/index.tsx"></script>
|
|
</body>
|
|
</html>
|