diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2025-11-14 19:02:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-14 19:02:25 +0100 |
| commit | 3b39aabbffdb3d3d7bbf339c6cd6208bc3b2f794 (patch) | |
| tree | a805594d0ea79864df4a9d902ed4bb6042726ca8 /src/frontend | |
| parent | d285093900ff6f8e3d5dba394999bb413f5d00f3 (diff) | |
fix some styles
Diffstat (limited to 'src/frontend')
| -rw-r--r-- | src/frontend/app/components/Stops/ConsolidatedCirculationList.css | 1 | ||||
| -rw-r--r-- | src/frontend/app/components/Stops/ConsolidatedCirculationList.tsx | 2 | ||||
| -rw-r--r-- | src/frontend/app/routes/estimates-$id.tsx | 30 | ||||
| -rw-r--r-- | src/frontend/app/routes/stops-$id.css | 319 | ||||
| -rw-r--r-- | src/frontend/app/routes/stops-$id.tsx | 4 |
5 files changed, 337 insertions, 19 deletions
diff --git a/src/frontend/app/components/Stops/ConsolidatedCirculationList.css b/src/frontend/app/components/Stops/ConsolidatedCirculationList.css index 3705ec3..3ce8a02 100644 --- a/src/frontend/app/components/Stops/ConsolidatedCirculationList.css +++ b/src/frontend/app/components/Stops/ConsolidatedCirculationList.css @@ -1,7 +1,6 @@ /* Consolidated Circulation List Styles */ .consolidated-circulation-container { width: 100%; - margin-block-start: 1.5rem; } .consolidated-circulation-caption { diff --git a/src/frontend/app/components/Stops/ConsolidatedCirculationList.tsx b/src/frontend/app/components/Stops/ConsolidatedCirculationList.tsx index 37f6a47..aae9b05 100644 --- a/src/frontend/app/components/Stops/ConsolidatedCirculationList.tsx +++ b/src/frontend/app/components/Stops/ConsolidatedCirculationList.tsx @@ -178,7 +178,7 @@ export const ConsolidatedCirculationList: React.FC<RegularTableProps> = ({ <div className="distance-info"> {estimate.schedule && ( <> - {parseServiceId(estimate.schedule.serviceId)} v{getTripIdDisplay(estimate.schedule.tripId)} {" "} + {parseServiceId(estimate.schedule.serviceId)} ({getTripIdDisplay(estimate.schedule.tripId)}) </> )} diff --git a/src/frontend/app/routes/estimates-$id.tsx b/src/frontend/app/routes/estimates-$id.tsx index 84d25c1..4efa797 100644 --- a/src/frontend/app/routes/estimates-$id.tsx +++ b/src/frontend/app/routes/estimates-$id.tsx @@ -1,27 +1,27 @@ -import { type JSX, useEffect, useState, useCallback } from "react"; -import { useParams, Link, Navigate } from "react-router"; -import StopDataProvider, { type Stop } from "../data/StopDataProvider"; -import { Star, Edit2, ExternalLink, RefreshCw } from "lucide-react"; -import "./estimates-$id.css"; -import { RegularTable } from "../components/RegularTable"; -import { useApp } from "../AppContext"; -import { GroupedTable } from "../components/GroupedTable"; +import { Edit2, ExternalLink, RefreshCw, Star } from "lucide-react"; +import { useCallback, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; +import { Link, Navigate, useParams } from "react-router"; +import { ErrorDisplay } from "~/components/ErrorDisplay"; +import LineIcon from "~/components/LineIcon"; +import { PullToRefresh } from "~/components/PullToRefresh"; import { - SchedulesTable, type ScheduledTable, + SchedulesTable, } from "~/components/SchedulesTable"; import { - SchedulesTableSkeleton, EstimatesGroupedSkeleton, + SchedulesTableSkeleton, } from "~/components/SchedulesTableSkeleton"; +import { StopAlert } from "~/components/StopAlert"; import { TimetableSkeleton } from "~/components/TimetableSkeleton"; -import { ErrorDisplay } from "~/components/ErrorDisplay"; -import { PullToRefresh } from "~/components/PullToRefresh"; -import { useAutoRefresh } from "~/hooks/useAutoRefresh"; import { type RegionId, getRegionConfig } from "~/data/RegionConfig"; -import { StopAlert } from "~/components/StopAlert"; -import LineIcon from "~/components/LineIcon"; +import { useAutoRefresh } from "~/hooks/useAutoRefresh"; +import { useApp } from "../AppContext"; +import { GroupedTable } from "../components/GroupedTable"; +import { RegularTable } from "../components/RegularTable"; +import StopDataProvider, { type Stop } from "../data/StopDataProvider"; +import "./estimates-$id.css"; export interface Estimate { line: string; diff --git a/src/frontend/app/routes/stops-$id.css b/src/frontend/app/routes/stops-$id.css new file mode 100644 index 0000000..b39cb0f --- /dev/null +++ b/src/frontend/app/routes/stops-$id.css @@ -0,0 +1,319 @@ +.estimates-content-wrapper { + display: flex; + flex-direction: column; + gap: 1rem; + min-height: 0; + flex: 1; +} + +.estimates-list-container { + overflow-y: auto; + flex: 1; + min-height: 0; + border-radius: 0.5rem; +} + +.table-responsive { + overflow-x: auto; +} + +.table { + width: 100%; + border-collapse: collapse; +} + +.table caption { + margin-bottom: 0.5rem; + font-weight: 500; +} + +.table th, +.table td { + padding: 0.75rem; + text-align: left; + border-bottom: 1px solid #eee; +} + +.table th { + border-bottom: 2px solid #ddd; +} + +.table tfoot td { + text-align: center; +} + +/* Estimates page specific styles */ +.estimates-page { + display: flex; + align-items: center; + height: 100%; + overflow: hidden; +} + +.estimates-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 1rem; + gap: 1rem; + flex-shrink: 0; +} + +.manual-refresh-button { + display: flex; + align-items: center; + gap: 0.5rem; + padding: 0.5rem 0.75rem; + background: var(--primary-color); + border: none; + border-radius: 0.375rem; + font-size: 0.875rem; + font-weight: 500; + cursor: pointer; + transition: all 0.2s ease; + min-width: max-content; +} + +.manual-refresh-button:hover:not(:disabled) { + background: var(--primary-color-hover); + transform: translateY(-1px); +} + +.manual-refresh-button:disabled { + opacity: 0.6; + cursor: not-allowed; + transform: none; +} + +.refresh-icon { + width: 1.5rem; + height: 1.5rem; + transition: transform 0.2s ease; +} + +.refresh-icon.spinning { + animation: spin 1s linear infinite; +} + +@keyframes spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} + +@media (max-width: 640px) { + .estimates-header { + flex-direction: column; + align-items: flex-start; + gap: 0.75rem; + } + + .manual-refresh-button { + padding: 0.4rem 0.6rem; + font-size: 0.8rem; + } +} + +.estimates-stop-id { + font-size: 1rem; + color: var(--subtitle-color); + margin-left: 0.5rem; +} + +.estimates-arrival { + color: #28a745; + font-weight: 500; +} + +.estimates-delayed { + color: #dc3545; +} + +.button-group { + display: flex; + gap: 1rem; + margin-bottom: 1.5rem; + flex-wrap: wrap; +} + +.button { + padding: 0.75rem 1rem; + background-color: var(--button-background-color); + color: white; + border: none; + border-radius: 8px; + font-size: 1rem; + font-weight: 500; + cursor: pointer; + text-align: center; + text-decoration: none; + display: inline-block; +} + +.button:hover { + background-color: var(--button-hover-background-color); +} + +.button:disabled { + background-color: var(--button-disabled-background-color); + cursor: not-allowed; +} + +.star-icon { + margin-right: 0.5rem; + color: #ccc; + fill: none; +} + +.star-icon.active { + color: var(--star-color); + /* Yellow color for active star */ + fill: var(--star-color); +} + +/* Pencil (edit) icon next to header */ +.edit-icon { + margin-right: 0.5rem; + color: #ccc; + cursor: pointer; + stroke-width: 2px; +} + +.edit-icon:hover { + color: var(--star-color); +} + +/* Timetable section styles */ +.timetable-section { + padding-bottom: 3rem; +} + +/* Timetable cards should be single column */ +.timetable-section .timetable-cards { + display: flex; + flex-direction: column; + gap: 0.75rem; +} + +.timetable-section .timetable-card { + padding: 0.875rem; +} + +.timetable-actions { + margin-top: 1.5rem; + text-align: center; +} + +.view-all-link { + display: inline-flex; + align-items: center; + gap: 0.5rem; + color: var(--link-color, #007bff); + text-decoration: none; + font-weight: 500; + padding: 0.5rem 1rem; + border: 1px solid var(--link-color, #007bff); + border-radius: 6px; + transition: all 0.2s ease; +} + +.view-all-link:hover { + background-color: var(--link-color, #007bff); + color: white; + text-decoration: none; +} + +.external-icon { + width: 1rem; + height: 1rem; +} + +.estimates-lines-container { + display: flex; + gap: 0.5rem; + flex-wrap: wrap; + margin-bottom: 1rem; + flex-shrink: 0; +} + +.estimates-lines-container.scrollable { + flex-wrap: nowrap; + overflow-x: auto; + max-height: calc(2 * (var(--line-icon-height, 2rem) + 0.5rem)); + align-content: flex-start; + scrollbar-width: thin; +} + +.estimates-lines-container.scrollable::-webkit-scrollbar { + height: 6px; +} + +.estimates-lines-container.scrollable::-webkit-scrollbar-thumb { + background-color: var(--border-color); + border-radius: 3px; +} + +.estimates-line-icon { + flex-shrink: 0; +} + +.experimental-notice { + background-color: #fff3cd; + border: 1px solid #ffc107; + border-radius: 8px; + padding: 1rem; + margin-bottom: 1rem; + color: #856404; + flex-shrink: 0; +} + +.experimental-notice strong { + display: block; + margin-bottom: 0.5rem; + color: #856404; +} + +.experimental-notice p { + margin: 0; + font-size: 0.9rem; + line-height: 1.4; +} + +[data-theme="dark"] .experimental-notice { + background-color: #3d3100; + border-color: #ffc107; + color: #ffd966; +} + +[data-theme="dark"] .experimental-notice strong { + color: #ffd966; +} + +.refresh-status { + display: flex; + align-items: center; + gap: 0.5rem; + justify-content: center; + padding: 0.75rem 1rem; + margin-bottom: 1rem; + background-color: rgba(0, 123, 255, 0.1); + border: 1px solid rgba(0, 123, 255, 0.2); + border-radius: 8px; + color: var(--primary-color); + font-size: 0.9rem; + font-weight: 500; + flex-shrink: 0; +} + +.refresh-status .refresh-icon { + width: 1rem; + height: 1rem; +} + +[data-theme="dark"] .refresh-status { + background-color: rgba(0, 123, 255, 0.15); + border-color: rgba(0, 123, 255, 0.3); +} diff --git a/src/frontend/app/routes/stops-$id.tsx b/src/frontend/app/routes/stops-$id.tsx index efe2867..d1184aa 100644 --- a/src/frontend/app/routes/stops-$id.tsx +++ b/src/frontend/app/routes/stops-$id.tsx @@ -13,7 +13,7 @@ import { type RegionId, getRegionConfig } from "~/data/RegionConfig"; import { useAutoRefresh } from "~/hooks/useAutoRefresh"; import { useApp } from "../AppContext"; import StopDataProvider, { type Stop } from "../data/StopDataProvider"; -import "./estimates-$id.css"; +import "./stops-$id.css"; export interface ConsolidatedCirculation { line: string; @@ -242,7 +242,7 @@ export default function Estimates() { </div> {stopData && stopData.lines && stopData.lines.length > 0 && ( - <div className={`estimates-lines-container`}> + <div className={`estimates-lines-container scrollable`}> {stopData.lines.map((line) => ( <div key={line} className="estimates-line-icon"> <LineIcon line={line} region={region} rounded /> |
