]> git.zndr.dk Git - zndr-11ty.git/commitdiff
Remove Lan-only tiles for public
authorJannik ZANDER <jzander@grundfos.com>
Mon, 6 Oct 2025 18:45:24 +0000 (20:45 +0200)
committerJannik ZANDER <jzander@grundfos.com>
Mon, 6 Oct 2025 18:45:24 +0000 (20:45 +0200)
site/_data/services.json
site/assets/styles.css
site/index.njk

index 7290a8bb08ea1c6e911ef7e8dbc3c2eb3c2bfdb5..60ff7db1dad9752fcf795fa2ecfa4e42dde1502a 100644 (file)
@@ -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
index 3d52e7f7a82792e08ec0bce1f36bd5f26dd6ee99..3ae3d1b47b56a8248c56892582e8655d7c9a3b9c 100644 (file)
@@ -152,6 +152,10 @@ header{
   color: var(--muted);
 }
 
+.card.is-lan {
+  display: none;
+}
+
 /* Icon box with no plate */
 .tile-icon{
   flex: 0 0 auto;
index 8a7c889fad3588c061b12634c85c78352fc6b436..c011595d34c517518a6c435d6ca52ba5b5956afc 100644 (file)
@@ -11,7 +11,10 @@ title: zndr.dk — Services
 
 <main class="grid" id="grid">
 {% for s in services %}
-  <a class="card{% if s.lan %} is-lan{% endif %}" href="{{ s.href }}" rel="noopener noreferrer"{% if s.lan %} data-lan="true"{% endif %}>
+  <a class="card{% if s.lan %} is-lan{% endif %}"
+     href="{{ s.href }}"
+     rel="noopener noreferrer"
+     {% if s.lan %} data-lan="true"{% endif %}>
     {% if s.icon %}<div class="tile-icon">{% lucide s.icon, class="tile-glyph" %}</div>{% endif %}
     <div class="tile-body">
       <h3>{{ s.name }}</h3>
@@ -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 ...
 })();
 </script>
 
@@ -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();
     });
 })();
 </script>