diff --git a/AGENTS.md b/AGENTS.md index 0d4e8e4..e88aeed 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -204,6 +204,10 @@ The repository does not currently feature automated test files. Testing is execu can be integrated by adding definitions to the `APP_THEMES` array in `src/data/themes.ts`. - **Proxy Endpoint Rerouting**: The Ollama upstream proxy route in `vite.config.ts` and `api/ollama-chat.js` can be adjusted to point to alternative LLM hosts or local server instances. +- **Motion Language**: Shared animation durations and the standard ease-out curve live in + `src/lib/motion.ts` (`VIEW_TRANSITION`, `MODAL_TRANSITION`, `TOAST_TRANSITION`, `TILE_TRANSITION`). + The root tree is wrapped in `MotionConfig reducedMotion="user"` (`src/main.tsx`), and `src/index.css` + carries the global `prefers-reduced-motion` neutralizer plus the shared hover/press interaction rules. - **Configurable Environment Parameters**: - `VITE_APPWRITE_ENDPOINT` – Base URL for the Appwrite API server. - `VITE_APPWRITE_PROJECT_ID` – The Appwrite project instance identifier. diff --git a/src/App.tsx b/src/App.tsx index bc71aeb..9f37d95 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -43,6 +43,7 @@ import { SettingsView } from "./components/views/SettingsView"; import { TrendsView } from "./components/views/TrendsView"; import { buildDashboard, buildInsights } from "./lib/dashboard"; import { applyFilters, DEFAULT_FILTERS } from "./lib/filters"; +import { VIEW_TRANSITION } from "./lib/motion"; import { evaluateLimits, limitStatusMessage, @@ -659,7 +660,7 @@ function App() { initial={{ opacity: 0, y: 10 }} animate={{ opacity: 1, y: 0 }} exit={{ opacity: 0, y: -8 }} - transition={{ duration: 0.2 }} + transition={VIEW_TRANSITION} className="app-view" > {activeView === "overview" && ( diff --git a/src/components/BarcodeScannerModal.tsx b/src/components/BarcodeScannerModal.tsx index 7fc1312..fa3582a 100644 --- a/src/components/BarcodeScannerModal.tsx +++ b/src/components/BarcodeScannerModal.tsx @@ -26,6 +26,7 @@ import { } from "../lib/barcodeScanner"; import { listBarcodeCatalog, upsertCloudUserBarcodeMapping } from "../lib/appwriteBarcodes"; import { caffeinePerCan, currency, defaultPriceForSize, wholeNumber } from "../lib/metrics"; +import { MODAL_TRANSITION } from "../lib/motion"; import { loadUserBarcodeMappings, upsertUserBarcodeMapping, @@ -311,7 +312,7 @@ export function BarcodeScannerModal({ initial={{ opacity: 0, y: 18, scale: 0.98 }} animate={{ opacity: 1, y: 0, scale: 1 }} exit={{ opacity: 0, y: 14, scale: 0.98 }} - transition={{ duration: 0.22 }} + transition={MODAL_TRANSITION} >
{toast.message}
diff --git a/src/components/TopBar.tsx b/src/components/TopBar.tsx index 722b177..d6e6a18 100644 --- a/src/components/TopBar.tsx +++ b/src/components/TopBar.tsx @@ -36,7 +36,7 @@ export function TopBar({ activeView, busyAction, onAdd, onScan, className = "" }