-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProject.js
More file actions
43 lines (30 loc) · 1.13 KB
/
Copy pathProject.js
File metadata and controls
43 lines (30 loc) · 1.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
var icon =document.getElementById("img1id");
icon.onclick = function(){
document.body.classList.toggle("dark-theme");
if( document.body.classList.contains("dark-theme")){
icon.src ="sun.png";
}
else{
icon.src="moon.png";
}
}
document.addEventListener('DOMContentLoaded', function() {
const links = document.querySelectorAll('.btn');
links.forEach(link => {
link.addEventListener('click', function(event) {
event.preventDefault(); // Prevent the default link behavior
// Add the fade-out class to the body
document.body.classList.add('fade-out');
// Delay navigation to allow the fade-out effect to complete
setTimeout(() => {
window.location.href = link.href; // Navigate to the new page
}, 500); // The duration should match the CSS transition time
});
});
});
/* ////////////////*/
// var icon2 =document.getElementById("icon11");
// icon2.onclick = function(){
// var element=document.getElementById("mydiv");
// element.classList.toggle("mystyle");
// }