-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscript.js
110 lines (93 loc) · 3.2 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
98
99
100
101
102
103
104
105
106
107
108
109
110
document.addEventListener("DOMContentLoaded", () => {
// Get the buttons by their IDs
const aboutButton = document.getElementById("about-button");
const startButton = document.getElementById("start-button");
const questButton = document.getElementById("start-quest");
const mentorButton = document.getElementById("mentor");
const starButton = document.getElementById("star-button");
const mapButton = document.getElementById("mapbutton");
// Add event listener for starButton if it exists
if (starButton) {
starButton.addEventListener("click", () => {
window.location.href = "scroll.html";
});
}
// Add event listener for mapButton if it exists
if (mapButton) {
mapButton.addEventListener("click", () => {
window.location.href = "home.html";
});
}
// Add event listener for questButton if it exists
if (questButton) {
questButton.addEventListener("click", () => {
window.location.href = "map.html";
});
}
// Add event listener for mentorButton if it exists
if (mentorButton) {
mentorButton.addEventListener("click", () => {
window.location.href = "mentor.html";
});
}
// Add event listener for aboutButton if it exists
if (aboutButton) {
aboutButton.addEventListener("click", () => {
window.location.href = "about.html";
});
}
// Add event listener for startButton if it exists
if (startButton) {
startButton.addEventListener("click", () => {
window.location.href = "home.html";
});
}
});
document.addEventListener("DOMContentLoaded", () => {
const goBackButton = document.getElementById("go-back-button");
goBackButton.addEventListener("click", (event) => {
event.preventDefault(); // Prevent the default link behavior
window.location.href = "index.html"; // Redirect to the home page
});
});
document.addEventListener("DOMContentLoaded", () => {
const goBackButton = document.getElementById("go-back-button");
goBackButton.addEventListener("click", (event) => {
event.preventDefault(); // Prevent the default link behavior
window.location.href = "index.html"; // Redirect to the home page
});
});
document.addEventListener("DOMContentLoaded", function () {
// Get the back button element
var backButton = document.getElementById("backButton");
// Add an event listener to handle the click event
backButton.addEventListener("click", function () {
// Navigate back to the previous page
window.history.back();
});
});
document.addEventListener("DOMContentLoaded", (event) => {
const leftStar = document.querySelector(".left-star");
const backButton = document.querySelector(".home-icon");
if (leftStar) {
leftStar.addEventListener("click", () => {
window.location.href = "achievements.html";
});
}
if (backButton) {
backButton.addEventListener("click", () => {
window.location.href = "home.html";
});
}
});
document.getElementById("uploadBtn").addEventListener("click", function () {
document.getElementById("fileInput").click();
});
document
.getElementById("fileInput")
.addEventListener("change", function (event) {
const file = event.target.files[0];
if (file) {
console.log("File selected:", file.name);
}
});