From 066364d2b74b995e494fe6d9d0c8274736ecbc0a Mon Sep 17 00:00:00 2001 From: chris Date: Sat, 6 Jun 2026 21:15:26 -0400 Subject: [PATCH] Fix easter egg trigger: 7 quick taps on non-interactive area MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Long press on the logo link was unreliable. Switch to detecting 7 rapid taps on any non-link/button area within 2 seconds — works on mobile and desktop without conflicting with navigation. Co-Authored-By: Claude Sonnet 4.6 --- main-site/easter-egg.js | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/main-site/easter-egg.js b/main-site/easter-egg.js index 698542d..2db1bc9 100644 --- a/main-site/easter-egg.js +++ b/main-site/easter-egg.js @@ -37,30 +37,23 @@ } var active = false; - var pressTimer = null; + var tapCount = 0; + var tapTimer = null; - function startPress() { - pressTimer = setTimeout(function () { - if (!active) launch(); - }, 600); - } + // 7 quick taps on any non-interactive part of the page triggers it + document.addEventListener('click', function (e) { + if (active) return; + if (e.target.closest('a, button, input, select, textarea, label')) return; - function cancelPress() { - clearTimeout(pressTimer); - } + tapCount++; + clearTimeout(tapTimer); + tapTimer = setTimeout(function () { tapCount = 0; }, 2000); - // Long-press on the navbar brand (logo area) - document.addEventListener('mousedown', function (e) { - if (e.target.closest('.navbar-brand')) startPress(); + if (tapCount >= 7) { + tapCount = 0; + launch(); + } }); - document.addEventListener('mouseup', cancelPress); - document.addEventListener('mouseleave', cancelPress); - - document.addEventListener('touchstart', function (e) { - if (e.target.closest('.navbar-brand')) startPress(); - }, { passive: true }); - document.addEventListener('touchend', cancelPress); - document.addEventListener('touchmove', cancelPress); function launch() { active = true;