From 8d0a5bdbb54b63b731ac87728a0712cc029d0afe Mon Sep 17 00:00:00 2001 From: Claas Date: Fri, 21 Jun 2024 18:38:34 +0200 Subject: [PATCH] Add first connection --- src/routes/journey.tsx | 117 +++++++++++++++++++++++++++++++++++------ 1 file changed, 102 insertions(+), 15 deletions(-) diff --git a/src/routes/journey.tsx b/src/routes/journey.tsx index 74bed42..e0bf2d5 100644 --- a/src/routes/journey.tsx +++ b/src/routes/journey.tsx @@ -27,20 +27,79 @@ function Connection({ ); } -function Connection3() { +/** Change between two connections */ +type Change = { + /** Time to change */ + time: string; + connection: Connection2; +}; + +type Connection2 = { + line: string; + headsign: string; + destination: string; + time: { + change?: string; + arrive: string; + depart: string; + duration: string; + }; + + changes?: Change[]; +}; +function Connection3(connection: Connection2): JSX.Element { return ( -
-
content
- {/*
- content -
*/} +
+
+ +
+
+
+
+ +
+
+
+

+ to {connection.headsign} +

+ +
+
+
+
+
+ + + + {connection.line} +
+
+

{connection.destination}

{/* flex-none: diasable elements shrinking to fit the flex container */} -
+
Start
{/* overscroll-x-contain: we need to be able to scroll on the y-axis */}
- {(_, index) => } + {Connection3}
@@ -370,3 +429,31 @@ const connections: Connection[] = [ ], }, ]; + +const connections2: Connection2[] = [ + { + line: "STR 62", + headsign: "Dottendorf Quirinusplatz, Bonn", + time: { + arrive: "16:07", + depart: "15:58", + duration: "9min", + }, + destination: "Hauptbahnhof, Bonn", + changes: [ + { + time: "5min", + connection: { + line: "STR 16", + headsign: "Niehl Sebastianstr., Köln", + destination: "Neumarkt, Köln", + time: { + arrive: "17:05", + depart: "16:12", + duration: "53min", + }, + }, + }, + ], + }, +]; -- knotmirror 0.0.1