Skip to content

Commit a246431

Browse files
committed
feat PCナビ 子階層メニューの表示トリガーを変更
1 parent ea8dd17 commit a246431

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

src/develop/include/calendar/year.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ <h2 class="text-gray-900 font-bold text-2xl"><!-- BEGIN_IF [%{DATE_YEAR}/nem] --
2828
<!-- BEGIN month:loop -->
2929
<div>
3030
<h3 class="text-gray-900 text-lg font-bold">{month}月</h3>
31-
<div class="grid grid-cols-7 mt-4" aria-hidden="true">
31+
<div class="grid grid-cols-7 mt-4 text-sm" aria-hidden="true">
3232
<!-- BEGIN weekLabel:loop -->
33-
<div class="text-xs font-medium text-center [&:nth-child(n+6)]:text-red-600">{label}</div>
33+
<div class="font-medium text-center [&:nth-child(n+6)]:text-red-600">{label}</div>
3434
<!-- END weekLabel:loop -->
3535
</div>
3636
<div class="mt-4">
@@ -41,12 +41,12 @@ <h3 class="text-gray-900 text-lg font-bold">{month}月</h3>
4141
<div class="px-0.5 mb-1 py-1.5 [&:nth-child(n+6)]:text-red-600" aria-hidden="true"></div>
4242
<!-- END spacer -->
4343
<!-- BEGIN none -->
44-
<div class="flex items-center justify-center px-0.5 py-1.5 text-sm text-center [&:nth-child(n+6)]:text-red-600">
44+
<div class="flex items-center justify-center px-0.5 py-1.5 text-center [&:nth-child(n+6)]:text-red-600">
4545
<span class="flex items-center justify-center w-7 h-7">{day}</span>
4646
</div>
4747
<!-- END none -->
4848
<!-- BEGIN link -->
49-
<div class="flex items-center justify-center px-0.5 py-1.5 text-sm text-center [&:nth-child(n+6)]:text-red-600">
49+
<div class="flex items-center justify-center px-0.5 py-1.5 text-center [&:nth-child(n+6)]:text-red-600">
5050
<a href="{url}" class="flex items-center justify-center w-7 h-7 rounded-full cursor-pointer bg-gray-100 hover:bg-gray-200" aria-label="{day}日の記事一覧を表示する">
5151
<span>{day}</span>
5252
</a>

src/develop/include/parts/navigation-pc.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<ul class="flex flex-wrap items-center list-none leading-6 [&>li>a.stay]:border-b-2 [&>li>a.stay]:border-solid [&>li>a.stay]:border-indigo-600">
1+
<ul class="flex flex-wrap items-center list-none leading-6 [&_a.stay]:border-b-2 [&_a.stay]:border-solid [&_a.stay]:border-indigo-600">
22
<li class="mx-5 font-medium text-center group">
3-
<a href="%{HOME_URL}" class="<!-- BEGIN_IF [%{CCD}/neq/contact/_and_/%{ECD}/neq/profile.html] -->stay<!-- END_IF --> flex items-center gap-2 py-4 hover:opacity-70">
3+
<a href="%{HOME_URL}" class="js-child-toggle [&.is-active+div]:opacity-100 [&.is-active+div]:pointer-events-auto [&.is-active_span.nav-icon]:-rotate-180 <!-- BEGIN_IF [%{CCD}/neq/contact/_and_/%{ECD}/neq/profile.html] -->stay<!-- END_IF --> flex items-center gap-2 h-14 px-1 hover:opacity-70">
44
<span>Blogs</span>
5-
<span class="text-gray-400 transition-transform group-hover:-rotate-180">
5+
<span class="text-gray-400 transition-transform nav-icon">
66
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-3">
77
<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
88
</svg>
99
</span>
1010
</a>
11-
<div class="opacity-0 absolute top-14 left-0 right-0 py-6 bg-gray-50 transition-opacity pointer-events-none group-hover:opacity-100 group-hover:pointer-events-auto">
11+
<div class="opacity-0 absolute top-14 left-0 right-0 py-6 bg-gray-50 transition-opacity pointer-events-none">
1212
<div class="container flex">
1313
<h2 class="inline-block mr-12 pr-12 py-2 border-r border-gray-200 font-normal">Blogs</h2>
1414
<ul class="flex gap-x-8 gap-y-3">
@@ -23,12 +23,12 @@ <h2 class="inline-block mr-12 pr-12 py-2 border-r border-gray-200 font-normal">B
2323
</div>
2424
</li>
2525
<li class="mx-5 font-medium text-center">
26-
<a href="%{HOME_URL}profile.html" class="js-link_match_location-full block py-4 no-underline hover:opacity-70">
26+
<a href="%{HOME_URL}profile.html" class="js-link_match_location-full flex items-center h-14 px-1 hover:opacity-70">
2727
<span>Profile</span>
2828
</a>
2929
</li>
3030
<li class="ml-5 font-medium text-center">
31-
<a href="%{HOME_URL}contact/" class="js-link_match_location-category block py-4 no-underline hover:opacity-70">
31+
<a href="%{HOME_URL}contact/" class="js-link_match_location-category flex items-center h-14 px-1 hover:opacity-70">
3232
<span>Contact</span>
3333
</a>
3434
</li>

src/develop/src/js/main.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,16 @@ async function main() {
162162
* Content Ready
163163
*/
164164
domContentLoaded(() => {
165+
/* PC nav */
166+
const childToggle = document.querySelectorAll('.js-child-toggle');
167+
childToggle && childToggle.forEach((toggle) => {
168+
toggle.addEventListener('click', (e) => {
169+
e.preventDefault();
170+
const _self = e.currentTarget;
171+
_self.classList.toggle('is-active');
172+
});
173+
});
174+
165175
/* SP menu */
166176
const menu = document.querySelector('.js-menu');
167177
const menuToggle = document.querySelector('.js-menu-toggle');

0 commit comments

Comments
 (0)