-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.js
42 lines (32 loc) · 1.37 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
document.addEventListener("DOMContentLoaded", function () {
const images = ["Clock [email protected]", "Clock [email protected]", "Clock [email protected]", "Clock [email protected]", "Clock [email protected]", "Clock [email protected]", "Clock [email protected]", "Clock [email protected]"]; // Add more image file names as needed
const imageElement = document.getElementById("changing-image");
let currentIndex = 0;
function changeImage() {
currentIndex = (currentIndex + 1) % images.length;
imageElement.src = images[currentIndex];
}
setInterval(changeImage, 400); // Change image every 5 seconds (adjust the interval as needed)
});
function changeImage() {
document.getElementById("image").src = "LampOn.png"; // Change to the new image on hover
}
function restoreImage() {
document.getElementById("image").src = "LampOff.png"; // Restore the original image on mouseout
}
function flipImage() {
flipCardInner.style.transformOrigin = "center bottom";
document.querySelector(".fall-over-inner").style.transform = "rotateX(180deg)";
}
function unflipImage() {
flipCardInner.style.transformOrigin = "center bottom";
document.querySelector(".fall-over-inner").style.transform = "rotateX(0deg)";
}
function darkmode() {
var element = document.body;
element.classList.toggle("dark-mode");
}
function lightmode() {
var element = document.body;
element.classList.toggle("light-mode");
}