﻿:root {
    --loading-bg-color: rgba(0,0,0,.8);
    --loading-bar-color: white;
    --loading-bar-bg-color: transparent;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    padding: 0;
    margin: 0;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--loading-bg-color);
    z-index: 5;
    backdrop-filter: blur(3em);
    flex-direction: row;
    flex-wrap: wrap;
}

.slider {
    position: relative;
    width: 100%;
    height: 5px;
    overflow-x: hidden;
}

.line {
    position: absolute;
    opacity: 0.4;
    background: var(--loading-bar-bg-color);
    width: 150%;
    height: 3px;
}

.subline {
    position: absolute;
    background: var(--loading-bar-color);
    height: 3px;
    border-radius: 2px;
}

.inc {
    animation: increase 2s infinite;
}

.dec {
    animation: decrease 2s 0.5s infinite;
}

@keyframes increase {
    from {
        left: -5%;
        width: 5%;
    }

    to {
        left: 130%;
        width: 100%;
    }
}

@keyframes decrease {
    from {
        left: -80%;
        width: 80%;
    }

    to {
        left: 110%;
        width: 10%;
    }
}

/*
    HTML CODE FOR LOADING

<div id="loading" class="loading">
    <div>
        <div>
            <h2 class="text-center" style="color:white">Loading Data...</h2>
        </div>
        <div class="slider">
            <div class="line"></div>
            <div class="subline inc"></div>
            <div class="subline dec"></div>
        </div>
    </div>
</div>

*/
