Pre-Loader Animation: HTML CSS @rayen-code

Pre-Loader Animation: HTML CSS



HTML Code

<!-- -------------------- HTML -------------------- -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>modern X-loader</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>

    <div class="container">
        <svg viewbox="-10 -10 50 50 ">
            <polygon points="32,0 0,32 32,32 0,0">

            </polygon>
        </svg>
    </div>
    
</body>
</html>

CSS Code

/*-------------------- CSS --------------------*/
/* style  */

body{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: rgb(17, 36, 56);
}

svg{
    height: 100px;
}

polygon{
    fill: transparent;
    stroke: aquamarine;
    stroke-width: 2px;
    stroke-dasharray: 14;
    animation: anime 2s ease-out infinite;
}

@keyframes anime {
    to{
        stroke-dashoffset: -112;
    }
}

0 Comments