使用纯CSS实现日出日落效果

使用纯CSS实现日出日落效果

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>东升西落</title>
    <style type="text/css">
        .ship {
            animation-name: move-ship;
            animation-duration: 40s;
        }

        .clouds {
            animation-name: move-clouds;
            animation-duration: 40s;
        }

        .sun-small {
            animation-name: move-sun;
            animation-duration: 10s;
        }

        .comet {
            animation-name: move-comet;
            animation-duration: 10s;
        }

        @keyframes move-comet {
            100% {
                transform: translate(400px, 375px);
            }
        }

        @keyframes move-clouds {
            to {transform: translateX(-1000px);}
        }

        @keyframes move-sun {
            to {transform: translate(350px, -400px);}
        }

        @keyframes move-ship {
            to {transform: translateX(1000px);}
        }
    </style>
</head>
<body>
<head>
    <title>Водное путешествие</title>
    <meta charset="utf-8">
    <base href="https://htmlacademy.ru/assets/course80/">
    <link rel="stylesheet" href="epoch1.css">
</head>
<body class="ancient-world">
<div>
    <div class="comet"></div>
    <div class="sun-small"></div>
    <div class="clouds"></div>
    <div class="water"></div>
    <div class="ship"></div>
</div>
</body>
</body>
</html>

.

css

相关推荐