@@ -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 >
0 commit comments