aboutsummaryrefslogtreecommitdiff
path: root/dist/index.js
diff options
context:
space:
mode:
authorJJ <nicetry@noemail.com>2025-03-19 15:40:51 +0000
committerJJ <nicetry@noemail.com>2025-03-19 15:40:51 +0000
commit7324691a252761bf3f27365abae21bda0eda8843 (patch)
tree26f6fd57acca7db7b8cd774fc6dca38604f47b4f /dist/index.js
first commitHEADmain
Diffstat (limited to 'dist/index.js')
-rw-r--r--dist/index.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/dist/index.js b/dist/index.js
new file mode 100644
index 0000000..9afda23
--- /dev/null
+++ b/dist/index.js
@@ -0,0 +1,17 @@
+const mobileMenu = document.getElementById("mobile-menu");
+const hamburgerLayers = document.querySelectorAll(".hamburger-layer");
+const header = document.querySelector("header");
+
+document.getElementById("hamburger").addEventListener("click", () => {
+ // Toggle open/close
+ if (mobileMenu.classList.contains("hidden")) {
+ mobileMenu.classList.replace("hidden", "flex");
+ } else {
+ mobileMenu.classList.replace("flex", "hidden");
+ }
+
+ // Change colour
+ if (header.classList.contains("text-white")) {
+ hamburgerLayers.forEach((el) => el.classList.toggle("bg-black!"));
+ }
+});