perf: use animated <details> for expandables, optimize CSS animations

This commit is contained in:
Xylight committed 2026-07-15 13:20:56 -07:00
1 parent dfe6a7e67d
commit c18902a4c7
12 files changed
+105 -68

No files matched your search

+12 -4
View File
@@ -38,7 +38,7 @@
{@render children?.()}
<div class="min-h-screen flex flex-col">
<div
class={['shell-navbar-holder', !dockVisible && 'max-md:-bottom-24!']}
class={['shell-navbar-holder', !dockVisible && 'auto-hidden']}
aria-hidden="true"
>
<div class="md:hidden flex justify-between" dir="ltr">
@@ -71,11 +71,20 @@
.shell-navbar-holder {
position: fixed;
bottom: 0;
z-index: 50;
pointer-events: none;
width: 100%;
transition: bottom 0.4s cubic-bezier(0.075, 0.82, 0.165, 1);
bottom: 0;
translate: 0% 0%;
transition: translate 0.4s cubic-bezier(0.19, 1, 0.22, 1);
will-change: translate;
@variant max-md {
&.auto-hidden {
translate: 0% 100% !important;
}
}
@variant md {
position: sticky;
@@ -108,7 +117,6 @@
background-color: var(--color-zinc-950);
border-color: var(--color-zinc-900);
@variant md {
background-color: --alpha(var(--color-zinc-950) / 70%);
}
}
}
+10 -7
View File
@@ -28,7 +28,9 @@
let matchType = $derived<('search' | 'pathname')[]>(
routes.map((i) =>
new URL(`https://example.com${i.href}`)?.search != '' ? 'search' : 'pathname',
new URL(`https://example.com${i.href}`)?.search != ''
? 'search'
: 'pathname',
),
)
@@ -40,9 +42,9 @@
// me on 2025/10/9: no shi buh
const usePathname = !routes.some(
(i) =>
new Set(new URL(`https://example.com${i.href}`).searchParams.values()).intersection(
currentSearch,
).size > 0,
new Set(
new URL(`https://example.com${i.href}`).searchParams.values(),
).intersection(currentSearch).size > 0,
)
const hasSearchParam = hrefSearch.intersection(currentSearch).size > 0
@@ -91,8 +93,10 @@
flex-direction: row;
align-items: center;
justify-items: center;
flex-wrap: wrap;
z-index: 20;
overflow-x: auto;
max-width: 100%;
flex-shrink: 0;
@variant sm {
margin-top: 0;
@@ -102,10 +106,9 @@
.tab-bar.bar-header {
padding: calc(var(--spacing) * 0.5);
gap: calc(var(--spacing) * 1) calc(var(--spacing) * 1);
justify-content: center;
margin-top: calc(var(--spacing) * -1);
margin-left: auto;
margin-right: auto;
margin-top: calc(var(--spacing) * -1);
@variant sm {
justify-content: start;