<!-- Brand theme color (green) -->
<meta name="theme-color" content="#10a37f">
- <!-- Theme color per mode -->
- <!--
- <meta name="theme-color" content="#1a1b1e" media="(prefers-color-scheme: dark)">
- <meta name="theme-color" content="#f7f7f8" media="(prefers-color-scheme: light)">
- -->
+
+ <script>
+ // If we’ve recently confirmed LAN, mark it before render
+ (function () {
+ if (document.cookie.includes('lan=1')) {
+ document.documentElement.classList.add('lan-yes');
+ }
+ })();
+ </script>
+
<!-- LOAD YOUR CSS -->
<link rel="stylesheet" href="/assets/styles.css?v=4">
})();
</script>
-
<script>
(function () {
- const PING_URL = "https://lan.zndr.dk/ping"; // 200 only on LAN
+ const PING_URL = "https://lan.zndr.dk/ping"; // 200 on LAN
const TIMEOUT_MS = 1500;
- const lanCards = Array.from(document.querySelectorAll('.card[data-lan="true"]'));
- if (!lanCards.length) { return; }
+ // If no LAN cards, skip
+ if (!document.querySelector('.card.is-lan')) return;
const ctrl = new AbortController();
const to = setTimeout(() => ctrl.abort(), TIMEOUT_MS);
fetch(PING_URL, { signal: ctrl.signal, credentials: "omit", cache: "no-store" })
.then(res => {
clearTimeout(to);
+
if (res.ok) {
- // Home: ensure LAN-only cards are NOT red
- lanCards.forEach(card => card.classList.remove('is-lan'));
- // Re-run current filter so visibility matches the query (if any)
- const input = document.getElementById('filter');
- if (input) input.dispatchEvent(new Event('input', { bubbles: true }));
+ // Mark as LAN for this and future loads
+ document.documentElement.classList.add('lan-yes');
+ document.cookie = "lan=1; Max-Age=600; Path=/; SameSite=Lax";
+ } else {
+ document.documentElement.classList.remove('lan-yes');
+ document.cookie = "lan=; Max-Age=0; Path=/; SameSite=Lax";
}
+
+ // If you have a live filter, re-apply it so visibility matches query
+ const input = document.getElementById('filter');
+ if (input) input.dispatchEvent(new Event('input', { bubbles: true }));
})
.catch(() => {
clearTimeout(to);
+ // Treat as public
+ document.documentElement.classList.remove('lan-yes');
+ document.cookie = "lan=; Max-Age=0; Path=/; SameSite=Lax";
});
})();
</script>
+