A dark, mysterious five-act ARG built around hidden archives and forgotten witnesses.

Commit a02fe2fc

a02fe2fc8753Merged

Fenria-Aspen <[email protected]> · 1 month ago · 6 files · +5 added · ~1 modified

Description

Add inventory, evidence board, cipher decoder, and UI systems

Details

Commit
a02fe2fc8753
Parent
640e2e95b9f7

assets/js/app.jsmodifiedView file

@@ -1,49 +1,62 @@
1-document.addEventListener('DOMContentLoaded', () => {
2- const page = document.body.dataset.page;
3- const form = document.querySelector('form');
4- const resultElement = document.getElementById('result');
1+// Main application initialization
52
6- if (!form || !resultElement) return;
7-
8- const navigationMap = {
9- landing: 'act1.html',
10- act1: 'act2.html',
11- act2: 'act3.html',
12- act3: 'act4.html',
13- act4: 'act5.html',
14- act5: null
15- };
16-
17- const showResult = (message, isSuccess) => {
18- resultElement.textContent = message;
19- resultElement.className = `result ${isSuccess ? 'success' : 'error'}`;
20- };
21-
22- form.addEventListener('submit', (e) => {
23- e.preventDefault();
24-
25- const input = form.querySelector('input[type="text"]');
26- const userAnswer = input.value.trim().toUpperCase();
27- const expectedAnswer = form.dataset.answer.toUpperCase();
28-
29- if (userAnswer !== expectedAnswer) {
30- showResult('The archive rejects the answer. Try again.', false);
31- return;
3+document.addEventListener('DOMContentLoaded', () => {
4+ // Initialize game state
5+ GameState.init();
6+
7+ // Render initial page
8+ UIRouter.navigate(GameState.currentPage || 'landing');
9+
10+ // Update progress bar
11+ const progressFill = document.querySelector('.progress-fill');
12+ const completion = GameState.getCompletion();
13+ progressFill.style.width = completion + '%';
14+
15+ // Update status
16+ const statusEl = document.querySelector('.status');
17+ if (GameState.currentAct > 0) {
18+ statusEl.textContent = `ACT ${GameState.currentAct + 1}/5`;
19+ }
20+
21+ // Keyboard shortcuts
22+ document.addEventListener('keydown', (e) => {
23+ // Alt+1 through Alt+5 for act navigation
24+ 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+ }
3229 }
33-
34- showResult('Signal accepted. The archive opens.', true);
35- input.disabled = true;
36- form.querySelector('button').disabled = true;
37-
38- const nextPage = navigationMap[page];
39- if (nextPage) {
40- setTimeout(() => {
41- window.location.href = nextPage;
42- }, 1200);
30+
31+ // Alt+H for home
32+ if (e.altKey && e.key === 'h') {
33+ UIRouter.navigate('landing');
34+ }
35+
36+ // Alt+I for inventory
37+ if (e.altKey && e.key === 'i') {
38+ UIRouter.navigate('inventory');
39+ }
40+ });
41+
42+ // Easter egg: Konami code
43+ 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) {
50+ GameState.discoverSecret('konami_code');
51+ alert('🎮 CHEAT CODE ACTIVATED\n\nSecret content unlocked.');
52+ konamiIndex = 0;
53+ }
4354 } else {
44- setTimeout(() => {
45- showResult('Archive complete. You are now the witness. The archive remembers you.', true);
46- }, 1200);
55+ konamiIndex = 0;
4756 }
4857 });
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()}%`);
4962 });