@@ -17,6 +17,7 @@ const valentine = $("#valentine");
1717const heartsRoot = $ ( "#hearts" ) ;
1818let llCleanup = null ;
1919let heartDone = false ;
20+ let keyBuffer = "" ;
2021
2122function sleep ( ms ) {
2223 return new Promise ( ( r ) => setTimeout ( r , ms ) ) ;
@@ -439,6 +440,60 @@ async function runSequence() {
439440 } ) ;
440441}
441442
443+ function setupEasterEggs ( ) {
444+ document . addEventListener ( "keydown" , ( e ) => {
445+ // Ignore if modal is open (except Escape which is handled elsewhere)
446+ if ( ! modal . classList . contains ( "is-hidden" ) && e . key !== "Escape" ) return ;
447+
448+ // Filter valid chars for typing
449+ if ( e . key . length === 1 ) {
450+ keyBuffer += e . key . toLowerCase ( ) ;
451+ if ( keyBuffer . length > 60 ) keyBuffer = keyBuffer . slice ( - 60 ) ;
452+ } else if ( e . key === "Backspace" ) {
453+ keyBuffer = keyBuffer . slice ( 0 , - 1 ) ;
454+ }
455+
456+ // 1. GAUSS
457+ if ( keyBuffer . endsWith ( "
458+ gauss ") ) {
459+ openModal ( "∑ 1..100 = 5050. I am happy." , "Carl Friedrich Gauss" ) ;
460+ keyBuffer = "" ;
461+ }
462+
463+ // 2. EMACS
464+ if ( keyBuffer . endsWith ( "emacs" ) || keyBuffer . endsWith ( "i like emacs" ) ) {
465+ openModal ( "M-x butterfly" , "Emacs Mode" ) ;
466+ keyBuffer = "" ;
467+ }
468+
469+ // 3. BULGARIAN
470+ if (
471+ keyBuffer . endsWith ( "pratar jag bulgariska" ) ||
472+ keyBuffer . endsWith ( "pratarjagbulgariska" )
473+ ) {
474+ openModal ( "Да, малко! (Yes, a little!)" , "Български" ) ;
475+ keyBuffer = "" ;
476+ }
477+
478+ // 4. DEFTONES
479+ if ( keyBuffer . endsWith ( "deftones" ) ) {
480+ openModal ( "I watched a change in you. It's like you never had wings." , "Deftones" ) ;
481+ keyBuffer = "" ;
482+ }
483+
484+ // 5. SÄG JA (Triggers success)
485+ if (
486+ keyBuffer . endsWith ( "säg ja" ) ||
487+ keyBuffer . endsWith ( "sag ja" ) ||
488+ keyBuffer . endsWith ( "sagja" ) ||
489+ keyBuffer . endsWith ( "sägja" )
490+ ) {
491+ enterValentineMode ( ) ;
492+ keyBuffer = "" ;
493+ }
494+ } ) ;
495+ }
496+
442497function wireUI ( ) {
443498 nextBtn . addEventListener ( "click" , ( ) => {
444499 paperInner . classList . add ( "is-flipped" ) ;
@@ -458,6 +513,8 @@ function wireUI() {
458513 document . addEventListener ( "keydown" , ( e ) => {
459514 if ( e . key === "Escape" && ! modal . classList . contains ( "is-hidden" ) ) closeModal ( ) ;
460515 } ) ;
516+
517+ setupEasterEggs ( ) ;
461518}
462519
463520window . addEventListener ( "load" , ( ) => {
@@ -474,4 +531,3 @@ window.addEventListener("resize", () => {
474531 cancelAnimationFrame ( resizeRaf ) ;
475532 resizeRaf = requestAnimationFrame ( ( ) => drawHeartFull ( graph ) ) ;
476533} ) ;
477-
0 commit comments