From e25e84eebe249534202be4c3bc5fa8ca9b5084d7 Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Thu, 23 Jul 2026 02:33:34 +0800 Subject: [PATCH 1/4] feat(easter-eggs): themed WAAPI easter eggs + console API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eleven themed easter eggs, all rendered via the Web Animations API (no CSS animation libs). Each is built around PubID's domain: publication identifiers, standards bodies, and the PubID data model. Eggs: - Konami code (↑↑↓↓←→←→BA) → Standards Lifecycle animation: WD → CD → DIS → FDIS → Published, with sequenced stage morphs, progress segments lighting up, confetti + page-shake finale. Demonstrates Promise-based timelines and composite easing. - Click logo × 7 → Logo decomposes into labeled PubID components (Publisher / Type / Number / Year / Supplement) with SVG callout lines drawn via animated stroke-dash. - Type "ISO 9001" → Quality Certified stamp drops via spring easing (cubic-bezier overshoot) with curved-text SVG path. - Type "RFC 1149" → Carrier pigeon flies across with sinusoidal vertical motion layered on the linear horizontal motion via WAAPI composite:'add'. Drops a "PKT" datagram mid-flight. - Type "802.11" → Concentric beacon pulses radiate from the wordmark (5 staggered rings, each fading on expansion). - Type "urn" → Identifier regex scans the page; each match sprouts a URN chip via staggered fadeInUp. - Type "errata" → Dictionary lookup strikes words with redline strikethroughs; falls back to random words when no dictionary match exists in a paragraph. - World Standards Day (Oct 14) → Auto-badge in header + confetti. - Console: pubid.spin(), .shake(), .confetti() — programmatic access to the same primitives. Console API: - window.help and window.pubid.help() → styled ASCII directory of every egg with triggers and descriptions. - window.pubid.list() → egg metadata as data. - window.pubid.fire(id) → trigger by id. - window.pubid.{spin,shake,confetti}() → quick effects. Architecture: - src/scripts/easter-eggs/effects.ts WAAPI primitives (overlay, toast, confetti, shake, spin, pulse-ring, dim-page, fade helpers). All routed through a single pointer-events:none overlay. - src/scripts/easter-eggs/eggs.ts Egg implementations and registry. - src/scripts/easter-eggs/index.ts Triggers (typing buffer, Konami detector, click counter, temporal), console API install, init(). Auto-initialises on import. prefers-reduced-motion: flashy effects (confetti, shake) no-op. All keyboard input is ignored when an input/textarea/contentEditable is focused so the eggs never interfere with form entry. --- src/layouts/BaseLayout.astro | 3 + src/scripts/easter-eggs/effects.ts | 340 ++++++++++ src/scripts/easter-eggs/eggs.ts | 960 +++++++++++++++++++++++++++++ src/scripts/easter-eggs/index.ts | 299 +++++++++ 4 files changed, 1602 insertions(+) create mode 100644 src/scripts/easter-eggs/effects.ts create mode 100644 src/scripts/easter-eggs/eggs.ts create mode 100644 src/scripts/easter-eggs/index.ts diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index bf36ae6..b254d68 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -44,6 +44,9 @@ const fullTitle = title === 'PubID' ? title : `${title} · PubID`