Skip to content

Commit

Permalink
quick update
Browse files Browse the repository at this point in the history
  • Loading branch information
PyaePhoneNaing committed Jan 15, 2024
1 parent 67c6afc commit e108cfe
Show file tree
Hide file tree
Showing 4 changed files with 194 additions and 0 deletions.
18 changes: 18 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,24 @@
</div>
</nav>

<nav id="hamburger-nav">
<div class="logo">Paolo</div>
<div class="hamburger-menu">
<div class="hamburger-icon" onclick="toggleMenu()">
<span></span>
<span></span>
<span></span>
</div>
<div class="menu-links">
<li><a href="#about" onclick="toggleMenu()">About</a></li>
<li><a href="#experience" onclick="toggleMenu()">Experience</a></li>
<li><a href="#projects" onclick="toggleMenu()">Projects</a></li>
<li><a href="#contact" onclick="toggleMenu()">Contact</a></li>
</div>
</div>

</nav>

<script src="script.js"> </script>
</body>
</html>
10 changes: 10 additions & 0 deletions mediaqueries.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@media screen and (max-width: 1200px) {
#desktop-nav {
display: none;
}

#hamburger-nav {
display: flex;
}

}
7 changes: 7 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -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");

}
159 changes: 159 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -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;
}










0 comments on commit e108cfe

Please sign in to comment.