c3動畫 銜接動畫

c3動畫 銜接動畫

在這裏插入圖片描述


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

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            background: red;
            /* 動畫名稱 */
            /* animation-name: dong; */
            /* 動畫總時長2s */
            /* animation-duration: 2s; */
            /* 執行3次 */
            /* animation-iteration-count: 3; */
            /* 動畫逆播 */
            /* animation-direction: alternate; */
            /* 動畫勻速執行 */
            /* animation-timing-function: linear; */
            /* 動畫延時1s 執行 */
            /* animation-delay: 1s; */
            /* 動畫執行完後的狀態 */
            /* animation-fill-mode: forwards; */
            /* animation: dong 12s 3 alternate linear 0.5s forwards; */
            /* margin: 200px auto; */
            animation: dong1 1s forwards, dong2 1s 2s forwards, dong3 1s 3s forwards;
        }
        
        @keyframes dong1 {
            from {
                width: 200px;
            }
            to {
                width: 400px;
            }
        }
        
        @keyframes dong2 {
            from {
                height: 200px;
            }
            to {
                height: 400px;
            }
        }
        
        @keyframes dong3 {
            from {
                background-color: red;
            }
            to {
                background-color: blue;
            }
        }
    </style>
</head>

<body>
    <div class="box"></div>
</body>

</html>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章