Pretty CSS loader for webpages.

HTML Code



    <div class="fa-spinner">
        <div class="fa-spin"></div>
        <div class="fa-spin-in"></div>
        <span class="fa-text">WAIT</span>
    </div>


CSS Code



    body {
    padding: 0;
    margin: 0;
}

.fa-spinner {
    padding: 0;
    margin: 0;
    background: #000;
    widows: 100vh;
    height: 100vh;
}

.fa-spin {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    width: 200px;
    height: 200px;
    border: 2px solid #fff;
    animation: spinner 5s cubic-bezier(.68, -0.55, .27, 1.55) infinite;
}

.fa-spin-in {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    width: 100px;
    height: 100px;
    border: 2px solid #fff;
    animation: spinner2 5s cubic-bezier(.68, -0.55, .27, 1.55) infinite;
}

.fa-text {
    color: white;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    width: 200px;
    height: 25px;
    text-align: center;
    font-family: sans-serif;
    animation: text-spin 5s cubic-bezier(.68, -0.55, .27, 1.55) infinite;
    font-size: 25px;

}

@keyframes spinner {
    0% {
        border-radius: 50%;
        width: 200px;
        height: 200px;
        border-color: #fff;
        border-width: 5px;

    }

    50% {
        border-radius: 50%;
        width: 100px;
        height: 100px;
        border-width: 1px;
        border-color: red;

    }

    100% {
        border-radius: 50%;
        width: 200px;
        height: 200px;
        border-color: #fff;
        border-width: 5px;
    }
}

@keyframes spinner2 {
    0% {
        border-radius: 50%;
        width: 100px;
        height: 100px;
    }

    50% {
        border-radius: 50%;
        width: 200px;
        height: 200px;
        border-color: red;
        border-width: 5px;

    }

    100% {
        border-radius: 50%;
        width: 100px;
        height: 100px;
    }
}

@keyframes text-spin {
    0% {
        color: red;
    }

    50% {
        color: #fff;
    }

    100% {
        color: red;
    }
}

If you want to know how to integrate this loader with JavaScript. Visit this link
Your Suggestion is valuable for us please write down in comment box.

Post a Comment

Previous Post Next Post