Skip to content

Commit 2237a34

Browse files
committed
upate
1 parent d92bc41 commit 2237a34

3 files changed

Lines changed: 59 additions & 9 deletions

File tree

gauss.png

3.15 MB
Loading

index.html

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,8 @@
7272

7373
<div id="valentine" class="valentine is-hidden" aria-label="Valentine note">
7474
<div id="hearts" class="hearts" aria-hidden="true"></div>
75-
<div class="note" role="status" aria-live="polite">
76-
<div class="note-inner">
77-
<div class="note-title">Note</div>
78-
<div class="note-body">
79-
If you're free at 15:00, lets have lunch together. Meet me at the university. 🇱🇧 🍽️
80-
</div>
81-
<div class="note-sign">- Alfred</div>
82-
</div>
75+
<img alt="gauss" src="/gauss.png"/>
76+
</div>
8377
</div>
8478
</div>
8579

script.js

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const valentine = $("#valentine");
1717
const heartsRoot = $("#hearts");
1818
let llCleanup = null;
1919
let heartDone = false;
20+
let keyBuffer = "";
2021

2122
function 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+
442497
function 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

463520
window.addEventListener("load", () => {
@@ -474,4 +531,3 @@ window.addEventListener("resize", () => {
474531
cancelAnimationFrame(resizeRaf);
475532
resizeRaf = requestAnimationFrame(() => drawHeartFull(graph));
476533
});
477-

0 commit comments

Comments
 (0)