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

Viewing files at commit 0d24b8359f5aCommit detailsView latest

assets/js/app.js 26 lines · 933 B · javascript
1
// Main application initialization
2
document.addEventListener('DOMContentLoaded', () => {
3
  GameState.init();
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) {
13
        GameState.discoverSecret('konami_code');
14
        alert('CHEAT CODE ACTIVATED\\nSecret content unlocked.');
15
        index = 0;
16
      }
17
    } else index = 0;
18
  });
19
});
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
}