Fri Jun 03 2022

Custom Progress Bar

CSS5622 views

Custom Progress Bar

File Name: custom-progress-bar.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>Progress Bar</title>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Tajawal:wght@300&display=swap" rel="stylesheet"> 
    <style>
        * {
            margin: 0;
            padding: 0;
            font-family: 'Tajawal', sans-serif;
        }

        body {
            background-color: #383838;
        }

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

        h2 {
            color: #00ff0d;
            font-size: 40px;
            font-weight: 300;
            margin-bottom: 10px;
            text-shadow: 0 0 10px #00ff0d;
            animation: glow 5s ease forwards;
        }

        div.progressBar {
            width: 350px;
            height: 2px;
            background-color: #fff;
            position: relative;
        }

        div.progressBar span {
            position: absolute;
            width: 100%;
            top: 0;
            left: 0;
            bottom: 0;
            background-color: #00ff0d;
            filter: drop-shadow(0 0 10px #00ff0d);
            animation: loading 5s ease forwards;
        }

        @keyframes loading {
            0% {
                width: 0%;
            }

            20% {
                width: 50%;
            }

            80% {
                width: 90%;
            }

            100% {
                width: 100%;
            }
        }

        @keyframes glow {
            0%,95% {
                text-shadow: none;
            }

            100% {
                text-shadow: 0 0 10px #00ff0d;
            }
            
        }
    </style> 
</head>
<body>
    <section>
        <h2>Loading...</h2>
        <div class="progressBar">
            <span></span>
        </div>
    </section>
</body>
</html>

Result Screenshot(s)

Custom Progress BarWorking 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.