Add loading text
This commit is contained in:
parent
3ca35ce91d
commit
ebb0b5f0ba
6 changed files with 19 additions and 1 deletions
6
base.css
6
base.css
|
@ -36,6 +36,12 @@ body {
|
|||
display: none;
|
||||
}
|
||||
|
||||
#loading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
footer {
|
||||
margin-top: auto;
|
||||
display: flex;
|
||||
|
|
2
sw.js
2
sw.js
|
@ -1,4 +1,4 @@
|
|||
const VERSION = 'v8'
|
||||
const VERSION = 'v9'
|
||||
const API_ORIGIN = 'https://scraper.infotren.dcdev.ro/'
|
||||
const API_TRAINS = `${API_ORIGIN}v3/trains`
|
||||
const API_STATIONS = `${API_ORIGIN}v3/stations`
|
||||
|
|
|
@ -29,6 +29,10 @@
|
|||
<h3 id="tabs-dep">Departures</h3>
|
||||
</div>
|
||||
|
||||
<div id="loading" class="content">
|
||||
<p class="pri">Loading data...</p>
|
||||
</div>
|
||||
|
||||
<div id="arrivals" class="tab-view content">
|
||||
</div>
|
||||
|
||||
|
|
|
@ -14,6 +14,8 @@ function onStationData(data) {
|
|||
|
||||
document.getElementById('date').textContent = data.date
|
||||
|
||||
document.getElementById('loading').classList.add('hidden')
|
||||
|
||||
/**
|
||||
* @param {HTMLElement} elem
|
||||
* @param {any[]} trains
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
<p class="sec" id="date"></p>
|
||||
</div>
|
||||
|
||||
<div id="loading" class="content">
|
||||
<p class="pri">Loading data...</p>
|
||||
</div>
|
||||
|
||||
<div id="group-choice" class="content hidden">
|
||||
|
||||
</div>
|
||||
|
|
|
@ -22,6 +22,8 @@ function onTrainData(data) {
|
|||
document.getElementById('company').textContent = data.operator
|
||||
document.getElementById('date').textContent = data.date
|
||||
|
||||
document.getElementById('loading').classList.add('hidden')
|
||||
|
||||
var group = null;
|
||||
if (data.groups.length > 1 && groupIndex == null) {
|
||||
document.getElementById('group-choice').classList.remove('hidden')
|
||||
|
|
Loading…
Add table
Reference in a new issue