59 lines
1.8 KiB
Plaintext
59 lines
1.8 KiB
Plaintext
@page
|
|
@using System.Globalization
|
|
@using ZTravel.API.VRRF
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
<title>Departures - ZTravel</title>
|
|
<meta http-equiv="refresh" content="30">
|
|
<link rel="stylesheet" href="~/css/space.css"/>
|
|
</head>
|
|
<body>
|
|
<!--
|
|
<div class="navbar-fixed">
|
|
<nav style="color: #ffffff; background-color: #00838f;">
|
|
<div class="nav-wrapper container">
|
|
<span class="brand-logo">Salzburg Justizgebäude (+5)</span>
|
|
</div>
|
|
</nav>
|
|
</div>
|
|
-->
|
|
<div class="app appdark">
|
|
<ul>
|
|
@{
|
|
var counter = 0;
|
|
}
|
|
@foreach (var dep in VrrfApi.GetDepartures("vrrf.finalrewind.org", "efa.SVV", "salzburg", "justizgebäude").Raw) {
|
|
if (int.Parse(dep.Line) >= 20) {
|
|
continue;
|
|
}
|
|
counter++;
|
|
var rawtime = DateTime.ParseExact($"{dep.Date} {dep.Time}", "dd.MM.yyyy HH:mm", CultureInfo.InvariantCulture);
|
|
var countdownRaw = rawtime - DateTime.Now;
|
|
var countdown = Math.Round(countdownRaw.TotalMinutes);
|
|
var time = countdown <= 60 ? $"{countdown} min" : dep.Time;
|
|
if (countdown <= 0) {
|
|
time = "now";
|
|
}
|
|
if (countdown <= 5) {
|
|
continue;
|
|
}
|
|
<li>
|
|
@if (int.Parse(dep.Line) < 14) {
|
|
<div class="line obus">@dep.Line</div>
|
|
}
|
|
else {
|
|
<div class="line bus">@dep.Line</div>
|
|
}
|
|
<div class="dest">@dep.Destination</div>
|
|
<span class="countdown">
|
|
<span class="platform">@time</span>
|
|
</span>
|
|
</li>
|
|
}
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html> |