0% found this document useful (0 votes)
24 views

Js File For Css Part

Uploaded by

its.generic07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Js File For Css Part

Uploaded by

its.generic07
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

script.

js
const menuBtn = document.getElementById("menu-btn");
const navLinks = document.getElementById("nav-links");
const menuBtnIcon = menuBtn.querySelector("i");

menuBtn.addEventListener("click", (e) => {


navLinks.classList.toggle("open");

const isOpen = navLinks.classList.contains("open");


menuBtnIcon.setAttribute("class", isOpen ? "ri-close-line" : "ri-menu-line");
});

navLinks.addEventListener("click", (e) => {


navLinks.classList.remove("open");
menuBtnIcon.setAttribute("class", "ri-menu-line");
});

const scrollRevealOption = {
distance: "50px",
origin: "bottom",
duration: 1000,
};

ScrollReveal().reveal(".content h1", {
...scrollRevealOption,
});
ScrollReveal().reveal(".content h4", {
...scrollRevealOption,
delay: 500,
});
ScrollReveal().reveal(".content h2, .content h6, .content form", {
...scrollRevealOption,
delay: 1000,
});
ScrollReveal().reveal(".content p", {
...scrollRevealOption,
delay: 1500,
});
ScrollReveal().reveal(".content .socials span", {
...scrollRevealOption,
delay: 2000,
interval: 500,
});
ScrollReveal().reveal(".about h2, .about-images img, .about p", {
...scrollRevealOption,
delay: 2500,
});

You might also like