From e98b0d86d2d0c3720b6d83d0e7b39d34c1531e72 Mon Sep 17 00:00:00 2001 From: lukas Date: Thu, 10 Sep 2026 12:30:56 +0200 Subject: [PATCH] Animate quantity steppers and make the nav bar sticky MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add an AnimatedNumber component that slides a quantity stepper's count horizontally — left on increment, right on decrement — and wire it into both the menu and basket steppers. - Make the top nav bar position: sticky, with an explicit background so scrolled content doesn't show through it. - Reserve the scrollbar's gutter on every page (scrollable or not) so the sticky header doesn't shift width when navigating between short and tall pages. Co-Authored-By: Claude Sonnet 5 --- src/components/ordering/MenuList.tsx | 3 +- src/components/ui/AnimatedNumber.module.scss | 11 ++++ src/components/ui/AnimatedNumber.tsx | 58 ++++++++++++++++++++ src/routes/__root.module.scss | 4 +- src/routes/basket.tsx | 3 +- src/styles/globals.scss | 10 ++++ 6 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 src/components/ui/AnimatedNumber.module.scss create mode 100644 src/components/ui/AnimatedNumber.tsx diff --git a/src/components/ordering/MenuList.tsx b/src/components/ordering/MenuList.tsx index 575a304..33dbfd4 100644 --- a/src/components/ordering/MenuList.tsx +++ b/src/components/ordering/MenuList.tsx @@ -1,3 +1,4 @@ +import { AnimatedNumber } from '#/components/ui/AnimatedNumber.tsx' import type { MenuItemWithRecipe } from '#/domain/ordering.ts' import styles from './MenuList.module.scss' @@ -51,7 +52,7 @@ export const MenuList = ({ > − - {quantity} + - {quantity} +