Skip to content

Commit 0e9e967

Browse files
committed
Focus on d overrides
1 parent c292721 commit 0e9e967

2 files changed

Lines changed: 32 additions & 17 deletions

File tree

src/_includes/footer.njk

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,34 +52,34 @@
5252
</div>
5353

5454
<div class="grid grid-cols-2 gap-1.5 mb-2">
55-
<button onclick="triggerSecretUnlock('matrix')" class="py-1.5 bg-green-500/5 hover:bg-green-500/20 text-green-500 text-[8px] border border-green-500/20 rounded transition-all">
55+
<button onclick="triggerSecretUnlock('matrix')" class="override-btn py-1.5 bg-green-500/5 hover:bg-green-500/20 text-green-500 text-[8px] border border-green-500/20 rounded transition-all">
5656
MATRIX
5757
</button>
58-
<button onclick="triggerSecretUnlock('konami')" class="py-1.5 bg-yellow-500/5 hover:bg-yellow-500/20 text-yellow-500 text-[8px] border border-yellow-500/20 rounded transition-all">
58+
<button onclick="triggerSecretUnlock('konami')" class="override-btn py-1.5 bg-yellow-500/5 hover:bg-yellow-500/20 text-yellow-500 text-[8px] border border-yellow-500/20 rounded transition-all">
5959
KONAMI
6060
</button>
61-
<button onclick="triggerSecretUnlock('gravity')" class="py-1.5 bg-red-500/5 hover:bg-red-500/20 text-red-500 text-[8px] border border-red-500/20 rounded transition-all">
61+
<button onclick="triggerSecretUnlock('gravity')" class="override-btn py-1.5 bg-red-500/5 hover:bg-red-500/20 text-red-500 text-[8px] border border-red-500/20 rounded transition-all">
6262
GRAVITY
6363
</button>
64-
<button onclick="triggerSecretUnlock('badge_click')" class="py-1.5 bg-purple-500/5 hover:bg-purple-500/20 text-purple-400 text-[8px] border border-purple-500/20 rounded transition-all">
64+
<button onclick="triggerSecretUnlock('badge_click')" class="override-btn py-1.5 bg-purple-500/5 hover:bg-purple-500/20 text-purple-400 text-[8px] border border-purple-500/20 rounded transition-all">
6565
BADGE_XP
6666
</button>
6767
</div>
6868

6969
<div class="space-y-1 mb-2">
70-
<button onclick="addExperience(5); playSound('click');" class="w-full flex justify-between px-2 py-1 bg-cyan-500/5 text-cyan-400 text-[8px] border border-cyan-500/20 rounded">
70+
<button onclick="addExperience(5); playSound('click');" class="override-btn w-full flex justify-between px-2 py-1 bg-cyan-500/5 text-cyan-400 text-[8px] border border-cyan-500/20 rounded">
7171
<span>💎 SKILL_MINER</span>
7272
<span class="opacity-50">+5</span>
7373
</button>
74-
<button onclick="addExperience(15); playSound('restore');" class="w-full flex justify-between px-2 py-1 bg-pink-500/5 text-pink-400 text-[8px] border border-pink-500/20 rounded">
74+
<button onclick="addExperience(15); playSound('restore');" class="override-btn w-full flex justify-between px-2 py-1 bg-pink-500/5 text-pink-400 text-[8px] border border-pink-500/20 rounded">
7575
<span>🛠️ SYS_OPTIMIZE</span>
7676
<span class="opacity-50">+15</span>
7777
</button>
78-
<button onclick="triggerMagicXP(); playSound('levelUp');" class="w-full flex justify-between px-2 py-1.5 bg-gradient-to-r from-purple-600/20 to-blue-600/20 text-purple-400 text-[8px] border border-purple-500/30 rounded hover:from-purple-600/40 hover:to-blue-600/40 transition-all group">
78+
<button onclick="triggerMagicXP(); playSound('levelUp');" class="override-btn w-full flex justify-between px-2 py-1.5 bg-gradient-to-r from-purple-600/20 to-blue-600/20 text-purple-400 text-[8px] border border-purple-500/30 rounded hover:from-purple-600/40 hover:to-blue-600/40 transition-all group">
7979
<span>✨ CAST_MAGIC_XP</span>
8080
<span class="group-hover:animate-pulse">+50 XP</span>
8181
</button>
82-
<button onclick="toggleScreenshotMode()" class="w-full flex justify-between px-2 py-1 bg-white/5 text-slate-400 text-[8px] border border-white/10 rounded">
82+
<button onclick="toggleScreenshotMode()" class="override-btn w-full flex justify-between px-2 py-1 bg-white/5 text-slate-400 text-[8px] border border-white/10 rounded">
8383
<span>📸 SCREENSHOT</span>
8484
<span class="opacity-50">[5 Seconds]</span>
8585
</button>
@@ -93,11 +93,12 @@
9393
placeholder="0"
9494
min="0"
9595
max="200"
96+
class="override-btn"
9697
style="background-color: #000 !important; color: #00ffcc !important; border: 1px solid #00ffcc !important; width: 60px !important; height: 30px !important; font-size: 14px !important; padding: 0 5px !important; border-radius: 4px !important;"
9798
>
9899
<button
99100
onclick="jumpToLevel()"
100-
class="flex-1 bg-accent/20 hover:bg-accent/40 text-accent text-[10px] font-black py-1 rounded transition-all border border-accent/40 uppercase"
101+
class="override-btn flex-1 bg-accent/20 hover:bg-accent/40 text-accent text-[10px] font-black py-1 rounded transition-all border border-accent/40 uppercase"
101102
style="height: 30px !important;"
102103
>
103104
EXECUTE
@@ -106,11 +107,11 @@
106107
</div>
107108

108109
<div class="flex gap-1.5 pt-2 border-t border-white/10">
109-
<button id="self-destruct-btn" onclick="startSelfDestruct()" class="flex-1 py-1.5 bg-red-600/10 hover:bg-red-600/30 text-red-500 text-[8px] border border-red-500/30 rounded flex justify-center gap-1">
110+
<button id="self-destruct-btn" onclick="startSelfDestruct()" class="override-btn flex-1 py-1.5 bg-red-600/10 hover:bg-red-600/30 text-red-500 text-[8px] border border-red-500/30 rounded flex justify-center gap-1">
110111
<span id="destruct-text">DESTRUCT</span>
111112
<span id="destruct-timer"></span>
112113
</button>
113-
<button onclick="localStorage.clear(); location.reload();" class="px-2 py-1.5 bg-blue-600/10 hover:bg-blue-600/30 text-blue-400 text-[8px] border border-blue-500/20 rounded uppercase">
114+
<button onclick="localStorage.clear(); location.reload();" class="override-btn px-2 py-1.5 bg-blue-600/10 hover:bg-blue-600/30 text-blue-400 text-[8px] border border-blue-500/20 rounded uppercase">
114115
Reset
115116
</button>
116117
</div>

src/assets/js/script.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -682,13 +682,27 @@ window.addEventListener('keydown', (e) => {
682682
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return;
683683

684684
if (key === 'd') {
685-
const devPanel = document.getElementById('dev-tools');
686-
if (devPanel) {
687-
const isHidden = devPanel.classList.toggle('hidden');
688-
localStorage.setItem('devToolsVisible', !isHidden);
689-
playSound(isHidden ? 'click' : 'secret');
685+
e.preventDefault();
686+
687+
const systemDash = document.getElementById('dev-tools'); // Adjust ID as needed
688+
const isOpening = systemDash.classList.contains('hidden');
689+
690+
if (isOpening) {
691+
document.getElementById('matrix-console-container').classList.add('hidden');
692+
systemDash.classList.remove('hidden');
693+
694+
// Wait 100-150ms for the animation/display to settle
695+
setTimeout(() => {
696+
// Find the first interactive element (button or link)
697+
const firstControl = systemDash.querySelector('button, a, input');
698+
if (firstControl) {
699+
firstControl.focus();
700+
}
701+
}, 150);
702+
} else {
703+
systemDash.classList.add('hidden');
704+
document.body.focus(); // Return focus to the page
690705
}
691-
return;
692706
}
693707

694708
if (key === konamiCode[konamiPosition]) {

0 commit comments

Comments
 (0)