6.css3动画大海波涛.html

  • 效果图:


    2GIF.gif
  • 6.css3动画大海波涛.html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>6.css3动画大海波涛.html</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        html,body{
            width: 100%;
            height: 100%;
            background-color: #0ea9b1;
            overflow: hidden;  /*清除右侧出现的滚动条*/
        }
        img{
            width: 100%;
            height: auto;
            position: absolute;
            bottom: 0;
            left: 0;
            /*animation: move 2s ease infinite;*/
        }
        img:first-child{
            animation: move 2s linear infinite;
        }
        img:last-child{
            animation: move 2s ease infinite;
        }
        

        .sun{
            width: 100px;
            height: 100px;
            /*background-color: pink;*/
            margin: 100px;
            position: relative;
        }
        .sun::before, .sun::after{  /*让两个盒子水平垂直居中*/
            content: "";  /*必须要有content*/
            position: absolute;
            top: 50%;
            left: 50%;
            width: 50px;
            height: 50px;
            transform: translate(-50%, -50%);
            background: rgba(255, 255, 255, 0.8);
            border-radius: 50%;
            animation: sun 2s ease infinite;
        }
        .sun::after{
            width: 80px;
            height: 80px;
            background: rgba(255, 255, 255, 0.6);
            animation: sun 3s ease infinite;
        }
        @keyframes move{
            0%{
                bottom: 0;
            }
            50%{
                bottom: -50px;
            }
            100%{
                bottom: 0;
            }
        }
        @keyframes sun{
            0%{
                transform: translate(-50%, -50%) scale(1);
                box-shadow: 0px 0px 30px rgba(255, 255, 255, 0.7);
            }
            50%{
                transform: translate(-50%, -50%) scale(1.1);
                box-shadow: 0px 0px 75px rgba(255, 255, 255, 0.7);
            }
            100%{
                transform: translate(-50%, -50%) scale(1);
                box-shadow: 0px 0px 30px rgba(255, 255, 255, 0.7);
            }
        }
    </style>
</head>
<body>
    <div>
        <div class="sun"></div>
        <img src="images/1sea.png" alt="">
        <img src="images/2sea.png" alt="">
    </div>
</body>
</html>
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容