Skip to content

Commit ea2464c

Browse files
committed
TOPで画面幅が狭い場合に使うnavbarを実装
1 parent 052a2f0 commit ea2464c

File tree

3 files changed

+48
-3
lines changed

3 files changed

+48
-3
lines changed

_includes/header.html

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
1-
<h1 class="max-w-lg mx-auto pt-5 px-8">
1+
<h1 class="hidden xl:block max-w-lg mx-auto pt-5 px-8">
22
<a href="/">
33
<img src="/img/common/header-logo.webp" alt="DojoCon Japan 2025 Inspire Next." />
44
</a>
55
</h1>
6+
7+
<div class="xl:hidden fixed top-9 left-0 min-h-18 w-screen flex justify-center z-10">
8+
<div class="flex h-full flex-col w-[calc(100%-max(10%,32px))] items-stretch rounded-[10px] bg-[#f5f5f5] px-4 py-2 inset-shadow-[0px_-2px_10px_rgba(125,125,125,0.25)] shadow-[7px_7px_10px_rgba(125,125,125,0.15)]">
9+
<div class="flex justify-between items-center">
10+
<a href="/" class="flex items-center h-full">
11+
<img src="/img/common/header-logo.webp" class="max-h-full max-w-[250px] h-auto" alt="DojoCon Japan 2025 Inspire Next." />
12+
</a>
13+
<button id="menu-btn" type="button" aria-label="メニューを開く" class="w-12 h-9 flex flex-col justify-center items-center shrink-0 rounded cursor-pointer border border-gray-300 bg-white">
14+
<span class="block w-8 h-0.5 bg-gray-400 mb-1.5 rounded"></span>
15+
<span class="block w-8 h-0.5 bg-gray-400 mb-1.5 rounded"></span>
16+
<span class="block w-8 h-0.5 bg-gray-400 rounded"></span>
17+
</button>
18+
</div>
19+
<nav id="menu-nav" class="hidden flex-col items-stretch transition-all duration-300 my-2">
20+
<ul class="flex flex-col min-h-20 items-stretch gap-2 *:leading-[1.75] *:text-[#cc8f2e] *:text-center *:text-[20px] *:px-6">
21+
<li><a href="#outline">開催概要</a></li>
22+
<li><a href="#session">セッション</a></li>
23+
<li><a href="/events">企画</a></li>
24+
<li><a href="/contest">コンテスト</a></li>
25+
<li><a href="https://suzuri.jp/DojoConJapan" target="_blank">グッズ</a></li>
26+
<li><a href="/sponsorship">スポンサー募集</a></li>
27+
<li><a href="{{ site.contact }}" target="_blank">お問い合わせ</a></li>
28+
</ul>
29+
</nav>
30+
</div>
31+
</div>
32+
33+
<script>
34+
document.addEventListener('DOMContentLoaded', function() {
35+
const menuBtn = document.getElementById('menu-btn');
36+
const menuNav = document.getElementById('menu-nav');
37+
if (!menuBtn || !menuNav) return;
38+
39+
menuBtn.addEventListener('click', function() {
40+
menuNav.classList.toggle('flex');
41+
menuNav.classList.toggle('hidden');
42+
});
43+
menuNav.querySelectorAll('a').forEach(function(link) {
44+
link.addEventListener('click', function() {
45+
menuNav.classList.remove('flex');
46+
menuNav.classList.add('hidden');
47+
});
48+
});
49+
});
50+
</script>

_includes/navbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="mx-4 sticky top-4 z-10">
1+
<div class="hidden xl:block sticky mx-4 top-4 z-10">
22
<nav
33
class="rounded-[40px] w-fit mx-auto bg-[#f5f5f5] mt-8 inset-shadow-[0px_-2px_10px_rgba(125,125,125,0.25)] shadow-[7px_7px_10px_rgba(125,125,125,0.15)]">
44
<ul class="flex flex-wrap min-h-20 items-center p-5 justify-center divide-x-2 gap-y-2 *:text-[#cc8f2e] *:px-6">

_includes/top/sections/hero.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="max-w-[1500px] mt-2 xl:-mt-14 mx-auto px-[2%] md:px-8">
1+
<div class="max-w-[1500px] mt-25 xl:-mt-14 mx-auto px-[2%] md:px-8 ">
22
<img src="/img/top/hero-image.webp" alt="好奇心に火をつけよう!! Inspire Next" />
33
</div>
44

0 commit comments

Comments
 (0)