})();
</script>
+<script>
+(() => {
+ 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;
+
+ // Prevent form-like submission/reload
+ e.preventDefault();
+
+ // Find currently visible cards
+ const visible = cards.filter(c =>
+ c.offsetParent !== null && c.style.display !== 'none'
+ );
+
+ // If exactly one match, go to it
+ 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>
+
+
<script>
(function () {
const PING_URL = "https://lan.zndr.dk/ping"; // 200 only on LAN