From e1179a9718848eea44cb528b7764ad26461b9182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Schr=C3=B6tler?= <niklas@allround.digital> Date: Mon, 11 Dec 2023 19:48:54 +0100 Subject: [PATCH] PlanElement: Now animating up instead of right --- .../Fahrplan/components/PlanElement.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/panels/Fahrplan/components/PlanElement.tsx b/src/panels/Fahrplan/components/PlanElement.tsx index c938618..f67f414 100644 --- a/src/panels/Fahrplan/components/PlanElement.tsx +++ b/src/panels/Fahrplan/components/PlanElement.tsx @@ -43,16 +43,17 @@ const PlanElement = (props: { <motion.div className={"overflow-hidden"} initial={{ - opacity: 0, - translateX: "-100%" + opacity: 1, + translateY: "0%", + marginTop: "0rem" }} animate={shown ? { opacity: 1, - translateX: "0%", + translateY: "0%", marginTop: "0rem" } : { opacity: 0, - translateX: "100%", + translateY: "-100%", height: 0, marginTop: "-0.75rem" }} @@ -114,10 +115,14 @@ const trainIdentifierToColor = (identifier: string): string => { const deDortmund = (input: string): string => { // Don't remove the city from central station location - if (input.toLowerCase().includes("HBf")) { + if (input.includes("Hbf")) { return input; } - // In all other cases, remove dortmund - return input.replaceAll("Dortmund ", ""); + + return input + // In all other cases, remove dortmund + .replaceAll("Dortmund/Joseph Fraunhofer", "Joseph-von-Fraunhofer") + // Special case: Because the API is dumb, translate JvF to be consistent + .replaceAll("Dortmund ", ""); } -- GitLab