Tue Aug 09 2022

Bouncing Ball Loader

CSS4690 views


Bouncing Ball Loader

File Name: bouncing-ball-loader.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>Bouncing Ball Loader</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body { background-color: #292929; }

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

        div.loader {
            width: 120px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        div.loader .dot {
            width: 25px;
            height: 25px;
            background-color: #f5dc00;
            border-radius: 100%;
            margin: 0 3px;
            animation: loading 1s linear infinite;
            animation-delay: calc(0.1s * var(--i));
        }

        @keyframes loading {
            0% {
                transform: translateY(-20px);
            }

            25%, 75% {
                transform: translateY(0);
            }

            100% {
                transform: translateY(-20px);
            }
        }
    </style>
</head>
<body>
    <section>
        <div class="loader">
            <span class="dot" style="--i:3"></span>
            <span class="dot" style="--i:2"></span>
            <span class="dot" style="--i:1"></span>
            <span class="dot" style="--i:0"></span>
        </div>
    </section>
</body>
</html>

Result Screenshot(s)

Bouncing Ball LoaderWorking 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.