-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscript.js
54 lines (43 loc) · 2.61 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
//
// ██╗░░░██╗██╗███╗░░██╗░█████╗░██████╗░
// ██║░░░██║██║████╗░██║██╔══██╗██╔══██╗
// ╚██╗░██╔╝██║██╔██╗██║██║░░██║██║░░██║
// ░╚████╔╝░██║██║╚████║██║░░██║██║░░██║
// ░░╚██╔╝░░██║██║░╚███║╚█████╔╝██████╔╝
// ░░░╚═╝░░░╚═╝╚═╝░░╚══╝░╚════╝░╚═════╝░
// ░░░░░██╗░█████╗░███╗░░██╗░██████╗░██╗██████╗░
// ░░░░░██║██╔══██╗████╗░██║██╔════╝░██║██╔══██╗
// ░░░░░██║███████║██╔██╗██║██║░░██╗░██║██║░░██║
// ██╗░░██║██╔══██║██║╚████║██║░░╚██╗██║██║░░██║
// ╚█████╔╝██║░░██║██║░╚███║╚██████╔╝██║██████╔╝
// ░╚════╝░╚═╝░░╚═╝╚═╝░░╚══╝░╚═════╝░╚═╝╚═════╝░
// preloader script............
var loader = document.getElementById("preloader");
window.addEventListener("load", function () {
setTimeout(function() {
loader.style.display = "none";
document.body.classList.add('scroll-enable');
}, 0);
})
const visualTogglebutton = document.getElementById('visual-toggle-button');
const checkbox = document.getElementById('visual-toggle');
function visualMode(){
if(checkbox.checked){
visualTogglebutton.classList.toggle('lightmode');
document.body.classList.toggle('lightcolors');
}
else{
visualTogglebutton.classList.toggle('animate')
}
}
const downloadBtn = document.querySelectorAll('.download-icon');
downloadBtn.forEach((currentBtn) =>{
currentBtn.addEventListener("click",() =>{
let fileFetch = currentBtn.previousElementSibling.querySelector('h5');
var fileName = fileFetch.innerHTML;
var image = currentBtn.previousElementSibling.querySelector('img');
var imgPath = image.getAttribute('src');
console.log(imgPath);
saveAs(imgPath, fileName);
});
})