From 59eef62fde0ee77ed64e5b86ca235c71e833ff1d Mon Sep 17 00:00:00 2001 From: somrat sorkar Date: Tue, 29 Aug 2023 09:58:00 +0600 Subject: [PATCH] update header dropdown and modules --- assets/js/main.js | 15 +++++++- assets/scss/navigation.scss | 12 +++++-- exampleSite/go.mod | 46 ++++++++++++------------- layouts/partials/essentials/header.html | 2 +- package.json | 4 +-- 5 files changed, 50 insertions(+), 29 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index 34a50e2..73fa884 100755 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -2,7 +2,20 @@ (function () { "use strict"; - // ####################### Testimonial Slider ######################### + // Dropdown Menu Toggler For Mobile + // ---------------------------------------- + const dropdownMenuToggler = document.querySelectorAll( + ".nav-dropdown > .nav-link", + ); + + dropdownMenuToggler.forEach((toggler) => { + toggler?.addEventListener("click", (e) => { + e.target.parentElement.classList.toggle("active"); + }); + }); + + // Testimonial Slider + // ---------------------------------------- new Swiper(".testimonial-slider", { spaceBetween: 24, loop: true, diff --git a/assets/scss/navigation.scss b/assets/scss/navigation.scss index ba8854f..43f15d5 100755 --- a/assets/scss/navigation.scss +++ b/assets/scss/navigation.scss @@ -41,14 +41,22 @@ input#nav-toggle:checked ~ #nav-menu { .nav-dropdown { @apply mr-0; + & > svg { + @apply pointer-events-none; + } + &.active { + .nav-dropdown-list { + @apply block; + } + } } .nav-dropdown-list { - @apply bg-body dark:bg-darkmode-body z-10 min-w-[180px] rounded p-4 shadow; + @apply bg-body dark:bg-darkmode-body z-10 min-w-[180px] rounded p-4 shadow hidden lg:invisible lg:absolute lg:block lg:opacity-0; } .nav-dropdown-item { - @apply mb-2; + @apply [&:not(:last-child)]:mb-2; } .nav-dropdown-link { diff --git a/exampleSite/go.mod b/exampleSite/go.mod index 0cec448..9f7ff4d 100644 --- a/exampleSite/go.mod +++ b/exampleSite/go.mod @@ -3,27 +3,27 @@ module hugoplate.netlify.app go 1.20 require ( - github.com/gethugothemes/hugo-modules/accordion v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/adsense v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/components/cookie-consent v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/components/custom-script v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/components/preloader v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/components/render-link v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/components/social-share v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/gallery-slider v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/gzip-caching v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/icons/font-awesome v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/images v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/modal v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/pwa v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/search v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/seo-tools/basic-seo v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/seo-tools/google-tag-manager v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/seo-tools/site-verifications v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/shortcodes/button v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/shortcodes/notice v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/tab v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/table-of-contents v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/gethugothemes/hugo-modules/videos v0.0.0-20230731033118-be0c1c964f76 // indirect - github.com/zeon-studio/hugoplate v0.0.0-20230807025249-ff01abbb3526 // indirect + github.com/gethugothemes/hugo-modules/accordion v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/adsense v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/components/cookie-consent v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/components/custom-script v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/components/preloader v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/components/render-link v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/components/social-share v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/gallery-slider v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/gzip-caching v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/icons/font-awesome v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/images v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/modal v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/pwa v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/search v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/seo-tools/basic-seo v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/seo-tools/google-tag-manager v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/seo-tools/site-verifications v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/shortcodes/button v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/shortcodes/notice v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/tab v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/table-of-contents v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/gethugothemes/hugo-modules/videos v0.0.0-20230823074046-d7ebb75df8b9 // indirect + github.com/zeon-studio/hugoplate v0.0.0-20230820074946-34cb72d4ce47 // indirect ) diff --git a/layouts/partials/essentials/header.html b/layouts/partials/essentials/header.html index 17ecdf9..56bf1f4 100755 --- a/layouts/partials/essentials/header.html +++ b/layouts/partials/essentials/header.html @@ -50,7 +50,7 @@