-
-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy patheggs.js
More file actions
31 lines (25 loc) · 698 Bytes
/
eggs.js
File metadata and controls
31 lines (25 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* eggs.js — Easter Egg Trigger Layer.
*
* This file is intentionally thin. All game logic lives in the dedicated
* modules under src/assets/js/games/.
*
* Trigger: 5 clicks on the footer ❤️ → SpaceInvaders.launch()
*/
(() => {
let heartClickCount = 0;
let phaserStarted = false;
const heart = document.getElementById("footer-heart");
if (!heart) return;
heart.style.cursor = "pointer";
heart.style.display = "inline-block";
heart.addEventListener("click", () => {
if (phaserStarted) return;
heartClickCount++;
if (heartClickCount === 5) {
phaserStarted = true;
heart.innerHTML = "🎮";
SpaceInvaders.launch();
}
});
})();