mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-04-23 01:40:34 +00:00
36 lines
1.6 KiB
HTML
36 lines
1.6 KiB
HTML
{{define "admin-head"}}
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="color-scheme" content="dark light">
|
|
<meta name="referrer" content="strict-origin-when-cross-origin">
|
|
<meta name="robots" content="noindex, nofollow">
|
|
|
|
<!-- Theme: apply early to prevent flash.
|
|
Wrapped in try/catch — Safari Private and quota-exceeded both throw
|
|
synchronously from localStorage.getItem, and an unhandled throw here
|
|
would block HTML parsing and leave the page on the browser default. -->
|
|
<script>
|
|
(function() {
|
|
function getEffectiveTheme(pref) {
|
|
if (pref === 'dark') return 'dark';
|
|
if (pref === 'light') return 'light';
|
|
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
}
|
|
var pref = 'system';
|
|
try { pref = localStorage.getItem('hold-admin-theme') || 'system'; } catch (_) {}
|
|
var effective = getEffectiveTheme(pref);
|
|
document.documentElement.classList.toggle('dark', effective === 'dark');
|
|
document.documentElement.setAttribute('data-theme', effective);
|
|
})();
|
|
</script>
|
|
|
|
<!-- Preload critical assets -->
|
|
<link rel="preload" href="/admin/public/icons.svg" as="image" type="image/svg+xml">
|
|
|
|
<!-- Tailwind CSS + DaisyUI (shared with appview) -->
|
|
<link rel="stylesheet" href="/admin/public/css/style.css">
|
|
|
|
<!-- Bundled JS: HTMX + Theme + DID Lookup -->
|
|
<script type="module" src="/admin/public/js/bundle.min.js"></script>
|
|
{{end}}
|