Skip to content

Commit

Permalink
Added NavBar... Thats It
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRealMrGamz authored Apr 30, 2023
1 parent 04b0ab1 commit 07d8499
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const menu = document.querySelector('#mobile-menu');
const menuLinks = document.querySelector('.navbar__menu');

menu.addEventListener('click', function() {
menu.classList.toggle('is-active');
menuLinks.classList.toggle('active');
})
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
</ul>
</div>
</nav>
<script src="app.js"></script>
</body>
</html>
57 changes: 57 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
transition: all 0.5s ease;
height: 50vh;
z-index: -1;
background: #131313;
}

.navbar__menu.active {
Expand All @@ -135,4 +136,60 @@
font-size: 1.6rem;
}

#navbar__logo {
padding-left: 25px;
}

.navbar__toggle .bar {
width: 25px;
height: 3px;
margin: 5px auto;
transition: all 0.5s ease-in-out;
background: #fff;
}

.navbar__item {
width: 100%;
}

.navbar__links {
text-align: center;
padding: 2rem;
width: 100%;
display: table;
}

#mobile-menu {
position: absolute;
top: 20%;
right: 5%;
transform: translate(5%, 20%);
}

.navbar__btn {
padding-bottom: 2rem;
}

.button {
display: flex;
justify-content: center;
align-items: center;
width: 80%;
height: 80px;
margin: 0;
}

.navbar__toggle .bar {
display: block;
cursor: pointer;
}

#mobile-menu.is-active .bar:nth-child(2) {
opacity: 0;
}

#mobile-menu.is-active .bar:nth-child(1) {
transform: translateY(-8px) rotate(-45deg);
}

}

0 comments on commit 07d8499

Please sign in to comment.