-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
101 lines (84 loc) · 3.03 KB
/
script.js
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
document.addEventListener('DOMContentLoaded', function () {
const currentPath = window.location.pathname;
const baristaElement = document.querySelector('.barista');
const oldenburgElement = document.querySelector('.oldenburg');
const oliviaElement = document.querySelector('.olivia');
const nithinElement = document.querySelector('.nithin');
const mayElement = document.querySelector('.may');
const discordElement = document.querySelector('.discord');
const laptopElement = document.querySelector('.laptop');
if (currentPath.includes('scene1.html')) {
if (baristaElement) {
baristaElement.classList.add('pulse-animation');
baristaElement.addEventListener('click', function () {
window.location.href = 'joe1.html';
});
}
} else if (currentPath.includes('scene2.html')) {
if (oldenburgElement) {
oldenburgElement.classList.add('pulse-animation');
oldenburgElement.addEventListener('click', function () {
window.location.href = 'oldenburg.html';
});
}
if (laptopElement) {
laptopElement.classList.add('pulse-animation');
laptopElement.addEventListener('click', function () {
window.location.href = 'laptop.html';
});
}
} else if (currentPath.includes('scene3.html')) {
if (baristaElement) {
baristaElement.classList.add('pulse-animation');
baristaElement.addEventListener('click', function () {
window.location.href = 'joe2.html';
});
}
if (oliviaElement) {
oliviaElement.classList.add('pulse-animation');
oliviaElement.addEventListener('click', function () {
window.location.href = 'olivia.html';
});
}
if (mayElement) {
mayElement.classList.add('pulse-animation');
mayElement.addEventListener('click', function () {
window.location.href = 'may.html';
});
}
if (nithinElement) {
nithinElement.classList.add('pulse-animation');
nithinElement.addEventListener('click', function () {
window.location.href = 'nithin.html';
});
}
}
else if (currentPath.includes('scene4.html')) {
if (discordElement) {
discordElement.classList.add('pulse-animation');
discordElement.addEventListener('click', function () {
window.location.href = 'discord.html';
});
}
}
else if (currentPath.includes('ending.html')) {
if (baristaElement) {
baristaElement.classList.add('pulse-animation');
baristaElement.addEventListener('click', function () {
window.location.href = 'ending-slide.html';
});
}
}
// Add more conditions for additional classes and HTML pages as needed
});
document.addEventListener('DOMContentLoaded', function () {
const restart = document.querySelector('.restart');
restart.addEventListener('click', function (event) {
event.preventDefault();
const isRestartConfirmed = window.confirm("Are you sure you want to restart from the beginning?");
if (isRestartConfirmed) {
window.location.href = "index.html";
} else {
}
});
});