From 5d278b3f117544f98556b65cdf66a7aa1987aa88 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sat, 28 Nov 2026 16:12:35 -0600 Subject: [PATCH] center fallbacks --- .../website/src/components/NavbarFine.astro | 44 +++++++++++-------- .../ScrollerCurtains/index.module.css | 34 ++++++++++++-- .../src/components/Section/index.module.css | 5 +++ .../website/src/components/Sections.astro | 3 +- .../src/components/TankCard/index.module.css | 3 ++ .../TankCardSkeleton/index.module.css | 2 + .../TankSearchNoResults/index.module.css | 4 ++ .../components/TankSearchNoResults/index.tsx | 9 +--- 8 files changed, 73 insertions(+), 31 deletions(-) diff --git a/packages/website/src/components/NavbarFine.astro b/packages/website/src/components/NavbarFine.astro index 70d72a4c2..b976bbf2e 100644 --- a/packages/website/src/components/NavbarFine.astro +++ b/packages/website/src/components/NavbarFine.astro @@ -37,10 +37,7 @@ const groups = toolGroups.map((group) => { #navbar-fine { --icon-size: 1.5rem; --padding: var(--space-4); - --content-inset: max( - var(--page-padding), - (100% - var(--page-width)) / 2 - ); + --content-inset: max(var(--page-padding), (100% - var(--page-width)) / 2); display: none; @@ -146,6 +143,15 @@ const groups = toolGroups.map((group) => { flex-direction: column; gap: var(--space-3); + .entry[data-disabled="true"] { + opacity: calc(1 / 4); + cursor: not-allowed; + + .tool { + pointer-events: none; + } + } + .tool { display: flex; align-items: center; @@ -340,21 +346,23 @@ const groups = toolGroups.map((group) => {
{group.tools.map((tool, index) => ( - -
-
+
+ +
+
- - {strings.tools[tool.id as keyof typeof strings.tools]} - -
- + + {strings.tools[tool.id as keyof typeof strings.tools]} + +
+
+
))}
diff --git a/packages/website/src/components/ScrollerCurtains/index.module.css b/packages/website/src/components/ScrollerCurtains/index.module.css index d7e833d1e..b3912cd8a 100644 --- a/packages/website/src/components/ScrollerCurtains/index.module.css +++ b/packages/website/src/components/ScrollerCurtains/index.module.css @@ -2,12 +2,38 @@ display: none; } +@property --scroller-curtains-x-start { + syntax: ""; + inherits: false; + initial-value: 0; +} + +@property --scroller-curtains-x-end { + syntax: ""; + inherits: false; + initial-value: 0; +} + +@property --scroller-curtains-y-start { + syntax: ""; + inherits: false; + initial-value: 0; +} + +@property --scroller-curtains-y-end { + syntax: ""; + inherits: false; + initial-value: 0; +} + .target { --scroller-curtains-size: min(25%, var(--space-6)); - --scroller-curtains-x-start: 0; - --scroller-curtains-x-end: 0; - --scroller-curtains-y-start: 0; - --scroller-curtains-y-end: 0; + + /* Registered above so the fades ease in and out instead of snapping */ + transition-property: + --scroller-curtains-x-start, --scroller-curtains-x-end, + --scroller-curtains-y-start, --scroller-curtains-y-end; + transition-duration: var(--duration-brief); /* Masks the element's own box, so the fade stays put while the content scrolls under it */ mask-image: diff --git a/packages/website/src/components/Section/index.module.css b/packages/website/src/components/Section/index.module.css index 8fbd28912..2e2bec918 100644 --- a/packages/website/src/components/Section/index.module.css +++ b/packages/website/src/components/Section/index.module.css @@ -5,4 +5,9 @@ &[data-overflow="true"] { overflow-x: auto; } + + /* The last section fills the leftover page height, so empty states can center in it */ + &:last-child { + flex: 1; + } } diff --git a/packages/website/src/components/Sections.astro b/packages/website/src/components/Sections.astro index 403e77e99..18ba384dc 100644 --- a/packages/website/src/components/Sections.astro +++ b/packages/website/src/components/Sections.astro @@ -13,11 +13,12 @@ const { centered } = Astro.props; display: flex; flex-direction: column; - gap: var(--space-6); + gap: var(--page-padding); padding: 0 var(--page-padding) var(--page-padding); &[data-centered="true"] { + gap: var(--space-6); padding-inline: max( var(--page-padding), (100% - var(--page-width)) / 2 diff --git a/packages/website/src/components/TankCard/index.module.css b/packages/website/src/components/TankCard/index.module.css index 5d22584ec..542199e24 100644 --- a/packages/website/src/components/TankCard/index.module.css +++ b/packages/website/src/components/TankCard/index.module.css @@ -5,6 +5,9 @@ &[data-compact="true"] { --image-height: 4rem; + + /* Pinned so long names ellipsize instead of widening the card */ + width: var(--min-tank-card-size); } .image-wrapper { diff --git a/packages/website/src/components/TankCardSkeleton/index.module.css b/packages/website/src/components/TankCardSkeleton/index.module.css index 3a92facab..57d6d3d34 100644 --- a/packages/website/src/components/TankCardSkeleton/index.module.css +++ b/packages/website/src/components/TankCardSkeleton/index.module.css @@ -6,6 +6,8 @@ &[data-compact="true"] { --image-height: 4rem; + width: var(--min-tank-card-size); + .image-wrapper { background-size: auto 75%; } diff --git a/packages/website/src/components/TankSearchNoResults/index.module.css b/packages/website/src/components/TankSearchNoResults/index.module.css index a3f545881..0e37361e2 100644 --- a/packages/website/src/components/TankSearchNoResults/index.module.css +++ b/packages/website/src/components/TankSearchNoResults/index.module.css @@ -1,3 +1,7 @@ .no-results { flex: 1; + + display: flex; + align-items: center; + justify-content: center; } diff --git a/packages/website/src/components/TankSearchNoResults/index.tsx b/packages/website/src/components/TankSearchNoResults/index.tsx index fee9383fa..32551ea2a 100644 --- a/packages/website/src/components/TankSearchNoResults/index.tsx +++ b/packages/website/src/components/TankSearchNoResults/index.tsx @@ -12,14 +12,7 @@ export function TankSearchNoResults({ type = "filters" }: NoResultsProps) { const strings = useStrings(); return ( -
+
{strings.website.common.tank_search.no_tanks_found.body}{" "}