diff --git a/index.html b/index.html index 372681f..9538d88 100644 --- a/index.html +++ b/index.html @@ -22,6 +22,24 @@ + + \ No newline at end of file diff --git a/mediaqueries.css b/mediaqueries.css index e69de29..e787395 100644 --- a/mediaqueries.css +++ b/mediaqueries.css @@ -0,0 +1,10 @@ +@media screen and (max-width: 1200px) { + #desktop-nav { + display: none; + } + + #hamburger-nav { + display: flex; + } + +} \ No newline at end of file diff --git a/script.js b/script.js index e69de29..c050168 100644 --- a/script.js +++ b/script.js @@ -0,0 +1,7 @@ +function toggleMenu(){ + const menu = document.querySelector(".menu-links"); + const icon = document.querySelector(".hamburger-icon"); + menu.classList.toggle("open"); + icon.classList.toggle("open"); + +} \ No newline at end of file diff --git a/style.css b/style.css index e69de29..406dffb 100644 --- a/style.css +++ b/style.css @@ -0,0 +1,159 @@ +/* General */ + + + @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap'); + + +*{ + margin: 0; + padding: 0; +} + +body { + font-family: 'Poppins', sans-serif; +} + +html{ + scroll-behavior: smooth; +} + +p{ + color: rgb(85, 85, 85); +} + +/* Transition */ + +a, +.btn{ + transition: all 300ms ease; +} + +/* Desktop Nav */ + +nav, +.nav-links{ + display: flex; +} + +nav { + justify-content: space-around; + align-items: center; + height: 17vh; +} + +.nav-links{ + gap: 2rem; + list-style: none; + font-size: 1.5rem; +} + +a{ + color: black; + text-decoration: none; + text-decoration-color: white; +} + +a:hover{ + color: grey; + text-decoration: underline; + text-underline-offset: 1rem; + text-decoration-color: rgb(181, 181, 181); +} + +.logo{ + font-size: 2rem; +} + +.logo:hover{ + cursor: default; +} + +/* Hamburger Menu */ + +#hamburger-nav { + display: none; +} + +.hamburger-menu{ + position: relative; + display: inline-block; +} + +.hamburger-icon{ + display: flex; + flex-direction: column; + justify-content: space-between; + height: 24px; + width: 30px; + cursor: pointer; +} + +.hamburger-icon span{ + width: 100%; + height: 2px; + background-color: black; + transition: all 0.3 ease-in-out; +} + +.menu-links{ + position: absolute; + top: 100%; + right: 0; + background-color: white; + width: fit-content; + max-height: 0; + overflow: hidden; + transition: all 0.3 ease-in-out; +} + +.menu-links a{ + display: block; + padding: 10px; + text-align: center; + font-size: 1.5rem; + color: black; + text-decoration: none; + transition: all 0.3 ease-in-out; +} + +.menu-links li{ + list-style: none; +} + +.menu-links.open{ + max-height: 300px; +} + +.hamburger-icon.open span:first-child{ + transform: rotate(45deg) translate(10px,5px); +} + +.hamburger-icon.open span:nth-child(2){ + opacity: 0; +} + +.hamburger-icon.open span:last-child{ + transform: rotate(-45deg) translate(10px,-5px); +} + +.hamburger-icon span:first-child{ + transform: none; +} + +.hamburger-icon span:first-child{ + opacity: 1; +} + +.hamburger-icon span:first-child{ + transform: none; +} + + + + + + + + + +