Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
affancoder committed Aug 19, 2024
1 parent 588bf63 commit 14edf67
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<title>Music Play</title>
<link rel="stylesheet" href="style.css" />
<link rel="icon" href="assests/logo.png" class="rel">
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.11.3/gsap.min.js"></script>
</head>

<body>
Expand Down
33 changes: 33 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,36 @@ document.getElementById("previous").addEventListener("click", () => {
masterPlay.classList.remove("fa-play-circle");
masterPlay.classList.add("fa-pause-circle");
});

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,
});
});

0 comments on commit 14edf67

Please sign in to comment.