45_Netflix Navigation
๐ป ์ฃผ์ : ๋ฐ์ํ ๋ค๋น๊ฒ์ด์
open_btn.addEventListener('click', () => {
nav.forEach(nav_el => nav_el.classList.add('visible'))
})
close_btn.addEventListener('click', () => {
nav.forEach(nav_el => nav_el.classList.remove('visible'))
})
.nav {
position: fixed;
top: 0;
left: 0;
height: 100vh;
/* ํ๋ฉด ๋ฐ์ผ๋ก */
transform: translateX(-100%);
transition: transform .3s ease-in-out;
}
/* ํ๋ฒ๊ฑฐ๋ฐ ๋๋ ์ ๋ ๋ํ๋ ์คํ์ผ */
.nav.visible {
transform: translateX(0);
}
.nav-black {
background-color: rgb(34, 31, 31);
width: 60%;
max-width: 480px;
min-width: 320px;
transition-delay: .4s;
}
.nav-black.visible {
transition-delay: 0s;
}
.nav-red {
background-color: rgb(229, 9, 20);
width: 95%;
transition-delay: .2s;
}
.nav-red.visible {
transition-delay: .2s;
}
.nav-white {
background-color: #fff;
width: 95%;
padding: 40px;
position: relative;
transition-delay: 0s;
}
.nav-white.visible {
transition-delay: .4s;
}