Loader



Loader (css only)




 <!DOCTYPE html>
<html lang="fr">
<head>
    <title>Loader</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
</head>
<body>
    <div class="loader"></div>
    <h2>Loader</h2>
    <div class="container">
    </div>        
</body>
</html>                    
                  
                



        html, body {
            margin: 0;
            padding: 0;
            color: white;
            background-color: black;
        }

        h2 {
            padding-top: 30px;
            text-align: center;
        }

        .loader {
            border: 0 solid transparent;
            border-radius: 50%;
            width: 150px;
            height: 150px;
            position: absolute;
            top: calc(50vh - 75px);
            left: calc(50vw - 75px);
        }

        .loader::before, .loader::after {
            content: '';
            border: 1em solid red; 
            border-radius: 50%;
            width: inherit;
            height: inherit;
            position: absolute;
            top: 0;
            left: 0;
            animation: loader 2s linear infinite;
            opacity: 0;
        }

        .loader::before {
            animation-delay: .5s;
            border: 1em solid rgb(255, 0, 170);
        }

        @keyframes loader {
            0% {
                transform: scale(0);
                opacity: 0;
            }
            50% {
                opacity: 1;
            }

            100% {
                transform: scale(1);
                opacity: 0;
            }
        }

        .container {
            padding: 70px;
        }