Repository navigation
Expand file tree
/
Copy pathscript.js
More file actions
88 lines (78 loc) · 4.65 KB
/
Copy pathscript.js
File metadata and controls
88 lines (78 loc) · 4.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
const galleryData = [
{ id: 1, thumb: "https://images.unsplash.com/photo-1517457373958-b7bdd4587205?q=80&w=400", secret: "https://images.unsplash.com/photo-1584441401319-819bc169707b?q=80&w=400" },
{ id: 2, thumb: "https://images.unsplash.com/photo-1529333166437-7750a6dd5a70?q=80&w=400", secret: "https://images.unsplash.com/photo-1518020382113-a7e8fc38eac9?q=80&w=400" },
{ id: 3, thumb: "https://images.unsplash.com/photo-1496337585846-c2453b7f0d16?q=80&w=400", secret: "https://images.unsplash.com/photo-1534353473418-4cfa6c56fd38?q=80&w=400" },
{ id: 4, thumb: "https://images.unsplash.com/photo-1519225421980-715cb0215aed?q=80&w=400", secret: "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?q=80&w=400" },
{ id: 5, thumb: "https://images.unsplash.com/photo-1520854221256-17451cc331bf?q=80&w=400", secret: "https://images.unsplash.com/photo-1519085360753-af0119f7cbe7?q=80&w=400" },
{ id: 6, thumb: "https://images.unsplash.com/photo-1464347601390-25e2842a37f7?q=80&w=400", secret: "https://images.unsplash.com/photo-1502672260266-1c1ef2d93688?q=80&w=400" }
];
const chatData = [
{ u: "Sarah", t: "Ashley found the letter." },
{ u: "Unknown", t: "Did she read it?" },
{ u: "Sarah", t: "No. I have it. Code 1024." },
{ u: "Unknown", t: "That's not the anniversary. That's the boat house." },
{ u: "Sarah", t: "Meet me at 0214." }
];
const noteData = [
{ t: "KEY_LOG", c: "Part 2 of system key: 30. Check the logs for Part 1." },
{ t: "DOCK_TIME", c: "Be there at 0214 sharp." },
{ t: "JUNK", c: "Milk, Bread, Tape, Shovel." }
];
let unlocked = { messages: false, vault: false };
function openApp(app) {
document.getElementById('bg-music').play();
if (app === 'messages' && !unlocked.messages) {
let code = prompt("SYSTEM_ENCRYPTED. ENTER 4-DIGIT KEY (P1+P2):");
if (code === "0730") { unlocked.messages = true; }
else { document.getElementById('sfx-error').play(); return; }
}
if (app === 'vault' && !unlocked.vault) {
let code = prompt("RECOVERY_KEY_REQUIRED (HHMM):");
if (code === "0214") { unlocked.vault = true; }
else { document.getElementById('sfx-error').play(); return; }
}
document.getElementById('window-' + app).classList.remove('hidden');
if(app === 'gallery') loadGallery();
if(app === 'messages') loadChats();
if(app === 'notes') loadNotes();
}
function loadGallery() {
const grid = document.getElementById('main-grid');
grid.innerHTML = galleryData.map(p => `<img src="${p.thumb}" class="photo-item" onclick="viewPhoto('${p.thumb}', '${p.secret}')">`).join('');
}
function loadChats() {
const list = document.getElementById('chat-list');
list.innerHTML = chatData.map(c => `<div class="chat-bubble"><strong>${c.u}:</strong> ${c.t}</div>`).join('');
}
function loadNotes() {
const list = document.getElementById('notes-list');
list.innerHTML = noteData.map(n => `<div class="note-item" style="border-bottom:1px solid #222; padding:10px 0;"><strong style="color:var(--accent);font-size:0.6rem;">${n.t}</strong><p style="font-size:0.8rem;margin:5px 0;">${n.c}</p></div>`).join('');
}
function viewPhoto(thumb, secret) {
const overlay = document.getElementById('overlay');
overlay.style.display = 'flex';
document.getElementById('media-holder').innerHTML = `<img src="${thumb}" id="active-img">`;
const img = document.getElementById('active-img');
const bar = document.getElementById('progress-bar-container');
const innerBar = document.getElementById('progress-bar');
const label = document.getElementById('decrypt-label');
const reveal = () => {
document.getElementById('sfx-decrypt').play();
bar.style.display = 'block';
label.innerText = "DECRYPTING...";
let w = 0;
const iv = setInterval(() => {
w += 10; innerBar.style.width = w + '%';
if (w >= 100) { clearInterval(iv); img.src = secret; label.innerText = "SUCCESS."; }
}, 50);
img.onmouseup = img.ontouchend = () => {
clearInterval(iv); document.getElementById('sfx-decrypt').pause();
bar.style.display = 'none'; innerBar.style.width = '0%';
img.src = thumb; label.innerText = "HOLD TO DECRYPT IMAGE";
};
};
img.onmousedown = img.ontouchstart = reveal;
}
function closeApp(app) { document.getElementById('window-' + app).classList.add('hidden'); }
function closeOverlay() { document.getElementById('overlay').style.display = 'none'; }
function startSystem() { document.getElementById('boot-screen').classList.add('hidden'); document.getElementById('desktop').classList.remove('hidden'); document.getElementById('bg-music').play(); }