100-project-100-days-website/100_projects/99-landing-page-fashion/assets/js/main.js
2023-05-31 08:53:37 +03:00
Ask

27 lines
851 B
JavaScript

{adda504d147644cfbadc83d86163efc81e976a9d true 851 main.js 0xc001c572d0}

/* MENU SHOW */
const showMenu = (toggleId,navId) =>{
const toggle = document.getElementById(toggleId),
nav = document.getElementById(navId)
if(toggle && nav){
toggle.addEventListener('click', ()=>{
nav.classList.toggle('show')
})
}
}
showMenu('nav-toggle','nav-menu')
/* GSAP ANIMATION */
/*HOME PRIMARY*/
TweenMax.to(".home__primary", 2, {
width: "100%",
ease: Expo.easeInOut
})
gsap.from('.home__title', {opacity: 0, duration: 2, delay: 1.5, y: 100})
gsap.from('.home__img img', {opacity: 0, duration: 2, delay:1.5, y: -100})
/*HOME SECONDARY*/
TweenMax.to(".home__secondary", 2.5, {
width: "100%",
ease: Expo.easeInOut
})
gsap.from('.home__scroll', {opacity: 0, duration: 3, x: -100})
gsap.from('.home__year', {opacity: -1, duration: 1.5, delay: 1.5, x: 100})