<script>
/**
 * vs-panel 2022-09-20
 */
</script>
<script setup>
const props = defineProps({
    text: {
        type: String,
        default: 'LOADING...',
    },
});

</script>
                
<template>
    <div class="vs-loading">
        <div class="box">
            <div class="vs-loading--text"><span>{{props.text}}</span></div>
        </div>
        <div class="vs-loading--mask"></div>
    </div>
</template>
                
<style  lang="scss" scoped>
$main: var(--main);
$auxiliary: var(--auxiliary);
$light: var(--light);

.vs-loading {

    .vs-loading--text  {
        position: absolute;
        width: 150px;
        height: 25px;

        top: 45%;
        top: -webkit-calc(50% - 10px);
        top: calc(50% - 10px);
        left: 25%;
        left: -webkit-calc(50% - 75px);
        left: calc(50% - 75px);
        z-index: 999
    }

    span {
        position: relative;
        z-index: 2;
        line-height: 25px;
        margin-left: 10px;
        color: #fff;
        letter-spacing: 2px;
    }

    .vs-loading--text:after {
        content: "";
        color: #fff;
        font-family: Lato, "Helvetica Neue";
        font-weight: 200;
        font-size: 16px;
        position: absolute;
        width: 100%;
        height: 25px;
        left: 0;
        top: 0;
        background-color: $main;
        z-index: 1;
    }

    .vs-loading--text:before {
        content: "";
        position: absolute;
        background-color: #fff;
        top: -5px;
        left: 0px;
        height: 35px;
        width: 0px;
        z-index: 0;
        opacity: 1;
        -webkit-transform-origin: 100% 0%;
        transform-origin: 100% 0%;
        -webkit-animation: loader3 10s ease-in-out infinite;
        animation: loader3 10s ease-in-out infinite;
    }



    @-webkit-keyframes loader3 {
        0% {
            width: 0px;
        }

        70% {
            width: 100%;
            opacity: 1;
        }

        90% {
            opacity: 0;
            width: 100%;
        }

        100% {
            opacity: 0;
            width: 0px;
        }
    }

    @keyframes loader3 {
        0% {
            width: 0px;
        }

        70% {
            width: 100%;
            opacity: 1;
        }

        90% {
            opacity: 0;
            width: 100%;
        }

        100% {
            opacity: 0;
            width: 0px;
        }
    }

    .vs-loading--mask {
        position: fixed;
        left: 0px;
        top: 0px;
        right: 0px;
        bottom: 0px;
        background: rgba(0, 0, 0, .6);
        z-index: 998;
    }
}
</style>
                