diff --git a/public/themes/dist_static/static/css/common.css b/public/themes/dist_static/static/css/common.css index 1f20e19..d56bb03 100644 --- a/public/themes/dist_static/static/css/common.css +++ b/public/themes/dist_static/static/css/common.css @@ -1466,6 +1466,36 @@ body { display: flex; flex-direction: column; gap: 1rem; +}.nav-mega__subgroup-head { + display: flex; + align-items: center; + gap: 0.5rem; +}.nav-mega__subgroup-toggle { + display: flex; + align-items: center; + justify-content: center; + width: 1.5rem; + height: 1.5rem; + padding: 0; + border: none; + background: transparent; + color: var(--color-text-muted); + cursor: pointer; + flex-shrink: 0; + transition: color var(--duration-fast) var(--easing), transform var(--duration-normal) var(--easing); +}.nav-mega__subgroup-toggle svg { + width: 0.5rem; + height: 0.75rem; + display: block; +}.nav-mega__subgroup-toggle:hover { + color: var(--color-primary); +}.nav-mega__subgroup.is-expanded .nav-mega__subgroup-toggle { + transform: rotate(90deg); + color: var(--color-primary); +}.nav-mega__subgroup .nav-mega__links { + display: none; +}.nav-mega__subgroup.is-expanded .nav-mega__links { + display: flex; }.nav-mega__subgroup-title { display: inline-flex; align-items: center; @@ -1477,21 +1507,8 @@ body { line-height: var(--font-22); text-decoration: none; transition: color var(--duration-fast) var(--easing); -}.nav-mega__subgroup-title::after { - content: ""; - display: block; - flex-shrink: 0; - width: 0.5rem; - height: 0.75rem; - background: currentColor; - opacity: 0; - transition: opacity var(--duration-normal) var(--easing); - mask: url("data:image/svg+xml,%3csvg%20viewBox='-1%20-1%208.59082%2013.0605'%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%3e%3cpath%20d='M0%204.12464e-05L5%205.00004L10%200'%20stroke='currentColor'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%20transform='matrix(0,-1,1,0,0.530273,10.5303)'%20/%3e%3c/svg%3e") center/contain no-repeat; - -webkit-mask: url("data:image/svg+xml,%3csvg%20viewBox='-1%20-1%208.59082%2013.0605'%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%3e%3cpath%20d='M0%204.12464e-05L5%205.00004L10%200'%20stroke='currentColor'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'%20transform='matrix(0,-1,1,0,0.530273,10.5303)'%20/%3e%3c/svg%3e") center/contain no-repeat; }.nav-mega__subgroup-title:hover { color: var(--color-primary); -}.nav-mega__subgroup-title:hover::after { - opacity: 1; }.nav-mega__links { display: flex; flex-direction: column; diff --git a/public/themes/dist_static/static/js/common.js b/public/themes/dist_static/static/js/common.js index 1d9c82f..8411a14 100644 --- a/public/themes/dist_static/static/js/common.js +++ b/public/themes/dist_static/static/js/common.js @@ -138,5 +138,13 @@ $(function() { this.classList.toggle("is-active", match); }); }); + + // nav-mega__subgroup-toggle 点击展开/收起 + $(document).on("click", ".nav-mega__subgroup-toggle", function() { + const $subgroup = $(this).closest(".nav-mega__subgroup"); + const isExpanded = $subgroup.hasClass("is-expanded"); + $subgroup.toggleClass("is-expanded", !isExpanded); + $(this).attr("aria-expanded", !isExpanded); + }); }); //#endregion diff --git a/public/themes/preview/demo/single_index.html b/public/themes/preview/demo/single_index.html index 075ec92..e30cb83 100644 --- a/public/themes/preview/demo/single_index.html +++ b/public/themes/preview/demo/single_index.html @@ -51,7 +51,7 @@ - + diff --git a/public/themes/website/1/zh/demo/about.html b/public/themes/website/1/zh/demo/about.html index 7be56fb..94b02c7 100644 --- a/public/themes/website/1/zh/demo/about.html +++ b/public/themes/website/1/zh/demo/about.html @@ -44,7 +44,7 @@ - + diff --git a/public/themes/website/1/zh/demo/announce.html b/public/themes/website/1/zh/demo/announce.html index fd37cd0..c4f74a5 100644 --- a/public/themes/website/1/zh/demo/announce.html +++ b/public/themes/website/1/zh/demo/announce.html @@ -44,7 +44,7 @@ - + diff --git a/public/themes/website/1/zh/demo/category.html b/public/themes/website/1/zh/demo/category.html index f5d05ad..9d8af96 100644 --- a/public/themes/website/1/zh/demo/category.html +++ b/public/themes/website/1/zh/demo/category.html @@ -44,7 +44,7 @@ - + diff --git a/public/themes/website/1/zh/demo/components/header.html b/public/themes/website/1/zh/demo/components/header.html index 60ac992..11f410f 100644 --- a/public/themes/website/1/zh/demo/components/header.html +++ b/public/themes/website/1/zh/demo/components/header.html @@ -273,7 +273,14 @@ {hcTaglib:subcategory pid="$sub_cate_id22" item="vo33" sort=""}