{/* 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",
+ },
+ },
+ },
+ ],
+ },
+];
--
2.51.2
From 472f3272af3c099df6a2404f55435f0e2e5ca2e7 Mon Sep 17 00:00:00 2001
From: Claas
Date: Fri, 21 Jun 2024 19:15:02 +0200
Subject: [PATCH 03/11] Add second connection
---
README.md | 33 +------------
src/routes/journey.tsx | 102 ++++++++++++++++++++++++++---------------
2 files changed, 67 insertions(+), 68 deletions(-)
diff --git a/README.md b/README.md
index a84af39..6f6995f 100644
--- a/README.md
+++ b/README.md
@@ -1,32 +1,3 @@
-# SolidStart
+# Alternative Name Ideas
-Everything you need to build a Solid project, powered by [`solid-start`](https://start.solidjs.com);
-
-## Creating a project
-
-```bash
-# create a new project in the current directory
-npm init solid@latest
-
-# create a new project in my-app
-npm init solid@latest my-app
-```
-
-## Developing
-
-Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
-
-```bash
-npm run dev
-
-# or start the server and open the app in a new browser tab
-npm run dev -- --open
-```
-
-## Building
-
-Solid apps are built with _presets_, which optimise your project for deployment to different environments.
-
-By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different preset, add it to the `devDependencies` in `package.json` and specify in your `app.config.js`.
-
-## This project was created with the [Solid CLI](https://solid-cli.netlify.app)
+- Destation/Destiation/Destiate/Destia/Destistation (Destination + Station)
diff --git a/src/routes/journey.tsx b/src/routes/journey.tsx
index e0bf2d5..1727c7e 100644
--- a/src/routes/journey.tsx
+++ b/src/routes/journey.tsx
@@ -1,4 +1,4 @@
-import { For, Show, createSignal, type JSX } from "solid-js";
+import { For, Match, Show, Switch, createSignal, type JSX } from "solid-js";
/**
* A recursive component building the tree of connections
@@ -27,29 +27,30 @@ function Connection({
);
}
-/** Change between two connections */
-type Change = {
- /** Time to change */
- time: string;
- connection: Connection2;
-};
-
type Connection2 = {
+ /** Start and at the same time destination of the parent connection before this if this is not the first connection */
+ start: string;
line: string;
headsign: string;
- destination: string;
+ /** Only set if this is the last connection/leaf in the connection tree. If this is the last connection, then changes should not exist */
+ destination?: string;
time: {
+ /** Time to change from the connection before this (parent connection). Optional because this could be the first connection */
change?: string;
arrive: string;
depart: string;
duration: string;
};
- changes?: Change[];
+ /** Optional because this could be the last connection and destination is set. */
+ changes?: Connection2[];
};
function Connection3(connection: Connection2): JSX.Element {
return (
Date: Fri, 21 Jun 2024 21:00:29 +0200
Subject: [PATCH 05/11] Add more connection data
---
src/routes/journey.tsx | 414 +++++++++++++++++++++++++++++++++++------
1 file changed, 361 insertions(+), 53 deletions(-)
diff --git a/src/routes/journey.tsx b/src/routes/journey.tsx
index ac159f9..0271aa9 100644
--- a/src/routes/journey.tsx
+++ b/src/routes/journey.tsx
@@ -27,27 +27,13 @@ function Connection({
);
}
-type Connection2 = {
- /** Start and at the same time destination of the parent connection before this if this is not the first connection */
- start: string;
- line: string;
- headsign: string;
- /** Only set if this is the last connection/leaf in the connection tree. If this is the last connection, then changes should not exist */
- destination?: string;
- time: {
- /** Time to change from the connection before this (parent connection). Optional because this could be the first connection */
- change?: string;
- arrive: string;
- depart: string;
- duration: string;
- };
-
- /** Optional because this could be the last connection and destination is set. */
- changes?: Connection2[];
-};
-function Connection3(connection: Connection2): JSX.Element {
+function TransportConnection({
+ connection,
+}: {
+ connection: Transport;
+}): JSX.Element {
return (
-