Skip to content

Commit 2854cd0

Browse files
committed
feat: re-sign all previous work
1 parent 7ed6930 commit 2854cd0

File tree

4 files changed

+64
-17
lines changed

4 files changed

+64
-17
lines changed

src/components/MobileMenu.astro

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ const {
7171
>{menu.donate}</a
7272
>
7373
</li>
74-
<li>
75-
<a href={getLocalePath('/about')} class="block text-dark hover:text-coral"
76-
>{menu.aboutUs}</a
77-
>
78-
</li>
7974
<li>
8075
<a href="https://docs.zen-browser.app" class="block text-dark hover:text-coral"
8176
>{menu.documentation}</a
@@ -91,6 +86,10 @@ const {
9186
</ul>
9287
</li>
9388
<!-- Extra Links -->
89+
<li>
90+
<a href={getLocalePath('/about')} class="block text-dark hover:text-coral">{menu.aboutUs}</a
91+
>
92+
</li>
9493
<li>
9594
<a href={getLocalePath('/mods')} class="block font-bold text-dark hover:text-coral"
9695
>{menu.mods}</a

src/components/NavBar.astro

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const {
3232
class="hidden items-center gap-6 place-self-center text-xs sm:text-sm lg:flex lg:text-base"
3333
>
3434
<Dropdown class="group">
35-
<button class="flex items-center">
35+
<button class="flex items-center rounded-lg p-3 hover:bg-muted group-open:bg-muted">
3636
<span>{menu.gettingStarted}</span>
3737
<ChevronDownIcon
3838
class="size-4 transform transition-transform duration-200 group-open:rotate-180 md:ml-2"
@@ -66,7 +66,7 @@ const {
6666
</DropdownItems>
6767
</Dropdown>
6868
<Dropdown class="group">
69-
<button class="flex items-center">
69+
<button class="flex items-center rounded-lg p-3 hover:bg-muted group-open:bg-muted">
7070
<span>{menu.usefulLinks}</span>
7171
<ChevronDownIcon
7272
class="size-4 transform transition-transform duration-200 group-open:rotate-180 md:ml-2"
@@ -80,12 +80,6 @@ const {
8080
{menu.donateDesc}
8181
</div>
8282
</a>
83-
<a class="dropdown-item" href={getLocalePath('/about')}>
84-
<div class="dropdown-title">{menu.aboutUs}</div>
85-
<div class="dropdown-description">
86-
{menu.aboutUsDesc}
87-
</div>
88-
</a>
8983
<a class="dropdown-item" href="https://docs.zen-browser.app">
9084
<div class="dropdown-title">{menu.documentation}</div>
9185
<div class="dropdown-description">
@@ -101,7 +95,16 @@ const {
10195
</div>
10296
</DropdownItems>
10397
</Dropdown>
104-
<a class="hidden items-center lg:block" href={getLocalePath('/mods')}>
98+
<a
99+
class={`hidden items-center hover:bg-muted rounded-lg p-3 lg:block${Astro.url.pathname === getLocalePath('/about') ? ' text-coral' : ''}`}
100+
href={getLocalePath('/about')}
101+
>
102+
<span>{menu.aboutUs}</span>
103+
</a>
104+
<a
105+
class={`hidden items-center hover:bg-muted rounded-lg p-3 lg:block${Astro.url.pathname === getLocalePath('/mods') ? ' text-coral' : ''}`}
106+
href={getLocalePath('/mods')}
107+
>
105108
<span>{menu.mods}</span>
106109
</a>
107110
</div>
@@ -135,7 +138,7 @@ const {
135138

136139
<style>
137140
.navbar-dropdown {
138-
@apply absolute left-1/2 mt-2 grid !-translate-x-1/2 !transform grid-cols-2 gap-2 rounded-lg border-2 border-dark bg-paper p-3 shadow-sm;
141+
@apply absolute left-1/2 mt-2 grid !-translate-x-1/2 !transform grid-cols-2 gap-2 rounded-lg border border-dark bg-paper p-3 shadow-lg;
139142
& .dropdown-item {
140143
@apply flex cursor-pointer select-none flex-col gap-2 rounded-lg p-4 transition-colors duration-200;
141144

@@ -158,3 +161,48 @@ const {
158161
@apply text-dark;
159162
}
160163
</style>
164+
<script>
165+
import { animate, stagger } from 'animejs'
166+
167+
function animateDropdown(dropdown: Element) {
168+
animate(dropdown, {
169+
opacity: { from: 0, to: 1 },
170+
filter: { from: 'blur(4px)', to: 'blur(0px)' },
171+
duration: 300,
172+
easing: 'cubicBezier(0.25, 0.1, 0.25, 1)',
173+
})
174+
175+
const items = dropdown.querySelectorAll('.dropdown-item')
176+
if (items.length) {
177+
animate(items, {
178+
opacity: { from: 0, to: 1 },
179+
translateY: { from: 20, to: 0 },
180+
filter: { from: 'blur(4px)', to: 'blur(0px)' },
181+
duration: 300,
182+
delay: stagger(150),
183+
easing: 'cubicBezier(0.25, 0.1, 0.25, 1)',
184+
})
185+
}
186+
}
187+
188+
// Initialize dropdown animations on page load
189+
document.addEventListener('DOMContentLoaded', () => {
190+
document.querySelectorAll('.dropdown-toggle').forEach(toggle => {
191+
const dropdown = toggle.querySelector('.navbar-dropdown')
192+
if (!dropdown) return
193+
194+
if (!toggle.classList.contains('hidden')) {
195+
animateDropdown(dropdown)
196+
}
197+
198+
const observer = new MutationObserver(mutations => {
199+
mutations.forEach(mutation => {
200+
if (mutation.attributeName === 'class' && !toggle.classList.contains('hidden')) {
201+
animateDropdown(dropdown)
202+
}
203+
})
204+
})
205+
observer.observe(toggle, { attributes: true })
206+
})
207+
})
208+
</script>

src/i18n/en/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@
502502
"discordDesc": "Join our community on Discord to chat with other Zen users!",
503503
"donate": "Donate ❤️",
504504
"donateDesc": "Support the development of Zen with a donation.",
505-
"aboutUs": "About Us 🌟",
505+
"aboutUs": "About Us",
506506
"aboutUsDesc": "Learn more about the team behind Zen.",
507507
"documentation": "Documentation",
508508
"documentationDesc": "Learn how to use Zen with our documentation.",

src/i18n/ja/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@
507507
"discordDesc": "Discordコミュニティで他のZenユーザーと交流!",
508508
"donate": "寄付 ❤️",
509509
"donateDesc": "Zen開発を寄付で応援。",
510-
"aboutUs": "私たちについて 🌟",
510+
"aboutUs": "私たちについて",
511511
"aboutUsDesc": "Zenのチームについて知る。",
512512
"documentation": "ドキュメント",
513513
"documentationDesc": "ドキュメントでZenの使い方を学ぶ。",

0 commit comments

Comments
 (0)