CSS Animation Effects | Html CSS Only

 CSS Animation Effects | Html CSS Only




Hello Friends In this Blog ,We create Css Animation Using Html and Css

Source Code:

HTML file Code:

<!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">
    <link rel="stylesheet" href="/style.css">
    <title>CSS Effects</title>
</head>
<body>
    <div class="container">
        <div class="box" style="--i:1;"></div>
        <div class="box" style="--i:3;"></div>
        <div class="box" style="--i:2;"></div>
        <div class="box" style="--i:4;"></div>
    </div>
</body>
</html>

Css File Code:

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #000;
}
.container{
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    -webkit-box-reflect: below 2px linear-gradient(transparent, #0005);
}
.container .box{
    position: relative;
    width: 200px;
    height: 200Px;
    background: linear-gradient(45deg, #f3eb00 10%, transparent 10%,
    transparent 50%, #f3eb00 50%, #f3eb00 60%, transparent 60%,
    transparent 100%);
    background-size: 40px 40px;
    transform: rotate(calc(var(--i) * 90deg));
    filter: hue-rotate(calc(var(--i) * 90deg));
    animation:  animate 0.5s linear infinite;
}
@keyframes animate{
    0%{
        background-position: 0;
    }
    100%{
        background-position: 40px;
    }

}

Post a Comment

Previous Post Next Post