@@ -71,14 +71,33 @@ const navigation = [
7171 })}
7272 </nav >
7373
74- <button
75- type =" button"
76- id =" photo-theme-toggle"
77- class =" photo-topbar__toggle"
78- aria-label =" 切换主题"
79- >
80- 主题
81- </button >
74+ <div class =" photo-topbar__actions" >
75+ <button
76+ type =" button"
77+ data-theme-toggle
78+ class =" photo-topbar__toggle"
79+ aria-label =" 切换主题"
80+ >
81+ <span data-theme-toggle-label >浅色</span >
82+ </button >
83+
84+ <details class =" photo-topbar__menu-shell" >
85+ <summary class =" photo-topbar__menu-toggle" aria-label =" 导航" >
86+ <span class =" photo-topbar__burger" aria-hidden =" true" >
87+ <span ></span >
88+ <span ></span >
89+ <span ></span >
90+ </span >
91+ </summary >
92+ <nav class =" photo-topbar__menu" aria-label =" 移动导航" >
93+ { navigation .map ((item ) => (
94+ <a href = { item .href } class = { ` photo-topbar__menu-link ${currentPath === item .href || (item .href === ' /photography/' && currentPath .startsWith (' /posts/' )) ? ' is-active' : ' ' } ` } data-astro-prefetch >
95+ { item .name }
96+ </a >
97+ ))}
98+ </nav >
99+ </details >
100+ </div >
82101 </div >
83102 </header >
84103
@@ -340,6 +359,12 @@ const navigation = [
340359 color: rgba(248, 250, 252, 0.96);
341360 }
342361
362+ .photo-topbar__actions {
363+ display: flex;
364+ align-items: center;
365+ gap: 0.65rem;
366+ }
367+
343368 .photo-topbar__nav {
344369 display: none;
345370 align-items: center;
@@ -378,6 +403,68 @@ const navigation = [
378403 cursor: pointer;
379404 }
380405
406+ .photo-topbar__menu-shell {
407+ position: relative;
408+ }
409+
410+ .photo-topbar__menu-toggle {
411+ display: inline-flex;
412+ align-items: center;
413+ justify-content: center;
414+ min-width: 2.5rem;
415+ min-height: 2.5rem;
416+ border: 1px solid rgba(255, 255, 255, 0.12);
417+ border-radius: 9999px;
418+ background: transparent;
419+ color: rgba(248, 250, 252, 0.9);
420+ cursor: pointer;
421+ list-style: none;
422+ }
423+
424+ .photo-topbar__menu-toggle::-webkit-details-marker {
425+ display: none;
426+ }
427+
428+ .photo-topbar__burger {
429+ display: inline-grid;
430+ gap: 0.22rem;
431+ }
432+
433+ .photo-topbar__burger span {
434+ display: block;
435+ width: 0.95rem;
436+ height: 1.5px;
437+ border-radius: 9999px;
438+ background: currentColor;
439+ }
440+
441+ .photo-topbar__menu {
442+ position: absolute;
443+ right: 0;
444+ margin-top: 0.6rem;
445+ min-width: 9rem;
446+ padding: 0.45rem;
447+ border: 1px solid rgba(255, 255, 255, 0.08);
448+ border-radius: 1rem;
449+ background: rgba(12, 17, 24, 0.96);
450+ box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
451+ backdrop-filter: blur(14px);
452+ }
453+
454+ .photo-topbar__menu-link {
455+ display: block;
456+ padding: 0.65rem 0.85rem;
457+ border-radius: 0.8rem;
458+ color: rgba(226, 232, 240, 0.78);
459+ font-size: 0.92rem;
460+ }
461+
462+ .photo-topbar__menu-link.is-active,
463+ .photo-topbar__menu-link:hover {
464+ background: rgba(255, 255, 255, 0.06);
465+ color: rgba(248, 250, 252, 0.96);
466+ }
467+
381468 .photo-hero {
382469 position: relative;
383470 min-height: calc(100vh - 4.4rem);
@@ -976,6 +1063,10 @@ const navigation = [
9761063 display: flex;
9771064 }
9781065
1066+ .photo-topbar__menu-shell {
1067+ display: none;
1068+ }
1069+
9791070 .photo-hero__overlay--bottom {
9801071 grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.72fr);
9811072 gap: 2rem;
@@ -1047,6 +1138,10 @@ const navigation = [
10471138 padding-inline: 0.9rem;
10481139 }
10491140
1141+ .photo-topbar__toggle {
1142+ padding-inline: 0.8rem;
1143+ }
1144+
10501145 .photo-hero,
10511146 .photo-hero__frame {
10521147 min-height: calc(100svh - 4.4rem);
@@ -1139,12 +1234,6 @@ const navigation = [
11391234</style >
11401235
11411236<script >
1142- const toggle = document.getElementById('photo-theme-toggle');
1143- toggle?.addEventListener('click', () => {
1144- document.documentElement.classList.toggle('dark');
1145- localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light');
1146- });
1147-
11481237 const galleryRoot = document.querySelector('.photo-page');
11491238 const photoRailLinks = Array.from(document.querySelectorAll('[data-photo-link]'));
11501239 const photoPanels = Array.from(document.querySelectorAll('[data-photo-panel]'));
0 commit comments