{message}
+diff --git a/package-lock.json b/package-lock.json index 8991785..9f6acb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@googlemaps/js-api-loader": "^1.16.8", "d3": "^7.9.0", "firebase": "^11.9.0", + "openai": "^5.1.1", "topojson-client": "^3.1.0", "topojson-server": "^3.0.1" }, @@ -3108,6 +3109,27 @@ "node": ">=0.10.0" } }, + "node_modules/openai": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/openai/-/openai-5.1.1.tgz", + "integrity": "sha512-lgIdLqvpLpz8xPUKcEIV6ml+by74mbSBz8zv/AHHebtLn/WdpH4kdXT3/Q5uUKDHg3vHV/z9+G9wZINRX6rkDg==", + "license": "Apache-2.0", + "bin": { + "openai": "bin/cli" + }, + "peerDependencies": { + "ws": "^8.18.0", + "zod": "^3.23.8" + }, + "peerDependenciesMeta": { + "ws": { + "optional": true + }, + "zod": { + "optional": true + } + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", diff --git a/package.json b/package.json index 60bce95..32ac571 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "@googlemaps/js-api-loader": "^1.16.8", "d3": "^7.9.0", "firebase": "^11.9.0", + "openai": "^5.1.1", "topojson-client": "^3.1.0", "topojson-server": "^3.0.1" } diff --git a/src/lib/components/Button.svelte b/src/lib/components/Button.svelte index 3f17f03..79cd7ea 100644 --- a/src/lib/components/Button.svelte +++ b/src/lib/components/Button.svelte @@ -43,6 +43,18 @@ transform: scale(1.02); } + .full-gray { + width: 100%; + background-color: var(--gray-50); + color: var(--gray-400); + } + + .full-gray:hover { + background-color: var(--gray-100); + color: var(--gray-600); + transform: scale(1.02); + } + .blue { width: 50%; background-color: var(--planner-400); diff --git a/src/lib/components/LoadingOverlay.svelte b/src/lib/components/LoadingOverlay.svelte new file mode 100644 index 0000000..64eb85d --- /dev/null +++ b/src/lib/components/LoadingOverlay.svelte @@ -0,0 +1,58 @@ + + +{#if show} +
+{/if} + + \ No newline at end of file diff --git a/src/lib/components/PastTripsPanel.svelte b/src/lib/components/PastTripsPanel.svelte index 44fb141..86f7535 100644 --- a/src/lib/components/PastTripsPanel.svelte +++ b/src/lib/components/PastTripsPanel.svelte @@ -2,15 +2,12 @@ import { slide } from 'svelte/transition'; import { quintOut } from 'svelte/easing'; import TripCard from './TripCard.svelte'; - import { ref, onValue } from 'firebase/database'; - import { db } from '../../firebase'; export let showPanel = false; export let destination = ''; + export let pastTrips: any[] = []; export let onClose = () => {}; - let pastTrips: any[] = []; - let loading = true; let tripsContainer: HTMLElement; let showLeftButton = false; let showRightButton = true; @@ -43,35 +40,6 @@ behavior: 'smooth' }); } - - $: if (showPanel && destination) { - // Fetch past trips for this destination - const tripsRef = ref(db, 'trips'); - onValue(tripsRef, (snapshot) => { - const allTrips: any[] = []; - snapshot.forEach((childSnapshot) => { - const trip = { - tid: childSnapshot.key, - ...childSnapshot.val() - }; - allTrips.push(trip); - }); - - // Get today's date at midnight for comparison - const today = new Date(); - today.setHours(0, 0, 0, 0); - - // Filter past trips for this destination - pastTrips = allTrips - .filter(trip => { - const endDate = new Date(trip.endDate); - return endDate < today && trip.destination.name === destination; - }) - .sort((a, b) => new Date(b.endDate).getTime() - new Date(a.endDate).getTime()); // Most recent first - - loading = false; - }); - } {#if showPanel} @@ -87,9 +55,7 @@