Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 29 additions & 5 deletions src/assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,22 @@ function unlockEgg(eggId) {
updateGameUI();
}
}

/**
* UNIVERSAL EGG UNLOCKER
* First trigger of any secret adds +1 to Level progress
* Grants exactly one level per unique secret type.
*/
function triggerSecretUnlock(effectType) {
if (effectType === 'matrix') initMatrix();
else if (effectType === 'konami') activateKonami();
else if (effectType === 'gravity') triggerGravity(null);
// 1. Run the Visuals (These run every time)
if (effectType === 'matrix') {
initMatrix();
} else if (effectType === 'konami') {
activateKonami();
} else if (effectType === 'gravity') {
triggerGravity(null);
}

// 2. Grant Level (Only runs the VERY first time for each ID)
// IDs are static: 'secret_matrix', 'secret_konami', 'secret_gravity'
unlockEgg(`secret_${effectType}`);
}

Expand Down Expand Up @@ -232,6 +238,7 @@ function scrollToRandomUser() {
surpriseClickCount++;
if (surpriseClickCount >= 5) {
surpriseClickCount = 0;
// This now checks for 'secret_matrix' and won't level up twice
triggerSecretUnlock('matrix');
}

Expand Down Expand Up @@ -356,6 +363,23 @@ function closeMatrix() {
}

document.addEventListener('DOMContentLoaded', () => {
// Secret: Triple-tap the copyright year in the footer to open Dev Tools on mobile
const footerYear = document.getElementById('current-year');
let tapCount = 0;

if (footerYear) {
footerYear.addEventListener('touchstart', () => {
tapCount++;
if (tapCount === 3) {
const devPanel = document.getElementById('dev-tools');
devPanel.classList.toggle('hidden');
playSound('secret');
tapCount = 0;
}
// Reset count if they stop tapping for 1 second
setTimeout(() => { tapCount = 0; }, 1000);
});
}
applyTheme(localStorage.getItem('theme') || 'light');
updateGameUI();
});
Loading