svg+css3做1个动感的波浪纹实际效果完成

日期:2021-02-28 类型:科技新闻 

关键词:在线小程序开发,微信小程序怎么做店铺,小程序logo设计,小程序平台,小程序码生成

1根矢量的波浪纹

<svg viewBox="0 0 560 20" class="wave-animation__water-wave wave-animation__water-wave--front">
    <use xlink:href="#wave"></use>
</svg>
<svg id="wave" width="100%" height="100%">
    <path d="M420,20c21.5-0.4,38.8⑵.5,51.1⑷.5c13.4⑵.2,26.5⑸.2,27.3⑸.4C514,6.5,518,4.7,528.5,2.7c7.1⑴.3,17.9⑵.8,31.5⑵.7c0,0,0,0,0,0v20H420z"></path>
    <path d="M420,20c⑵1.5-0.4⑶8.8⑵.5⑸1.1⑷.5c⑴3.4⑵.2⑵6.5⑸.2⑵7.3⑸.4C326,6.5,322,4.7,311.5,2.7C304.3,1.4,293.6-0.1,280,0c0,0,0,0,0,0v20H420z"></path>
    <path d="M140,20c21.5-0.4,38.8⑵.5,51.1⑷.5c13.4⑵.2,26.5⑸.2,27.3⑸.4C234,6.5,238,4.7,248.5,2.7c7.1⑴.3,17.9⑵.8,31.5⑵.7c0,0,0,0,0,0v20H140z"></path>
    <path d="M140,20c⑵1.5-0.4⑶8.8⑵.5⑸1.1⑷.5c⑴3.4⑵.2⑵6.5⑸.2⑵7.3⑸.4C46,6.5,42,4.7,31.5,2.7C24.3,1.4,13.6-0.1,0,0c0,0,0,0,0,0l0,20H140z"></path>

详细编码:

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf⑻">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
</head>

<body>
    <div class="circle-countdown circle-countdown--ended">
        <div class="circle-countdown__content-wrapper">
            <div class="circle-countdown__content wave-animation">
                <div id="water" class="wave-animation__water">
                    <svg viewBox="0 0 560 20" class="wave-animation__water-wave wave-animation__water-wave--back">
                        <path
                            d="M420,20c21.5-0.4,38.8⑵.5,51.1⑷.5c13.4⑵.2,26.5⑸.2,27.3⑸.4C514,6.5,518,4.7,528.5,2.7c7.1⑴.3,17.9⑵.8,31.5⑵.7c0,0,0,0,0,0v20H420z">
                        </path>
                        <path
                            d="M420,20c⑵1.5-0.4⑶8.8⑵.5⑸1.1⑷.5c⑴3.4⑵.2⑵6.5⑸.2⑵7.3⑸.4C326,6.5,322,4.7,311.5,2.7C304.3,1.4,293.6-0.1,280,0c0,0,0,0,0,0v20H420z">
                        </path>
                        <path
                            d="M140,20c21.5-0.4,38.8⑵.5,51.1⑷.5c13.4⑵.2,26.5⑸.2,27.3⑸.4C234,6.5,238,4.7,248.5,2.7c7.1⑴.3,17.9⑵.8,31.5⑵.7c0,0,0,0,0,0v20H140z">
                        </path>
                        <path
                            d="M140,20c⑵1.5-0.4⑶8.8⑵.5⑸1.1⑷.5c⑴3.4⑵.2⑵6.5⑸.2⑵7.3⑸.4C46,6.5,42,4.7,31.5,2.7C24.3,1.4,13.6-0.1,0,0c0,0,0,0,0,0l0,20H140z">
                        </path>
                    </svg>
                    <svg viewBox="0 0 560 20" class="wave-animation__water-wave wave-animation__water-wave--front">
                        <path
                            d="M420,20c21.5-0.4,38.8⑵.5,51.1⑷.5c13.4⑵.2,26.5⑸.2,27.3⑸.4C514,6.5,518,4.7,528.5,2.7c7.1⑴.3,17.9⑵.8,31.5⑵.7c0,0,0,0,0,0v20H420z">
                        </path>
                        <path
                            d="M420,20c⑵1.5-0.4⑶8.8⑵.5⑸1.1⑷.5c⑴3.4⑵.2⑵6.5⑸.2⑵7.3⑸.4C326,6.5,322,4.7,311.5,2.7C304.3,1.4,293.6-0.1,280,0c0,0,0,0,0,0v20H420z">
                        </path>
                        <path
                            d="M140,20c21.5-0.4,38.8⑵.5,51.1⑷.5c13.4⑵.2,26.5⑸.2,27.3⑸.4C234,6.5,238,4.7,248.5,2.7c7.1⑴.3,17.9⑵.8,31.5⑵.7c0,0,0,0,0,0v20H140z">
                        </path>
                        <path
                            d="M140,20c⑵1.5-0.4⑶8.8⑵.5⑸1.1⑷.5c⑴3.4⑵.2⑵6.5⑸.2⑵7.3⑸.4C46,6.5,42,4.7,31.5,2.7C24.3,1.4,13.6-0.1,0,0c0,0,0,0,0,0l0,20H140z">
                        </path>
                    </svg>
                </div>
            </div>
        </div>
    </div>


    <style>
        .circle-countdown {
            width: 441px;
            height: 441px;
            position: relative;
            top: 0;
            left: 0;
            padding: 2.5rem;
            border: 1px solid #fb64b6;
            border-radius: 50%;
            overflow: hidden;
        }

        .wave-animation {
            overflow: hidden;
        }


        .wave-animation__percent {
            position: absolute;
            left: 0;
            top: 0;
            z-index: 3;
            width: 100%;
            height: 100%;
            display: flex;
            display: -webkit-flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 64px;
        }

        .wave-animation__water {
            position: absolute;
            left: 0;
            top: 0;
            z-index: ⑴;
            width: 100%;
            height: 100%;
            /* 调剂这里的60%便可以更改进度,波浪纹高矮 */
            transform: translate(0, calc(100% - 60%));
            background: #f852d6;
            transition: all 2s;
        }

        .wave-animation__water-wave {
            width: 200%;
            position: absolute;
            bottom: 100%;


        }

        .wave-animation__water-wave--back {
            right: 0;
            fill: #1d1d1d;
            animation: wave-back 1.4s infinite linear;
        }

        .wave-animation__water-wave--front {
            left: 0;
            fill: #f852d6;
            margin-bottom: ⑴px;
            animation: wave-front 0.7s infinite linear;
        }

        @keyframes wave-front {
            100% {
                transform: translate(⑸0%, 0);
            }
        }

        @keyframes wave-back {
            100% {
                transform: translate(50%, 0);
            }
        }
    </style>
</body>

</html>

以上便是本文的所有內容,期待对大伙儿的学习培训有一定的协助,也期待大伙儿多多适用脚本制作之家。

上一篇:CSS3 新增挑选器的案例 返回下一篇:没有了