202404170455

This commit is contained in:
nelle 2024-04-17 04:55:55 -06:00
parent bed9e5a9e3
commit c922a73703

View file

@ -13,6 +13,17 @@
--> -->
<span class="text-gradient">LimePot</span> <span class="text-gradient">LimePot</span>
</a> </a>
<a
role="button"
class="navbar-burger"
data-target="navMenu"
aria-label="menu"
aria-expanded="false"
>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div> </div>
<div class="navbar-menu" id="navMenu"> <div class="navbar-menu" id="navMenu">
<div class="navbar-start"> <div class="navbar-start">
@ -42,4 +53,28 @@
</a> </a>
--> -->
</div> </div>
<!-- This JS is required for mobile users to navigate the site, working on a mobile alternative -->
<script>
document.addEventListener("DOMContentLoaded", () => {
// Get all "navbar-burger" elements
const $navbarBurgers = Array.prototype.slice.call(
document.querySelectorAll(".navbar-burger"),
0
);
// Add a click event on each of them
$navbarBurgers.forEach((el) => {
el.addEventListener("click", () => {
// Get the target from the "data-target" attribute
const target = el.dataset.target;
const $target = document.getElementById(target);
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
el.classList.toggle("is-active");
$target.classList.toggle("is-active");
});
});
});
</script>
</center> </center>
<!-- This JS is required for mobile users to navigate the site, working on a mobile alternative -->