Skip to content

Commit dbc678b

Browse files
authored
Fix console position CSS (NextCommunity#241)
1 parent 8e761d5 commit dbc678b

File tree

2 files changed

+32
-14
lines changed

2 files changed

+32
-14
lines changed

src/assets/css/style.css

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,17 +148,26 @@ html, body {
148148
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
149149
}
150150

151-
/* NUCLEAR LOCK: Override during Self Destruct */
151+
/* NUCLEAR LOCK: Forces console to stay in your literal eyeballs */
152152
html body #dev-tools[data-lock="true"] {
153153
display: block !important;
154154
visibility: visible !important;
155155
opacity: 1 !important;
156-
top: 1rem !important;
157-
right: 1rem !important;
158-
border-left-color: var(--danger) !important;
159-
box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
160-
animation: none !important; /* Prevent it from shaking with the body */
156+
157+
/* Stick to the screen, not the page content */
158+
position: fixed !important;
159+
top: 20px !important;
160+
right: 20px !important;
161+
162+
/* Ensure it is ABOVE the glitch/shake layers */
163+
z-index: 2147483647 !important;
164+
165+
/* Stop it from flying away or shaking */
161166
transform: none !important;
167+
animation: none !important;
168+
169+
border-color: #ef4444 !important;
170+
box-shadow: 0 0 40px rgba(239, 68, 68, 0.6) !important;
162171
}
163172

164173
/* Custom Scrollbar for the console */

src/assets/js/script.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -370,54 +370,63 @@ function closeMatrix() {
370370
window.startSelfDestruct = function() {
371371
const btn = document.getElementById('self-destruct-btn');
372372
const devPanel = document.getElementById('dev-tools');
373-
const timerDisplay = document.getElementById('destruct-timer');
374-
const progressBar = document.getElementById('destruct-bar');
375-
const statusText = document.getElementById('destruct-text');
376373

377374
if (destructInterval) return;
378375

379376
initAudio();
380-
document.body.appendChild(devPanel);
377+
378+
// Move to HTML tag so it ignores Body shakes and stays at top of screen
379+
document.documentElement.appendChild(devPanel);
381380
devPanel.setAttribute('data-lock', 'true');
381+
devPanel.classList.remove('hidden');
382+
382383
btn.classList.add('is-destructing');
383384

384385
let timeLeft = 10;
385386

386387
destructInterval = setInterval(() => {
387388
timeLeft--;
388389

390+
// RE-FETCH elements inside the panel to ensure they aren't null
391+
const timerDisplay = document.getElementById('destruct-timer');
392+
const progressBar = document.getElementById('destruct-bar');
393+
const statusText = document.getElementById('destruct-text');
394+
395+
// Update the numerical text
389396
if (timerDisplay) {
390397
timerDisplay.innerText = `${timeLeft}s`;
391-
timerDisplay.style.color = "#fff";
392398
}
393399

400+
// Update the progress bar logic
394401
if (progressBar) {
395402
const percent = ((10 - timeLeft) / 10) * 100;
396403
progressBar.style.width = `${percent}%`;
404+
405+
// Color Shift
397406
if (timeLeft > 5) progressBar.style.backgroundColor = "#22c55e";
398407
else if (timeLeft > 2) progressBar.style.backgroundColor = "#eab308";
399408
else progressBar.style.backgroundColor = "#ef4444";
400409
}
401410

411+
// Audio Pitch Increase
402412
if (audioCtx) {
403413
const osc = audioCtx.createOscillator();
404414
const g = audioCtx.createGain();
405415
osc.connect(g); g.connect(audioCtx.destination);
406-
osc.frequency.setValueAtTime(300 + (10 - timeLeft) * 50, audioCtx.currentTime);
416+
osc.frequency.setValueAtTime(300 + (10 - timeLeft) * 60, audioCtx.currentTime);
407417
g.gain.setValueAtTime(0.1, audioCtx.currentTime);
408418
g.gain.exponentialRampToValueAtTime(0.001, audioCtx.currentTime + 0.1);
409419
osc.start(); osc.stop(audioCtx.currentTime + 0.1);
410420
}
411421

412422
if (timeLeft <= 4) {
413423
document.body.classList.add('glitch-shake');
414-
if (statusText) statusText.innerText = "SYSTEM_FAILURE_IMMINENT";
424+
if (statusText) statusText.innerText = "CRITICAL_FAILURE";
415425
}
416426

417427
if (timeLeft <= 0) {
418428
clearInterval(destructInterval);
419429
destructInterval = null;
420-
devPanel.setAttribute('data-lock', 'false');
421430
triggerSecretUnlock('gravity');
422431
}
423432
}, 1000);

0 commit comments

Comments
 (0)