diff --git a/src/lib/ldb/staff-ldb.svelte b/src/lib/ldb/staff-ldb.svelte index d622704..ccc3354 100644 --- a/src/lib/ldb/staff-ldb.svelte +++ b/src/lib/ldb/staff-ldb.svelte @@ -53,43 +53,8 @@ } } - function parseTime(string = ""){ - let output - let change - switch (string) { - case 'Delayed': - output = 'LATE' - change = "changed" - break - case 'Cancelled': - output = 'CANC' - change = "cancelled" - break - case 'On time': - output = 'RT' - change = "" - break - case '': - output = '-' - change = "" - break - case undefined: - output = '-' - change = "" - break - case 'No report': - output = '-' - change = "" - break - case 'undefined': - output = false - change = "" - break - default: - output = string - change = "changed" - } - return {data: output, changed: change} + function parseTime(sch, act){ + return } function parseDateTime(input) { @@ -129,9 +94,13 @@ {service.destination.location.tiploc} {service.platform || '-'} {parseDateTime(service.sta)} - {'-'} + {parseDateTime(service.ata || service.eta)} {parseDateTime(service.std)} - {'-'} + {#if service.isCancelled} + CAN + {:else} + {parseDateTime(service.atd || service.etd)} + {/if} @@ -175,4 +144,34 @@ text-align: left; color: cyan; } + +.can-time { + animation: pulse-cancel 1.5s linear infinite; +} + +.early-time { + animation: pulse-early 1.5s linear infinite; +} + +.late-time { + animation: pulse-late 1.5s linear infinite; +} + +@keyframes pulse-late { + 50% { + color: var(--main-warning-color); + } +} + +@keyframes pulse-cancel { + 50% { + color: var(--main-alert-color); + } +} + +@keyframes pulse-early { + 50% { + color: rgb(136, 164, 255); + } +} \ No newline at end of file