CSS Animation example

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 500px;
            height: 500px;
            margin: 100px auto;
            background-color: hsl(175, 65%, 38%);
            border-radius: 50%;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 3);
            animation: yshysh 3s ease-in-out infinite alternate;
        }

        @keyframes yshysh {
            0% {
                opacity: 0.2;
                box-shadow: 0 1px 2px rgba(255, 255, 255, 0.1)
            }

            50% {
                opacity: 0.5;
                box-shadow: 0 1px 2px rgba(18, 190, 84, 0.76)
            }

            100% {
                opacity: 1;
                box-shadow: 0 1px 2px rgb(36, 226, 226)
            }
        }
    </style>
</head>
<body>
    <div class="box"></div>

</body>

</html>
posted @ 2024-04-04 23:40  x-Author  阅读(31)  评论(0)    收藏  举报