mirror of
https://github.com/cjdenio/uta-trax-api.git
synced 2026-10-03 16:06:19 +00:00
banner when no vehicles
This commit is contained in:
2 files changed
+41
-9
No files matched your search
+35
-9
@@ -1,6 +1,6 @@
|
|||||||
<!-- i SWEAR i write good code sometimes -->
|
<!-- i SWEAR i write good code sometimes -->
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
@@ -49,12 +49,38 @@
|
|||||||
margin-left: -7px;
|
margin-left: -7px;
|
||||||
margin-top: -7px;
|
margin-top: -7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#banner {
|
||||||
|
grid-column-start: 1;
|
||||||
|
grid-column-end: 3;
|
||||||
|
background-color: #ef4444;
|
||||||
|
color: white;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#banner.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div style="display: flex">
|
<div
|
||||||
<div id="map" style="height: 100vh; flex-grow: 1"></div>
|
style="
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: auto 300px;
|
||||||
|
grid-template-rows: 40px 1fr;
|
||||||
|
height: 100vh;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<div id="banner" class="hidden">
|
||||||
|
There are currently no vehicles running. Either service has ended for
|
||||||
|
the day, or UTA's tracker isn't working. Come back later!
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="map"></div>
|
||||||
<div id="sidebar">
|
<div id="sidebar">
|
||||||
<h1>Every Transit Vehicle in Salt Lake City*</h1>
|
<h1>Every Transit Vehicle in Salt Lake City*</h1>
|
||||||
<small>*or at least most of them</small>
|
<small>*or at least most of them</small>
|
||||||
@@ -110,23 +136,23 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr />
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p>There are...</p>
|
<p>There are...</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><strong id="count-bus">-</strong> bus(es)</li>
|
<li><strong id="count-bus">-</strong> bus(es)</li>
|
||||||
<li><strong id="count-trax">-</strong> TRAX train(s)</li>
|
<li><strong id="count-trax">-</strong> TRAX train(s)</li>
|
||||||
<li><strong id="count-frontrunner">-</strong> FrontRunner train(s)</li>
|
<li>
|
||||||
|
<strong id="count-frontrunner">-</strong> FrontRunner train(s)
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>...out and about</p>
|
<p>...out and about</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr />
|
||||||
|
|
||||||
<div>
|
<div>last updated: <span id="last-updated">-</span></div>
|
||||||
last updated: <span id="last-updated">-</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,12 @@ protobuf.load("/schema.proto").then((root) => {
|
|||||||
displayLastUpdated()
|
displayLastUpdated()
|
||||||
|
|
||||||
populateTotals(vehicles)
|
populateTotals(vehicles)
|
||||||
|
if (vehicles.length == 0) {
|
||||||
|
document.getElementById("banner").classList.remove("hidden")
|
||||||
|
map.invalidateSize()
|
||||||
|
} else {
|
||||||
|
document.getElementById("banner").classList.add("hidden")
|
||||||
|
}
|
||||||
|
|
||||||
// render vehicles on map
|
// render vehicles on map
|
||||||
clearMap();
|
clearMap();
|
||||||
|
|||||||
Reference in new issue
Block a user