-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.js
85 lines (69 loc) · 2.11 KB
/
app.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
document.addEventListener("DOMContentLoaded", function () {
const menuToggle = document.getElementById("menu-toggle");
const navbarMenu = document.querySelector(".navbar-menu");
menuToggle.addEventListener("click", function () {
navbarMenu.classList.toggle("active");
});
function toggleNavbar() {
var x = document.getElementById("myNavbar");
var toggleButton = document.getElementsByClassName(".navbar-menu");
if (x.className === "navbar") {
x.className += " responsive";
toggleButton.innerHTML = "✖ Close"; // Change to close icon
} else {
x.className = "navbar";
toggleButton.innerHTML = "☰ Menu"; // Change back to menu icon
}
}
});
// ---- Preloader ----
const loader = document.getElementById("preloader");
window.addEventListener("load", function () {
loader.style.display = "none";
});
// -----------Right click disable code ---------
document.addEventListener("contextmenu", function (e) {
// e.preventDefault();
});
// ---- Smooth loading ----
document.addEventListener("DOMContentLoaded", function() {
document.body.classList.add('loaded');
});
// Gsap Animation
window.addEventListener('load', () => {
// Animate the navbar
// gsap.from("nav", { duration: 1.5, y: -50, opacity: 0, ease: "power2.out" });
// Animate the song list containers
gsap.from(".container", {
duration: 1.5,
y: 50,
opacity: 0,
ease: "power2.out",
stagger: 0.2, // Stagger animation for multiple containers
});
// Animate individual song items
gsap.from(".songItem", {
duration: 1.5,
x: -50,
opacity: 0,
ease: "power2.out",
stagger: 0.1, // Stagger animation for song items
delay: 0.5,
});
// Animate the bottom player controls
gsap.from(".bottom", { duration: 1.5, y: 50, opacity: 0, ease: "power2.out", delay: 1 });
});
gsap.to('.footer-container', {
opacity: 1,
y: 0,
duration: 1.5,
ease: 'power3.out',
delay: 0.3
});
gsap.to('.footer-bottom', {
opacity: 1,
y: 0,
duration: 1.2,
ease: 'power3.out',
delay: 0.5
});