Skip to content
Merged
Show file tree
Hide file tree
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
33 changes: 20 additions & 13 deletions src/_includes/footer.njk
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,22 @@
<span class="text-[var(--text-muted)] text-[10px] font-black uppercase tracking-widest">Build: {{ build.timestamp }}</span>
</div>

<div class="flex items-center bg-[var(--bg-card)] border border-[var(--border-color)] rounded-lg overflow-hidden shadow-sm">
<button onclick="triggerGravity(event)" class="px-3 py-1.5 text-[10px] font-mono hover:bg-red-500/10 transition-colors group/hash">
<span class="text-[var(--text-muted)] group-hover/hash:text-red-500">Hash:</span>
<span class="text-accent font-bold underline decoration-dotted">{{ build.hash }}</span>
</button>
<div class="flex items-center bg-[var(--bg-card)] border border-[var(--border-color)] rounded-lg overflow-hidden shadow-sm">
<button onclick="triggerSecretUnlock('gravity')" class="px-3 py-1.5 text-[10px] font-mono hover:bg-red-500/10 transition-colors group/hash">
<span class="text-[var(--text-muted)] group-hover/hash:text-red-500">Hash:</span>
<span class="text-accent font-bold underline decoration-dotted">
<code class="cursor-pointer hover:text-red-500 transition-colors">{{ build.hash }}</code>
</span>
</button>

<a href="{{ build.repoUrl }}/commit/{{ build.hash }}"
target="_blank"
rel="noopener"
class="px-3 py-1.5 border-l border-[var(--border-color)] bg-[var(--bg-footer)] hover:text-accent transition-colors"
title="View Commit on GitHub">
<span>↗</span>
</a>
</div>
<a href="{{ build.repoUrl }}/commit/{{ build.hash }}"
target="_blank"
rel="noopener"
class="px-3 py-1.5 border-l border-[var(--border-color)] bg-[var(--bg-footer)] hover:text-accent transition-colors"
title="View Commit on GitHub">
<span>↗</span>
</a>
</div>
</div>

</div>
Expand Down Expand Up @@ -65,6 +67,11 @@
<span class="opacity-50">+1 LVL</span>
</button>

<button onclick="triggerSecretUnlock('badge_click')" class="w-full py-2 bg-white/5 hover:bg-purple-500/20 text-purple-400 text-[10px] border border-purple-500/30 rounded-lg transition-all flex justify-between px-3">
<span>UNLOCK_BADGE_XP</span>
<span class="opacity-50">+1 LVL</span>
</button>

<div class="pt-2">
<button onclick="localStorage.clear(); location.reload();" class="w-full py-3 bg-blue-600/20 hover:bg-blue-600/40 text-blue-400 text-[10px] font-bold border border-blue-500/30 rounded-lg transition-all">
RESET_PLAYER_DATA
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/header.njk
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{% endif %}

<div id="game-stats" class="flex items-center gap-3 md:gap-4 px-3 py-1.5 md:px-4 md:py-2 bg-[var(--bg-card)] border border-[var(--border-color)] rounded-2xl shadow-sm">
<div id="level-badge" class="w-8 h-8 md:w-10 md:h-10 flex items-center justify-center rounded-xl text-lg md:text-xl bg-black/5 dark:bg-white/5">🐣</div>
<div id="level-badge" onclick="handleLevelClick()" class="w-8 h-8 md:w-10 md:h-10 flex items-center justify-center rounded-xl text-lg md:text-xl bg-black/5 dark:bg-white/5">🐣</div>

<div class="hidden sm:flex flex-col">
<div class="flex items-center gap-2">
Expand Down
16 changes: 12 additions & 4 deletions src/assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,25 +147,33 @@ function unlockEgg(eggId) {
updateGameUI();
}
}

/**
* UNIVERSAL EGG UNLOCKER
* Grants exactly one level per unique secret type.
* 4 Secrets: matrix, konami, gravity (hash), badge_click
*/
function triggerSecretUnlock(effectType) {
// 1. Run the Visuals (These run every time)
// 1. Trigger Visuals
if (effectType === 'matrix') {
initMatrix();
} else if (effectType === 'konami') {
activateKonami();
} else if (effectType === 'gravity') {
// This is triggered by clicking the Hash or the Dev Button
triggerGravity(null);
} else if (effectType === 'badge_click') {
playSound('click');
}

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

// Ensure the actual badge click also uses this logic
function handleLevelClick() {
triggerSecretUnlock('badge_click');
}

function showLevelUpNotification(newLevelIndex) {
const levelIndex = Math.min(newLevelIndex, LEVELS.length - 1);
const rank = LEVELS[levelIndex];
Expand Down
Loading