Merge pull request 'Symbols for valid/invalid scans feature/11-valid_icons' (#12) from feature/11-valid_icons into dev

Reviewed-on: #12
This commit is contained in:
Nicolai Ort 2021-04-06 19:01:07 +00:00
commit 703168081c
3 changed files with 44 additions and 6 deletions

View File

@ -9,6 +9,7 @@
let lastscan_time = "";
let lastscan_laptime = "";
let lastscan_totaldistance = "";
let lastscan_valid = true;
let card = "";
// live clock at the top
let time = new Date();
@ -83,6 +84,7 @@
) +
"s";
lastscan_laptime = response.data.lapTime;
lastscan_valid = response.data.valid;
lastscan_totaldistance =
Math.floor(response.data.runner.distance / 1000) +
"km " +
@ -112,14 +114,44 @@
/>
</label>
{#if lastscan_totaldistance}
<h1 class="text-3xl font-bold text-center">last scan</h1>
<h1 class="text-5xl font-bold text-center">{lastscan_time}</h1>
<h1 class="text-3xl font-bold text-center">total distance</h1>
<h1 class="text-8xl font-bold text-center">
{#if !lastscan_valid || lastscan_error}
<svg
xmlns="http://www.w3.org/2000/svg"
width="20rem"
height="20rem"
class="ml-auto mr-auto"
version="1.0"
title="Invalid"
viewBox="0 0 100 100"
><g fill="none" stroke="red"
><path d="M6 6l88 88" stroke-width="18.1" /><path
d="M6 94L94 6"
stroke-width="17.8"
/></g
></svg
>
{:else}
<svg
xmlns="http://www.w3.org/2000/svg"
width="20rem"
height="20rem"
class="ml-auto mr-auto"
title="Valid"
viewBox="0 0 600 600"
><path
d="M8 405s115 129 138 182h99c41-126 203-429 341-535 28-37-43-52-102-27-87 36-252 317-283 384-44 12-90-74-90-74z"
fill="#181"
/></svg
>
{/if}
<h1 class="text-2xl font-bold text-center">{$_("total-distance")}</h1>
<h1 class="text-6xl font-bold text-center">
{lastscan_totaldistance}
</h1>
<h1 class="text-3xl font-bold text-center">lap time</h1>
<h1 class="text-8xl font-bold text-center">{lastscan_laptime}</h1>
<h1 class="text-2xl font-bold text-center">{$_("lap-time")}</h1>
<h1 class="text-6xl font-bold text-center">{lastscan_laptime}</h1>
<h1 class="text-2xl font-bold text-center">{$_("last-scan")}</h1>
<h1 class="text-5xl font-bold text-center">{lastscan_time}</h1>
{:else}
<h1 class="text-3xl font-bold text-center">
{$_("please_scan_a_card")}

View File

@ -7,6 +7,8 @@
"configure": "Konfigurieren",
"error": "Error!",
"language": "Sprache",
"lap-time": "Rundenzeit",
"last-scan": "Letzter Scan um",
"log_out_from_this_client": "Von diesem Scanner abmelden",
"minimum_lap_time": "minimale Rundenzeit",
"please_check_your_token_and_try_again": "Bitte überprüfe den Token und versuche es erneut...",
@ -22,6 +24,7 @@
"station_id": "Scanstations-ID",
"the_provided_scan_station_is_disabled": "Die angegebene Scanstation ist deaktiviert.",
"the_provided_scan_station_token_is_invalid": "Der angegebene Scanstation-Token ist ungültig.",
"total-distance": "Gesamtdistanz",
"track_distance": "Länge des Tracks",
"track_id": "Track ID",
"track_name": "Track Name"

View File

@ -7,6 +7,8 @@
"configure": "Configure",
"error": "Error!",
"language": "Language",
"lap-time": "lap time",
"last-scan": "last scan",
"log_out_from_this_client": "Log Out from this Client",
"minimum_lap_time": "minimum lap time",
"please_check_your_token_and_try_again": "Please check your token and try again...",
@ -22,6 +24,7 @@
"station_id": "Scanstation ID",
"the_provided_scan_station_is_disabled": "The provided scan station is disabled.",
"the_provided_scan_station_token_is_invalid": "The provided scan station token is invalid.",
"total-distance": "total distance",
"track_distance": "Track Distance",
"track_id": "Track ID",
"track_name": "Track Name"