-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
159 lines (108 loc) · 4.13 KB
/
script.js
File metadata and controls
159 lines (108 loc) · 4.13 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
const closeNoise = new Audio('WEBSITE/audio/pow.mp3');
document.getElementById('openLightbox').addEventListener('click', function(event) {
event.preventDefault();
const lightbox = document.getElementById('lightbox');
lightbox.style.display = 'flex';
setTimeout(() => {
lightbox.classList.add('show');
}, 10);
document.getElementById('lightboxText').classList.add('fade-in');
});
document.getElementById('closeLightbox').addEventListener('click', function() {
const lightbox = document.getElementById('lightbox');
lightbox.classList.remove('show');
document.getElementById('lightboxText').classList.remove('fade-in');
closeNoise.play();
setTimeout(() => {
lightbox.style.display = 'none';
}, 500);
});
document.getElementById('lightbox').addEventListener('click', function(event) {
if (event.target === this) {
const lightbox = document.getElementById('lightbox');
lightbox.classList.remove('show');
document.getElementById('lightboxText').classList.remove('fade-in');
closeNoise.play();
setTimeout(() => {
lightbox.style.display = 'none';
}, 500);
}
});
const hieroglyphs = [
"𓀀", "𓀁", "𓀂", "𓀃", "𓀄", "𓀅", "𓀆", "𓀇",
"𓀈", "𓀉", "𓀊", "𓀋", "𓀌", "𓀍", "𓀎", "𓀏",
"𓀐", "𓀑", "𓀒", "𓀓", "𓀔", "𓀕", "𓀖", "𓀗",
"𓀘", "𓀙", "𓀚", "𓀛", "𓀜", "𓀝", "𓀞", "𓀟",
"𓀠", "𓀡", "𓀢", "𓀣", "𓀤", "𓀥", "𓀦", "𓀧",
"𓀨", "𓀩", "𓀪", "𓀫", "𓀬", "𓀭", "𓀮", "𓀯",
"𓀰", "𓀱", "𓀲", "𓀳", "𓀴", "𓀵", "𓀶", "𓀷",
"𓀸", "𓀹", "𓀺", "𓀻", "𓀼", "𓀽", "𓀾", "𓀿",
"𓁀", "𓁁", "𓁂", "𓁃", "𓁄", "𓁅", "𓁆", "𓁇",
];
const background = document.querySelector(".background");
function createGlyph() {
const glyph = document.createElement("div");
glyph.classList.add("glyph");
glyph.textContent = hieroglyphs[Math.floor(Math.random() * hieroglyphs.length)];
glyph.style.left = Math.random() * 100 + "vw";
glyph.style.top = Math.random() * 100 + "vh";
glyph.style.fontSize = Math.random() * 20 + 20 + "px";
glyph.style.animationDuration = Math.random() * 1 + 0.8 + "s";
background.appendChild(glyph);
setTimeout(() => {
glyph.remove();
}, 5000);
}
function createDustyGlyph() {
const glyph = document.createElement("div");
glyph.classList.add("glyph", "dusty");
glyph.textContent = hieroglyphs[Math.floor(Math.random() * hieroglyphs.length)];
glyph.style.left = Math.random() * 100 + "vw";
glyph.style.top = Math.random() * 100 + "vh";
glyph.style.fontSize = Math.random() * 10 + 8 + "px";
glyph.style.animationDuration = Math.random() * 1 + 1.2 + "s";
background.appendChild(glyph);
setTimeout(() => {
glyph.remove();
}, 8000);
}
setInterval(createGlyph, 100);
setInterval(createDustyGlyph, 300);
const proceedButton = document.getElementById('proceed-btn');
const hoverSound = document.getElementById('hover-sound');
proceedButton.addEventListener('mouseenter', () => {
hoverSound.currentTime = 0;
hoverSound.play();
});
const proceedLink = document.getElementById('proceed-btn');
proceedLink.style.pointerEvents = 'none';
document.querySelector('.kapow').addEventListener('click', function() {
proceedLink.style.pointerEvents = 'auto';
proceedLink.classList.add("active");
var audio = document.getElementById('background-music');
audio.muted = false;
audio.play();
});
const hoverSound2 = document.getElementById('hover');
hoverSound2.volume = 0.7;
hoverSound2.loop = true;
document.addEventListener('mouseover', () => {
if (hoverSound2.paused) {
hoverSound2.play();
}
});
const hoverSound3 = document.getElementById('hover2');
hoverSound3.volume = 0.9;
hoverSound3.loop = true;
const scanlinesElement = document.getElementById('scanlines');
scanlinesElement.addEventListener('mouseover', () => {
if (hoverSound3.paused) {
hoverSound3.play();
}
});
const specialGlyph = document.querySelector('.special-glyph');
document.addEventListener("DOMContentLoaded", () => {
specialGlyph.addEventListener("click", () => {
proceedButton.classList.add("active");
});
});