Skip to content

Commit

Permalink
hamburger menu
Browse files Browse the repository at this point in the history
  • Loading branch information
starrlord1 committed Jul 8, 2024
1 parent df6edef commit a160cc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const { pageTitle } = Astro.props;
<slot />
<Footer/>
<script>
import "../scripts/menu.js";
</script>
</body>
</html>
3 changes: 3 additions & 0 deletions src/scripts/menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
document.querySelector('.hamburger').addEventListener('click', () => {
document.querySelector('.nav-links').classList.toggle('expanded');
});

0 comments on commit a160cc2

Please sign in to comment.