katja's git: oeffisearch

fast and simple tripplanner

commit bba529ff52160d5a8c7045f6814b5b823a7aa747
parent 32d28eeb59b57cfd7ca6cfc9a263d575871d104d
Author: Katja (ctucx) <git@ctu.cx>
Date: Sat, 19 Apr 2025 13:14:41 +0200

departuresView: add link to `bahn.expert`
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/departuresView.js b/src/departuresView.js
@@ -88,6 +88,9 @@ class DeparturesView extends BaseView {
 			<header>
 				<a class="icon-back ${history.length !== 1 ? '': 'invisible'}" title="${t('back')}" @click=${() => history.back()}></a>
 				<div class="container">
+					${this.viewState !== null ? html`
+					<a class="icon-bahnexpert" href="https://bahn.expert/${encodeURIComponent(this.viewState.name)}"></a>
+					` : nothing}
 					<h3>Departures from ${this.viewState !== null ? this.viewState.name : '...'}</h3>
 				</div>
 				<a class="icon-reload ${!this.isUpdating ? '' : 'spinning'} ${!this.isOffline ? '' : 'invisible'}" title="${t("reload")}" @click=${this.updateViewState}></a>
diff --git a/src/styles/departuresView.css b/src/styles/departuresView.css
@@ -3,3 +3,8 @@
 		margin: 50px auto;
 	}
 }
+
+.icon-bahnexpert {
+	float: right;
+	content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240.952 241.198" height="24" width="24"><path d="m156.283 14.31-76.155.03a6.102 6.102 0 0 0-.247 12.197c7.448.304 14.872 2.649 21.144 6.675 3.91 2.511 7.182 5.608 9.07 9.101.5.927.916 1.91 1.243 2.925-8.798.583-18.387 1.932-27.009 3.806-5.011 1.088-10.013 2.373-14.69 4.477-4.679 2.103-9.011 5.062-12.391 8.92s-5.735 8.575-6.962 13.555c-1.228 4.98-1.322 10.16-1.322 15.29v72.291c0 4.87.066 9.793 1.25 14.517s3.513 9.198 6.957 12.642 7.918 5.774 12.642 6.957c3.2.802 6.492 1.086 9.797 1.19l-21.18 31.596h16.19l8.39-12.515 75.786.067 8.284 12.355h16.189l-21.134-31.528c3.038-.124 6.059-.427 9.003-1.164 4.724-1.184 9.199-3.514 12.642-6.957 3.444-3.444 5.774-7.918 6.958-12.642 1.183-4.724 1.25-9.647 1.25-14.517V91.286c0-5.117-.096-10.285-1.328-15.25-1.232-4.967-3.594-9.668-6.98-13.504-3.385-3.837-7.72-6.77-12.393-8.853s-9.666-3.351-14.665-4.44c-9.599-2.092-18.512-3.595-28.316-4.119a20 20 0 0 1 1.782-3.754c1.785-2.919 4.444-5.549 7.575-7.78a39.47 39.47 0 0 1 19.172-7.098 6.1 6.1 0 0 0 5.522-6.351c-.148-3.25-2.82-5.797-6.074-5.826zm-29.096 12.215c-2.77 2.395-5.38 5.062-7.415 8.356-2.037-3.255-4.554-6.019-7.34-8.35zm-20.641 47.72q12.468 0 18.458 3.74 10.88-3.74 19.926-3.74 12.959 0 19.437 4.42 6.48 4.42 6.479 15.751v39.324h-22.249V99.403q0-4.42-2.567-6.346-2.566-2.04-7.579-2.04-2.2 0-3.912.566-1.71.567-2.078 1.247v40.91h-22.248V99.403q0-4.42-2.567-6.346-2.567-2.04-7.58-2.04-2.2 0-3.911.566-1.712.567-2.078 1.247v40.91H71.829V81.044q4.278-2.152 15.524-4.42 11.247-2.379 19.193-2.379M83.483 152.82c7.27 0 13.165 5.895 13.165 13.166 0 7.27-5.894 13.165-13.165 13.165s-13.166-5.894-13.166-13.165 5.895-13.166 13.166-13.166m74.655 0c7.272 0 13.166 5.895 13.166 13.166 0 7.27-5.895 13.165-13.166 13.165-7.27 0-13.165-5.894-13.165-13.165s5.894-13.166 13.165-13.166m-62.375 46.122H146l5.975 8.913-62.15-.054z" fill="white"/></svg>');
+}+
\ No newline at end of file
diff --git a/src/styles/header.css b/src/styles/header.css
@@ -28,7 +28,8 @@
 		.icon-back,
 		.icon-reload,
 		.icon-share,
-		.icon-dots {
+		.icon-dots,
+		.icon-bahnexpert {
 			cursor: pointer;
 			width: 32px;
 			height: 32px;