أخر الاخبار

css light anmation

file  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>Document</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="box">
        <span style="--i:0;"></span>
        <span style="--i:1;"></span>
        <span style="--i:2;"></span>
        <span style="--i:3;"></span>
        <span style="--i:4;"></span>
        <span style="--i:5;"></span>
        <span style="--i:6;"></span>
        <span style="--i:7;"></span>
        
    </div>
</body>
</html>


file css

*
{
    margin0;
    padding0;
    box-sizingborder-box;
}
body
{
    displayflex;
    justify-contentcenter;
    align-itemscenter;
    min-height100vh;
    background:black;
    overflowhidden;
}
.box
{
    positionrelative;
    width500px;
    height500px;
}
.box span
{
    positionabsolute;
    inset0;
    transformrotate(calc(45deg * var(--i)));
}
.box span::before
{
    content'';
    positionabsolute;
    left50%;
    width250px;
    height300px;
    backgroundurl(photo_٢٠٢٢-٠٥-١١_١٨-١٨-٢١.jpg);
    background-sizecover;
    background-positioncenter;
    transformtranslateX(-50%translateY(-100px)
    scale(0.75);
    animation: animate 2s steps(1infinite;
    animation-delaycalc(0.1s * var(--i));
}
@keyframes animate
{
    0%,100%
    {
        backgroundurl(photo_٢٠٢٢-٠٥-١١_١٨-١٨-٢١.jpg);
    }
    50%
    {
        backgroundurl(photo_٢٠٢٢-٠٥-١١_١٨-١٨-٢٢.jpg);
    }
}



output



download image:





تعليقات



حجم الخط
+
16
-
تباعد السطور
+
2
-