Sat Jul 02 2022

Loading Bar Animation

CSS5430 views

File Name: loading-bar-animation.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Loading Bar Animation</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            background-color: #383838;
        }

        section {
            width: 100%;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        div.loader {
            width: 120px;
            height: 100px;
            display: flex;
            justify-content: space-between;
        }

        div.loader span {
            width: 15px;
            height: 100%;
            background-color: #fff;
            animation: loading 1.5s infinite ease-in-out;
        }

        div.loader span:nth-child(1) {
            animation-delay: 0s;
        }

        div.loader span:nth-child(2) {
            animation-delay: 0.3s;
        }

        div.loader span:nth-child(3) {
            animation-delay: 0.6s;
        }

        div.loader span:nth-child(4) {
            animation-delay: 0.9s;
        }

        @keyframes loading {
            0%, 100% {
                transform: scaleY(100%);
            }

            50% {
                transform: scaleY(60%);
                background-color: #ff6600;
            }
        }
    </style>
</head>
<body>
    <section>
        <div class="loader">
            <span></span>
            <span></span>
            <span></span>
            <span></span>
        </div>
    </section>
</body>
</html>

Result Screenshot(s)

Loading Bar AnimationWorking Sample0

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.