Skip to content

Commit 2ce93be

Browse files
Add Konami code easter egg 🎮
↑↑↓↓←→←→BA triggers: - Screen flash with gradient - 50 emoji explosion from center (monkeys, bananas, rockets, etc) - Emoji rain falling from top - 3 second continuous confetti cannon - Console log celebration message
1 parent 3d6b0c5 commit 2ce93be

1 file changed

Lines changed: 157 additions & 0 deletions

File tree

docs/step.html

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,163 @@ <h1>${trans['congrats-title']}</h1>
883883
document.querySelector('.sidebar-overlay').classList.toggle('open');
884884
}
885885

886+
// 🎮 KONAMI CODE EASTER EGG: ↑↑↓↓←→←→BA
887+
const konamiCode = ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight', 'b', 'a'];
888+
let konamiIndex = 0;
889+
890+
document.addEventListener('keydown', (e) => {
891+
const key = e.key.toLowerCase() === e.key ? e.key : e.key;
892+
if (key === konamiCode[konamiIndex] || key.toLowerCase() === konamiCode[konamiIndex]) {
893+
konamiIndex++;
894+
if (konamiIndex === konamiCode.length) {
895+
konamiIndex = 0;
896+
triggerKonamiExplosion();
897+
}
898+
} else {
899+
konamiIndex = 0;
900+
}
901+
});
902+
903+
// Epic emoji explosion for Konami code
904+
function triggerKonamiExplosion() {
905+
const emojis = ['🐒', '🍌', '🎉', '🚀', '💜', '✨', '🔥', '⭐', '🌟', '💫', '🎊', '🏆', '📱', '💻', '🎯', '🦄', '🌈', '💎'];
906+
907+
// Screen flash effect
908+
const flash = document.createElement('div');
909+
flash.style.cssText = `
910+
position: fixed;
911+
top: 0;
912+
left: 0;
913+
width: 100%;
914+
height: 100%;
915+
background: linear-gradient(45deg, #512BD4, #00d4ff, #ff6b6b, #feca57);
916+
z-index: 9999;
917+
pointer-events: none;
918+
animation: konamiFlash 0.5s ease-out forwards;
919+
`;
920+
document.body.appendChild(flash);
921+
setTimeout(() => flash.remove(), 500);
922+
923+
// Add flash animation
924+
if (!document.getElementById('konami-styles')) {
925+
const style = document.createElement('style');
926+
style.id = 'konami-styles';
927+
style.textContent = `
928+
@keyframes konamiFlash {
929+
0% { opacity: 0.8; }
930+
100% { opacity: 0; }
931+
}
932+
@keyframes emojiExplode {
933+
0% {
934+
transform: translate(-50%, -50%) scale(0) rotate(0deg);
935+
opacity: 1;
936+
}
937+
50% {
938+
opacity: 1;
939+
}
940+
100% {
941+
transform: translate(var(--tx), var(--ty)) scale(1.5) rotate(var(--rot));
942+
opacity: 0;
943+
}
944+
}
945+
@keyframes emojiRain {
946+
0% {
947+
transform: translateY(-100px) rotate(0deg);
948+
opacity: 1;
949+
}
950+
100% {
951+
transform: translateY(100vh) rotate(720deg);
952+
opacity: 0;
953+
}
954+
}
955+
.emoji-particle {
956+
position: fixed;
957+
font-size: 2rem;
958+
pointer-events: none;
959+
z-index: 10000;
960+
animation: emojiExplode 1.5s ease-out forwards;
961+
}
962+
.emoji-rain {
963+
position: fixed;
964+
font-size: 2rem;
965+
pointer-events: none;
966+
z-index: 10000;
967+
animation: emojiRain 3s linear forwards;
968+
}
969+
`;
970+
document.head.appendChild(style);
971+
}
972+
973+
// Create explosion from center
974+
for (let i = 0; i < 50; i++) {
975+
setTimeout(() => {
976+
const emoji = document.createElement('div');
977+
emoji.className = 'emoji-particle';
978+
emoji.textContent = emojis[Math.floor(Math.random() * emojis.length)];
979+
emoji.style.left = '50%';
980+
emoji.style.top = '50%';
981+
982+
const angle = (Math.random() * 360) * (Math.PI / 180);
983+
const distance = 200 + Math.random() * 400;
984+
const tx = Math.cos(angle) * distance + 'px';
985+
const ty = Math.sin(angle) * distance + 'px';
986+
const rot = (Math.random() - 0.5) * 1080 + 'deg';
987+
988+
emoji.style.setProperty('--tx', tx);
989+
emoji.style.setProperty('--ty', ty);
990+
emoji.style.setProperty('--rot', rot);
991+
emoji.style.fontSize = (1.5 + Math.random() * 2) + 'rem';
992+
993+
document.body.appendChild(emoji);
994+
setTimeout(() => emoji.remove(), 1500);
995+
}, i * 20);
996+
}
997+
998+
// Emoji rain effect
999+
for (let i = 0; i < 30; i++) {
1000+
setTimeout(() => {
1001+
const emoji = document.createElement('div');
1002+
emoji.className = 'emoji-rain';
1003+
emoji.textContent = emojis[Math.floor(Math.random() * emojis.length)];
1004+
emoji.style.left = Math.random() * 100 + 'vw';
1005+
emoji.style.top = '-50px';
1006+
emoji.style.fontSize = (1 + Math.random() * 2) + 'rem';
1007+
emoji.style.animationDuration = (2 + Math.random() * 2) + 's';
1008+
1009+
document.body.appendChild(emoji);
1010+
setTimeout(() => emoji.remove(), 4000);
1011+
}, i * 100);
1012+
}
1013+
1014+
// Epic confetti burst
1015+
const duration = 3000;
1016+
const end = Date.now() + duration;
1017+
1018+
(function frame() {
1019+
confetti({
1020+
particleCount: 7,
1021+
angle: 60,
1022+
spread: 55,
1023+
origin: { x: 0 },
1024+
colors: ['#512BD4', '#0078d4', '#9B4DFF', '#00d4ff', '#ff6b6b', '#feca57', '#00ff00', '#ff00ff']
1025+
});
1026+
confetti({
1027+
particleCount: 7,
1028+
angle: 120,
1029+
spread: 55,
1030+
origin: { x: 1 },
1031+
colors: ['#512BD4', '#0078d4', '#9B4DFF', '#00d4ff', '#ff6b6b', '#feca57', '#00ff00', '#ff00ff']
1032+
});
1033+
1034+
if (Date.now() < end) {
1035+
requestAnimationFrame(frame);
1036+
}
1037+
}());
1038+
1039+
// Play a fun sound effect message
1040+
console.log('%c🎮 KONAMI CODE ACTIVATED! 🐒🍌🎉', 'font-size: 24px; color: #9B4DFF; font-weight: bold;');
1041+
}
1042+
8861043
// Update language
8871044
function updateLanguage(lang) {
8881045
localStorage.setItem('workshop-lang', lang);

0 commit comments

Comments
 (0)