A dark, mysterious five-act ARG built around hidden archives and forgotten witnesses.
Commit 7a48ce45
7a48ce452cb7Merged
Fenria-Aspen <[email protected]> · 1 month ago · 1 file · ~1 modified
Description
Fix application startup and progress initialization
Details
- Commit
- 7a48ce452cb7
- Parent
- 8b219ea0dd7a
assets/js/app.jsmodifiedView file
@@ -1,62 +1,26 @@
11
// Main application initialization2-
32
document.addEventListener('DOMContentLoaded', () => {4-
// Initialize game state53
GameState.init();6-
7-
// Render initial page8-
UIRouter.navigate(GameState.currentPage || 'landing');9-
10-
// Update progress bar11-
const progressFill = document.querySelector('.progress-fill');12-
const completion = GameState.getCompletion();13-
progressFill.style.width = completion + '%';14-
15-
// Update status16-
const statusEl = document.querySelector('.status');17-
if (GameState.currentAct > 0) {18-
statusEl.textContent = `ACT ${GameState.currentAct + 1}/5`;19-
}20-
21-
// Keyboard shortcuts22-
document.addEventListener('keydown', (e) => {23-
// Alt+1 through Alt+5 for act navigation24-
if (e.altKey && e.key >= '1' && e.key <= '5') {25-
const act = parseInt(e.key) - 1;26-
if (GameState.unlockedSections.has('act' + (act + 1))) {27-
UIRouter.navigate('act' + (act + 1));28-
}29-
}30-
31-
// Alt+H for home32-
if (e.altKey && e.key === 'h') {33-
UIRouter.navigate('landing');34-
}35-
36-
// Alt+I for inventory37-
if (e.altKey && e.key === 'i') {38-
UIRouter.navigate('inventory');39-
}40-
});41-
42-
// Easter egg: Konami code43-
const konamiCode = ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight', 'b', 'a'];44-
let konamiIndex = 0;45-
46-
document.addEventListener('keydown', (e) => {47-
if (e.key === konamiCode[konamiIndex]) {48-
konamiIndex++;49-
if (konamiIndex === konamiCode.length) {4+
UIRouter.currentPage = GameState.currentPage || 'landing';5+
UIRouter.render();6+
updateProgress();7+
const konamiCode = ['ArrowUp','ArrowUp','ArrowDown','ArrowDown','ArrowLeft','ArrowRight','ArrowLeft','ArrowRight','b','a'];8+
let index = 0;9+
document.addEventListener('keydown', event => {10+
if (event.key === konamiCode[index]) {11+
index++;12+
if (index === konamiCode.length) {5013
GameState.discoverSecret('konami_code');51-
alert('🎮 CHEAT CODE ACTIVATED\n\nSecret content unlocked.');52-
konamiIndex = 0;14+
alert('CHEAT CODE ACTIVATED\\nSecret content unlocked.');15+
index = 0;5316
}54-
} else {55-
konamiIndex = 0;56-
}17+
} else index = 0;5718
});58-
59-
console.log(`%c🏛️ THE HOLLOW ARCHIVE`, 'font-size: 20px; font-weight: bold; color: #ff4444;');60-
console.log('Welcome, witness. The archive is watching.');61-
console.log(`Completion: ${GameState.getCompletion()}%`);6219
});20+
21+
function updateProgress() {22+
const fill = document.querySelector('.progress-fill');23+
if (fill) fill.style.width = `${GameState.getCompletion()}%`;24+
const status = document.getElementById('footer-status');25+
if (status) status.textContent = 'ONLINE';26+
}