mirror of
https://github.com/NohamR/N_m3u8DL-RE_Command_Generator.git
synced 2026-08-01 18:19:50 +00:00
add cli->re converter
This commit is contained in:
31
darkmode.js
Normal file
31
darkmode.js
Normal file
@@ -0,0 +1,31 @@
|
||||
function changeColor() {
|
||||
document.body.classList.toggle('dark')
|
||||
return
|
||||
}
|
||||
const animate = gsap.timeline({ paused: true });
|
||||
const animateBackground = new TimelineMax({ paused: true });
|
||||
let toggle = true;
|
||||
|
||||
animateBackground
|
||||
.set(".switch", { boxShadow: "0 0 10px rgba(255, 255, 255, 0.2)" })
|
||||
.to(".text p", 0.1, { color: "#FFF" }, 0.1);
|
||||
|
||||
animate
|
||||
.set(".circle", { backgroundColor: "rgba(0,0,0,0)" }, 0.2)
|
||||
.to(".toggle-button", 0.1, { scale: 0.7 }, 0)
|
||||
.set(".toggle", { backgroundColor: "#FFF" })
|
||||
.to(".moon-mask", 0.2, { translateY: 20, translateX: -10 }, 0.3)
|
||||
.to(".toggle-button", 0.1, { translateY: 49 }, 0.1)
|
||||
.to(".toggle-button", 0.1, { scale: 0.9 })
|
||||
|
||||
document.getElementsByClassName("switch")[0].addEventListener("click", () => {
|
||||
if (toggle) {
|
||||
animate.restart();
|
||||
animateBackground.restart();
|
||||
} else {
|
||||
animate.reverse();
|
||||
animateBackground.reverse();
|
||||
}
|
||||
toggle = !toggle;
|
||||
changeColor()
|
||||
});
|
||||
Reference in New Issue
Block a user