Improved www.ttss.krakow.pl
Jacek Kowalski
2016-12-13 0f9bcfeee6b47e6206b062d2affd0862209820f3
Use navbar for loading indication
3 files modified
26 ■■■■■ changed files
index.css 14 ●●●●● patch | view | raw | blame | history
index.html 6 ●●●●● patch | view | raw | blame | history
index.js 6 ●●●● patch | view | raw | blame | history
index.css
@@ -33,3 +33,17 @@
    font-weight: normal;
    font-size: inherit;
}
nav.loading {
    background-image: -webkit-linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.1) 50%,rgba(0,0,0,.1) 75%,transparent 75%,transparent);
    background-image: -o-linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.1) 50%,rgba(0,0,0,.1) 75%,transparent 75%,transparent);
    background-image: linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.1) 50%,rgba(0,0,0,.1) 75%,transparent 75%,transparent);
    -webkit-background-size: 40px 40px;
    background-size: 40px 40px;
    -webkit-animation: progress-bar-stripes 2s linear infinite;
    -o-animation: progress-bar-stripes 2s linear infinite;
    animation: progress-bar-stripes 2s linear infinite;
}
nav.loading * {
    color: black !important;
}
index.html
@@ -36,12 +36,6 @@
            </div>
        </nav>
        <div class="container-fluid">
            <div id="progress" class="progress" style="display: none;">
                <div id="progress-bar" class="progress-bar progress-bar-striped active" style="width: 100%">
                    <span id="progress-text" class="sr-only">Refreshing data...</span>
                </div>
            </div>
            <div id="alert" class="alert alert-danger alert-dismissible" style="display:none">
                <a href="#" class="close" id="alert-close" aria-label="close">&times;</a>
                <strong>Error occured!</strong> <span id="alert-text"></span>
index.js
@@ -30,7 +30,7 @@
var alert_text = document.getElementById('alert-text');
var alert_close = document.getElementById('alert-close');
var progress = document.getElementById('progress');
var nav = document.getElementsByTagName('nav')[0];
var parseStatusBoarding = '>>>';
function parseStatus(status) {
@@ -130,11 +130,11 @@
}
function loading_start() {
    progress.style.display = 'block';
    nav.className += ' loading';
}
function loading_end() {
    progress.style.display = 'none';
    nav.className = nav.className.replace(' loading', '');
}
function loadTimes(stopId = null, clearRoute = false) {