diff --git a/src/app.css b/src/app.css index db19a19..4d107db 100644 --- a/src/app.css +++ b/src/app.css @@ -2,10 +2,24 @@ @tailwind components; @tailwind utilities; -.scroll-hidden { - -ms-overflow-style: none; /* Internet Explorer 10+ */ - scrollbar-width: none; /* Firefox */ -} -.scroll-hidden::-webkit-scrollbar { - display: none; /* Safari and Chrome */ +@layer components { + .scroll-hidden { + -ms-overflow-style: none; /* Internet Explorer 10+ */ + scrollbar-width: none; /* Firefox */ + } + .scroll-hidden::-webkit-scrollbar { + display: none; /* Safari and Chrome */ + } + + .h1 { + @apply mb-4 text-2xl font-semibold text-[#86858B] dark:text-gray-300; + } + + .h2 { + @apply mb-4 text-xl font-semibold text-[#86858B] dark:text-gray-300; + } + + .h3 { + @apply mb-2 text-lg font-semibold dark:text-white; + } } diff --git a/src/components/ArrivalDeparture.svelte b/src/components/ArrivalDeparture.svelte index e5b0cc4..c4a32ca 100644 --- a/src/components/ArrivalDeparture.svelte +++ b/src/components/ArrivalDeparture.svelte @@ -23,7 +23,9 @@ const predictedDiff = predicted - now; const scheduledDiff = scheduled - now; - if (predictedDiff <= 0) { + if (predictedTime == 0) { + return { status: 'scheduled', text: 'Scheduled/not real-time', color: 'text-gray-500' }; + } else if (predictedDiff <= 0) { return { status: 'early', text: 'arrives ' + Math.abs(Math.floor(predictedDiff / 60000)) + ' min early', @@ -71,10 +73,10 @@ class="flex h-auto w-full items-center justify-between border-b-[1px] border-[#C6C6C8] bg-[#ffffff] p-4 hover:cursor-pointer hover:bg-[#e3e3e3] dark:border-[#313135] dark:bg-[#1c1c1c] hover:dark:bg-[#363636]" >
-

+

{routeShortName} - {tripHeadsign}

-

+

{formatTime(scheduledArrivalTime)} - {getArrivalStatus(predictedArrivalTime, scheduledArrivalTime).text} diff --git a/src/components/map/RouteMap.svelte b/src/components/map/RouteMap.svelte index a031510..e3997ac 100644 --- a/src/components/map/RouteMap.svelte +++ b/src/components/map/RouteMap.svelte @@ -74,7 +74,7 @@ infoWindow = new google.maps.InfoWindow({ content: `

-

${stop.name}

+

${stop.name}

Arrival time: ${new Date(stopTime.arrivalTime * 1000).toLocaleTimeString()}

` }); diff --git a/src/components/navigation/Header.svelte b/src/components/navigation/Header.svelte index fb302e4..ce2a04b 100644 --- a/src/components/navigation/Header.svelte +++ b/src/components/navigation/Header.svelte @@ -12,16 +12,12 @@ let searchInput = ''; async function handleSearch() { - if (searchInput.length > 2) { - try { - const response = await fetch(`/api/oba/search?query=${encodeURIComponent(searchInput)}`); - const results = await response.json(); - console.log('Route results:', results.routeSearchResults); - console.log('Stop results:', results.stopSearchResults); - dispatch('searchResults', results); - } catch (error) { - console.error('Error fetching search results:', error); - } + try { + const response = await fetch(`/api/oba/search?query=${encodeURIComponent(searchInput)}`); + const results = await response.json(); + dispatch('searchResults', results); + } catch (error) { + console.error('Error fetching search results:', error); } } @@ -33,7 +29,7 @@
diff --git a/src/components/navigation/TripDetailsModal.svelte b/src/components/navigation/TripDetailsModal.svelte index 9f83121..bee3882 100644 --- a/src/components/navigation/TripDetailsModal.svelte +++ b/src/components/navigation/TripDetailsModal.svelte @@ -12,7 +12,7 @@
-

{stop.name}

-

Stop #{stop.id}

+

{stop.name}

+

Stop #{stop.id}

{#if routeShortNames()} -

Routes: {routeShortNames().join(', ')}

+

Routes: {routeShortNames().join(', ')}

{/if}
-

- Arrivals and Departures -

+

Arrivals and Departures

diff --git a/src/components/oba/TripDetailsPane.svelte b/src/components/oba/TripDetailsPane.svelte index 178be53..73a1a09 100644 --- a/src/components/oba/TripDetailsPane.svelte +++ b/src/components/oba/TripDetailsPane.svelte @@ -86,7 +86,7 @@ {#if error}

{error}

{:else if tripDetails} -

+

{#if routeInfo} Route {routeInfo.shortName} - {/if} diff --git a/src/components/search/SearchResults.svelte b/src/components/search/SearchResults.svelte index 09f5c2a..f7b0fc0 100644 --- a/src/components/search/SearchResults.svelte +++ b/src/components/search/SearchResults.svelte @@ -15,9 +15,9 @@
-

Search Results

+

Search Results

-

Routes

+

Routes

{#if searchResults?.routeSearchResults?.list?.length > 0}
    {#each searchResults.routeSearchResults.list as route} @@ -35,7 +35,7 @@

    No routes found.

    {/if} -

    Stops

    +

    Stops

    {#if searchResults?.stopSearchResults?.list?.length > 0}
      {#each searchResults.stopSearchResults.list as stop} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index a21d50c..5408718 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -56,9 +56,7 @@ showRouteMap = false; } function handleSearch(event) { - console.log('Raw search event:', event); searchResults = event.detail; - console.log('Search results set:', searchResults); } function closeModal() { @@ -66,7 +64,9 @@ } -
      +
      +
      +
      {#if stop} @@ -89,7 +89,7 @@ on:stopSelected={stopSelected} /> {:else} -

      No results found.

      +

      No results found.

      {/if}
      {/if}