From b9482e3164423a72324a8a0570e5001a1af25659 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Sat, 28 Nov 2026 15:42:45 -0600 Subject: [PATCH] fancy navbar --- CLAUDE.md | 4 +- .../website/src/components/BaseStyles.astro | 9 + .../website/src/components/HomeHero.astro | 26 +- .../website/src/components/NavbarCourse.astro | 24 +- .../website/src/components/NavbarFine.astro | 379 ++++++++++++------ .../src/components/Section/index.module.css | 16 - .../website/src/components/Sections.astro | 15 + .../website/src/components/ToolBanner.astro | 6 - packages/website/src/config/tools.ts | 38 +- packages/website/src/layouts/BaseLayout.astro | 10 +- packages/website/src/media/heros/fall.jpg | Bin 0 -> 333070 bytes packages/website/src/media/heros/spring.jpg | Bin 0 -> 329958 bytes packages/website/src/media/heros/summer.jpg | Bin 0 -> 315187 bytes .../[...locale]/compare/index.astro | 19 +- .../[...locale]/index.astro | 14 +- .../[...locale]/tanks/index.astro | 31 +- .../[...locale]/tier-list/index.astro | 29 +- 17 files changed, 422 insertions(+), 198 deletions(-) create mode 100644 packages/website/src/components/Sections.astro create mode 100644 packages/website/src/media/heros/fall.jpg create mode 100644 packages/website/src/media/heros/spring.jpg create mode 100644 packages/website/src/media/heros/summer.jpg diff --git a/CLAUDE.md b/CLAUDE.md index 2d1f10048..aef843e74 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -50,10 +50,12 @@ Pages that are not migrated yet are named `_index.astro` so Astro skips them. Mi - Select elements by their own class, never by structure or tag (`> *`, `> div`, `:first-child`, bare `svg`, `[data-x] > *`). If an element needs styling, give it a class and nest that class under its parent. The exception is content a component renders internally that has no `className` to pass, like the icon inside an `IconButton` (`.swatch svg`). - Nest CSS to mirror the markup: a child's rules go inside its parent's block (`.marker { .bar { } }`), so the stylesheet reads like the HTML tree. - Fully rounded corners use `var(--radius-max)`, never `var(--max-size)`. -- `z-index` stays at `1` unless a real overlap needs more. +- Avoid `z-index: 2` or above unless nothing else works. Resolve overlaps first by DOM order (a later sibling at the same `z-index` paints on top, so put overlays and curtains before what must sit above them) or by leveling the field (give competing siblings the same `position: relative`/`z-index: 1`, or `isolation: isolate` a container so its children's layers stay inside it). ## Components +- Don't copy the same markup or styles across files. As soon as a block repeats, extract it into a component and use that everywhere it appeared. + - Dialog-like surfaces (`Dialog`, `AlertDialog`, `Popover`) share their extra parts, which live as their own top-level components: `DialogHeader`, `DialogBody`, `DialogActions` and `DialogField` (a labeled control, taking a `label` prop). Each surface attaches them as `X.Header`, `X.Body`, `X.Actions` and `X.Field`; none defines its own copy. Fix their spacing in the part's own CSS module. - Other extra non-Radix parts of a composed component are local functions in that component's `index.tsx`, `function Name({ className, ...props }: ComponentProps<"div">)` using `classNames(styles["kebab-class"], className)`, spread in with `{ ...composeRadixComponents(_, styles), Name }`. Once a part is shared by several components, it moves out into its own top-level component instead, like the `Dialog*` parts. A part shared across menus (`Discriminator` in DropdownMenu) is styled through a data attribute, since CSS modules re-hash classes per importing file. diff --git a/packages/website/src/components/BaseStyles.astro b/packages/website/src/components/BaseStyles.astro index 2f9eb10d9..8c90c53f7 100644 --- a/packages/website/src/components/BaseStyles.astro +++ b/packages/website/src/components/BaseStyles.astro @@ -73,6 +73,10 @@ styles += "}"; --duration-brief: 200ms; --duration-subtle: 2s; --duration-spinner: 1s; + /* Gap between consecutive items in a staggered entrance */ + --duration-stagger: 20ms; + + --easing-standard: cubic-bezier(0.4, 0, 0.6, 1); --tank-card-min-width: 8rem; --drop-down-min-width: 16rem; @@ -81,6 +85,11 @@ styles += "}"; -