implemented snazzy mobile navbar-toggle hamburger animation
This commit is contained in:
parent
0024354118
commit
9ddb8e3978
8 changed files with 90 additions and 18 deletions
assets/js
12
assets/js/_hamburger.js
Normal file
12
assets/js/_hamburger.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
const togglerBtn = document.getElementById("navbarSupportedContentToggler");
|
||||
const navbarContent = document.getElementById("navbarSupportedContent");
|
||||
|
||||
navbarContent.addEventListener("show.bs.collapse", () => {
|
||||
console.log("opening navbar content");
|
||||
togglerBtn.classList.toggle("is-active");
|
||||
});
|
||||
|
||||
navbarContent.addEventListener("hide.bs.collapse", () => {
|
||||
console.log("closing navbar content");
|
||||
togglerBtn.classList.toggle("is-active");
|
||||
});
|
|
@ -24,6 +24,8 @@ import { LiveSocket } from "phoenix_live_view";
|
|||
// Bootstrap v5 js imports
|
||||
import "bootstrap/js/dist/collapse";
|
||||
import "bootstrap/js/dist/dropdown";
|
||||
// Boostrap helpers
|
||||
import "./_hamburger";
|
||||
|
||||
// LiveSocket setup
|
||||
let csrfToken = document
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue