From 3dfe9e701d71553f55f730e52d8b3a694f8684de Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Mon, 6 Oct 2025 20:45:24 +0200 Subject: [PATCH] Remove Lan-only tiles for public --- site/_data/services.json | 2 +- site/assets/styles.css | 4 ++++ site/index.njk | 32 ++++++++------------------------ 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/site/_data/services.json b/site/_data/services.json index 7290a8b..60ff7db 100644 --- a/site/_data/services.json +++ b/site/_data/services.json @@ -75,7 +75,7 @@ { "name": "Influx", "href": "https://influx.zndr.dk", - "desc": "Time-series data.", + "desc": "Time-series database.", "tag": "LAN", "icon": "activity", "lan": true diff --git a/site/assets/styles.css b/site/assets/styles.css index 3d52e7f..3ae3d1b 100644 --- a/site/assets/styles.css +++ b/site/assets/styles.css @@ -152,6 +152,10 @@ header{ color: var(--muted); } +.card.is-lan { + display: none; +} + /* Icon box with no plate */ .tile-icon{ flex: 0 0 auto; diff --git a/site/index.njk b/site/index.njk index 8a7c889..c011595 100644 --- a/site/index.njk +++ b/site/index.njk @@ -11,7 +11,10 @@ title: zndr.dk — Services
{% for s in services %} - + {% if s.icon %}
{% lucide s.icon, class="tile-glyph" %}
{% endif %}

{{ s.name }}

@@ -80,8 +83,6 @@ title: zndr.dk — Services const input = document.getElementById('filter'); const cards = Array.from(document.querySelectorAll('.grid a.card')); // anchors - // ... your existing code (empty node, apply(), etc.) ... - input.addEventListener('keydown', (e) => { if (e.key !== 'Enter') return; @@ -97,13 +98,7 @@ title: zndr.dk — Services if (visible.length === 1) { window.location.href = visible[0].href; } - // Optional: if multiple, jump to the first one (comment out if you don't want this) - // else if (visible.length > 0) { - // window.location.href = visible[0].href; - // } }); - - // ... keep your existing apply() and initial call ... })(); @@ -114,17 +109,8 @@ title: zndr.dk — Services const TIMEOUT_MS = 1500; const lanCards = Array.from(document.querySelectorAll('.card[data-lan="true"]')); - const allChips = Array.from(document.querySelectorAll('.chip')); - - function reveal() { - // show all chips at once (no flash before this) - allChips.forEach(c => c.classList.remove('chip--pending')); - } - - // If there are no LAN-only items, just reveal chips (all green) - if (!lanCards.length) { reveal(); return; } + if (!lanCards.length) { return; } - // Decide home/away by CORS-validated fetch const ctrl = new AbortController(); const to = setTimeout(() => ctrl.abort(), TIMEOUT_MS); @@ -134,15 +120,13 @@ title: zndr.dk — Services if (res.ok) { // Home: ensure LAN-only cards are NOT red lanCards.forEach(card => card.classList.remove('is-lan')); - } else { - // Away: keep LAN-only cards red (leave is-lan on) + // 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 })); } - reveal(); }) .catch(() => { clearTimeout(to); - // Timeout / away: keep LAN-only cards red - reveal(); }); })(); -- 2.50.1