Skip to content

Commit 77f4f9d

Browse files
authored
Merge pull request #23 from coderdojo-japan/feature/mini-navbar
TOPで画面幅が小さいときに使うプルダウン式のナビバーの実装
2 parents 052a2f0 + 9054859 commit 77f4f9d

File tree

5 files changed

+52
-5
lines changed

5 files changed

+52
-5
lines changed

_includes/header.html

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

_includes/top/sections/outline.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h2 id="outline" class="text-4xl text-center mb-8 pt-20">
1+
<h2 id="outline" class="text-4xl text-center mb-8 pt-28 -mt-8">
22
開催概要
33
<span class="block mt-5 text-2xl">OUTLINE</span>
44
</h2>

_includes/top/sections/session.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div id="session" class="max-w-3xl lg:max-w-[1800px] px-8 mx-auto mt-8 mb-16 flex flex-col lg:-mt-64 lg:flex-row items-center lg:items-start">
1+
<div id="session" class="max-w-3xl lg:max-w-[1800px] pt-28 pb-8 mx-auto -mt-12 mb-16 flex flex-col lg:-mt-64 lg:flex-row items-center lg:items-start">
22
<div class="w-full lg:w-2/5 mb-8 lg:mt-68">
33
<div class="lg:max-w-sm lg:place-self-end lg:mr-[10%]">
44
<h2 class="text-4xl mb-4 text-center lg:text-left">

0 commit comments

Comments
 (0)