diff --git a/package-lock.json b/package-lock.json index 57d22e9..ea7c560 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "axios": "^1.6.7", "dotenv": "^8.2.0", + "framer-motion": "^12.15.0", "lucide-react": "^0.344.0", "react": "^18.3.1", "react-dom": "^18.3.1" @@ -3431,6 +3432,33 @@ "url": "https://github.com/sponsors/rawify" } }, + "node_modules/framer-motion": { + "version": "12.15.0", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.15.0.tgz", + "integrity": "sha512-XKg/LnKExdLGugZrDILV7jZjI599785lDIJZLxMiiIFidCsy0a4R2ZEf+Izm67zyOuJgQYTHOmodi7igQsw3vg==", + "license": "MIT", + "dependencies": { + "motion-dom": "^12.15.0", + "motion-utils": "^12.12.1", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "@emotion/is-prop-valid": "*", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/is-prop-valid": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -4500,6 +4528,21 @@ "integrity": "sha512-15Ztpk+nov8DR524R4BF7uEuzESgzUEAV4Ah7CUMNGXdE5ELuvxElxGXndBl32vMSsWa1jpNf22Z+Er3sKwq+w==", "dev": true }, + "node_modules/motion-dom": { + "version": "12.15.0", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.15.0.tgz", + "integrity": "sha512-D2ldJgor+2vdcrDtKJw48k3OddXiZN1dDLLWrS8kiHzQdYVruh0IoTwbJBslrnTXIPgFED7PBN2Zbwl7rNqnhA==", + "license": "MIT", + "dependencies": { + "motion-utils": "^12.12.1" + } + }, + "node_modules/motion-utils": { + "version": "12.12.1", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.12.1.tgz", + "integrity": "sha512-f9qiqUHm7hWSLlNW8gS9pisnsN7CRFRD58vNjptKdsqFLpkVnX00TNeD6Q0d27V9KzT7ySFyK1TZ/DShfVOv6w==", + "license": "MIT" + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -5928,6 +5971,12 @@ "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", "dev": true }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", diff --git a/package.json b/package.json index 9b86784..d2dc9d4 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "dependencies": { "axios": "^1.6.7", "dotenv": "^8.2.0", + "framer-motion": "^12.15.0", "lucide-react": "^0.344.0", "react": "^18.3.1", "react-dom": "^18.3.1" @@ -37,4 +38,4 @@ "vite": "^5.4.2", "vitest": "^1.3.1" } -} \ No newline at end of file +} diff --git a/src/App.tsx b/src/App.tsx index 563a66f..fc5288f 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,6 @@ import React, { useState, useEffect } from 'react'; import { Bird, Menu, X } from 'lucide-react'; +import { motion, AnimatePresence } from 'framer-motion'; import { Home } from './components/Home'; import { YachtSearch } from './components/YachtSearch'; import { TripCalculator } from './components/TripCalculator'; @@ -8,7 +9,7 @@ import { About } from './components/About'; import { Contact } from './components/Contact'; import { OffsetOrder } from './components/OffsetOrder'; import { getVesselData } from './api/aisClient'; -import { calculateCarbon } from './utils/carbonCalculator'; +import { calculateTripCarbon } from './utils/carbonCalculator'; import { analytics } from './utils/analytics'; import type { VesselData, CarbonCalculation, CalculatorType } from './types'; @@ -211,8 +212,21 @@ function App() { -
- {renderPage()} +
+ + + {renderPage()} + +