commit d6dc450fa649aab5540994c64a9b54c8b8598f4d
parent 73817e3f8294836fed3eeb84c1ff63ad5e36f235
Author: Katja (ctucx) <git@ctu.cx>
Date: Sun, 20 Apr 2025 13:07:56 +0200
parent 73817e3f8294836fed3eeb84c1ff63ad5e36f235
Author: Katja (ctucx) <git@ctu.cx>
Date: Sun, 20 Apr 2025 13:07:56 +0200
tripView: move `bahn.expert` link to header
4 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/src/styles/departuresView.css b/src/styles/departuresView.css @@ -2,13 +2,12 @@ justify-content: unset !important; } +.icon-bahnexpert { + float: right; +} + @media (min-width: 800px) { .table { 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/icons.css b/src/styles/icons.css @@ -13,3 +13,7 @@ .icon-dots { content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path d="M12 16a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2 2 2 0 0 1 2-2m0-6a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2 2 2 0 0 1 2-2m0-6a2 2 0 0 1 2 2 2 2 0 0 1-2 2 2 2 0 0 1-2-2 2 2 0 0 1 2-2" fill="white"/></svg>'); } + +.icon-bahnexpert { + 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/journeyView.css b/src/styles/journeyView.css @@ -55,6 +55,10 @@ a[class^="icon-"] { margin: 0 .3em; } +.icon-bahnexpert { + float: right; +} + @media (max-width: 650px) { .station { justify-content: unset !important;
diff --git a/src/tripView.js b/src/tripView.js @@ -110,7 +110,13 @@ class TripView extends BaseView { ${when( !this.viewState, () => html`<h3>Trip of ...</h3>`, - () => html`<h3>Trip of ${formatLineDisplayName(this.viewState.trip.line)} to ${this.viewState.trip.direction}</h3>` + () => [ + when( + this.viewState.trip.bahnExpertUrl, + () => html`<a class="icon-bahnexpert" href="${this.viewState.trip.bahnExpertUrl}"></a>` + ), + html`<h3>Trip of ${formatLineDisplayName(this.viewState.trip.line)} to ${this.viewState.trip.direction}</h3>` + ] )} </div> <a class="icon-reload ${classMap({ spinning: this.isUpdating, invisible: this.isOffline })}" title=${t("refresh")} @click=${this.updateViewState}></a> @@ -129,13 +135,11 @@ class TripView extends BaseView { <div class="container"> <div class="card"> <div class="train-info flex-center nowrap"> - <a href=${ifDefined(this.viewState.trip.bahnExpertUrl)}> ${formatLineDisplayName(this.viewState.trip.line)} ${when( this.viewState.trip.direction, () => html` → ${this.viewState.trip.direction}` )} - </a> ${when( this.viewState.trip.remarks.length !== 0,