-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
33 lines (27 loc) · 876 Bytes
/
script.js
File metadata and controls
33 lines (27 loc) · 876 Bytes
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
// Navbar CSS property on scroll
window.addEventListener("scroll", () => {
const navbar = document.querySelector(".navbar");
if (window.scrollY > 100) {
navbar.classList.add("scrolled");
} else {
navbar.classList.remove("scrolled");
}
});
// Profile section redirecting
const profileIcon = document.querySelector(".profile-icon");
if (profileIcon) {
profileIcon.addEventListener("click", () => {
window.location.href = "profile-details.html";
});
}
// Movie card hover scaling
const movieCards = document.querySelectorAll(".content-card");
movieCards.forEach((card) => {
card.addEventListener("mouseenter", () => {
card.style.transform = "scale(1.05)";
card.style.transition = "transform 0.3s ease";
});
card.addEventListener("mouseleave", () => {
card.style.transform = "scale(1)";
});
});