-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
49 lines (40 loc) · 1.48 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
//THIS APP IS NOT THE EXACT COPY OF THE APP STORE BUT IS SIMILAR TO IT ;).... and btw inspired by Aysenur Turk's pen (who i follow A LOT).
const side_bar_btns = document.querySelectorAll("#sidebar-btn");
side_bar_btns.forEach((elem) => {
elem.addEventListener("click", () => {
for (let index = 0; index < side_bar_btns.length; index++) {
side_bar_btns[index].classList.remove("active");
}
elem.classList.add("active");
});
});
let min = true;
document.querySelector(".window__close").addEventListener("click", () => {
document.querySelector(".container").style.display = "none";
setTimeout(() => {
window.alert(
"Oh No! What did you do? Now you have to refresh to open the app again"
);
}, 500);
});
document.querySelector(".window__maximize").addEventListener("click", () => {
if (min == false) {
min = true;
console.log(min);
document.querySelector(".container").style.width = "90%";
document.querySelector(".container").style.height = "90%";
} else {
min = false;
document.querySelector(".container").style.width = "100%";
document.querySelector(".container").style.height = "100%";
}
});
document.querySelector(".window__minimize").addEventListener("click", () => {
console.log("hello world");
document.querySelector(".container").style.transform = "scale(0)";
setTimeout(() => {
window.alert(
"The app is minimized but cannot be opened again because the virtual codepen macos crashed!"
);
}, 500);
});