`

SVG实现的按钮动态点击图标

阅读更多

SVG实现的按钮动态点击图标

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>
    <style>
        /*CSS源代码*/
        .button-wrap {

        }

        .button {
            background: none;
            border: none;
            width: 150px;
            height: 55px;
            outline: none;
            position: relative;
            padding: 0;
            -webkit-tap-highlight-color: rgba(0,0,0,0);
            -webkit-tap-highlight-color: transparent; /* For some Androids */
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            -khtml-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        .button--round {
            top:-50px;
            left:70px;
            width: 100px;
            height: 100px;
        }

        .button__text {
            display: block;
            padding: 10px;
            text-align: center;
            position: relative;
            z-index: 100;
            font-size: 1.5em;
            color: #fff;
            font-weight: bold;
            -webkit-touch-callout: none;
            -webkit-user-select: none;
            -khtml-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        .morph-shape {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
        }

        .button--line .morph-shape svg {
            fill: none;
            stroke: #fff;
            stroke-width: 4px;
            stroke-linecap: round;
        }

        .button--line:nth-child(2) .morph-shape svg {
            fill: #938edc;
        }

        .button--fill .morph-shape svg {
            fill: #44474D;
        }

        .button--fill:nth-child(4) .morph-shape svg {
            fill: #202020;
        }

        .button--round .morph-shape svg {
            stroke-width: 7px;
        }

        /* 效果示例 */

        .button--anim-1 .button__text {
            -webkit-transition: -webkit-transform 0.15s;
            transition: transform 0.15s;
        }

        .button--anim-1:active .button__text {
            -webkit-transform: translate3d(0, -5px, 0);
            transform: translate3d(0, -5px, 0);
        }
    </style>
</head>
<body>
<!-- HTML代码片段中请勿添加<body>标签 //-->
<!--每个类型需要两个button因为一个是背景透明的button,一个是svg生成的button哦-->
<div id="container">
    <div class="main">
        <div class="content">
            <!-- 第1种类型按钮 -->
            <div class="button-wrap">
                <button class="button button--line button--effect-2">
            <span class="morph-shape" data-morph-active="M286,113c0,0-68.8,9-136,9c-78.2,0-137-9-137-9S3,97.198,3,62.5C3,33.999,13,12,13,12S72,2,150,2c85,0,136,10,136,10s11,17.598,11,52C297,96.398,286,113,286,113z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M286.5,113c0,0-104,0-136.5,0c-35.75,0-136.5,0-136.5,0s0-39.417,0-52.5c0-12.167,0-48.5,0-48.5s101.833,0,136.5,0c33.583,0,136.5,0,136.5,0s0,35.917,0,48.5C286.5,73.167,286.5,113,286.5,113z"/>
              </svg>
            </span>
                    <span class="button__text">按我~</span>
                </button>
                <button class="button button--line button--effect-2">
            <span class="morph-shape" data-morph-active="M286,113c0,0-68.8,6-136,6c-78.2,0-137-6-137-6S6,97.198,6,62.5C6,33.999,13,12,13,12s59-7,137-7c85,0,136,7,136,7s8,17.598,8,52C294,96.398,286,113,286,113z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M286.5,113c0,0-104,0-136.5,0c-35.75,0-136.5,0-136.5,0s0-39.417,0-52.5c0-12.167,0-48.5,0-48.5s101.833,0,136.5,0c33.583,0,136.5,0,136.5,0s0,35.917,0,48.5C286.5,73.167,286.5,113,286.5,113z"/>
              </svg>
            </span>
                    <span class="button__text">按我~</span>
                </button>
            </div>
            <!-- 第2种类型按钮 -->
            <div class="button-wrap">
                <button class="button button--line button--effect-1">
            <span class="morph-shape" data-morph-active="M286,113c0,0-68.8-5-136-5c-78.2,0-137,5-137,5s5-15.802,5-50.5C18,33.999,13,12,13,12s59,5,137,5c85,0,136-5,136-5s-5,17.598-5,52C281,96.398,286,113,286,113z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M286,113c0,0-68.8,0-136,0c-78.2,0-137,0-137,0s0-15.802,0-50.5C13,33.999,13,12,13,12s59,0,137,0c85,0,136,0,136,0s0,17.598,0,52C286,96.398,286,113,286,113z"/>
              </svg>
            </span>
                    <span class="button__text">打我~</span>
                </button>
                <button class="button button--line button--effect-2">
            <span class="morph-shape" data-morph-active="M286,113c0,0-68.8-5-136-5c-78.2,0-137,5-137,5s5-15.802,5-50.5C18,33.999,13,12,13,12s59,5,137,5c85,0,136-5,136-5s-5,17.598-5,52C281,96.398,286,113,286,113z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M286,113c0,0-68.8,0-136,0c-78.2,0-137,0-137,0s0-15.802,0-50.5C13,33.999,13,12,13,12s59,0,137,0c85,0,136,0,136,0s0,17.598,0,52C286,96.398,286,113,286,113z"/>
              </svg>
            </span>
                    <span class="button__text">打我~</span>
                </button>
            </div>
            <!-- 第3种类型按钮 -->
            <div class="button-wrap">
                <button class="button button--line button--effect-1">
            <span class="morph-shape" data-morph-active="M287,95.25c0,11.046-5.954,19.75-17,19.75c0,0-90-4-120-4s-120,4-120,4c-11.046,0-17.25-9.5-17.25-20.5c0-8.715,0.25-10.75,0.25-34s-0.681-26.257-1-33.75C11.5,15,18.954,10,30,10c0,0,90,3,120,3s120-3,120-3c11.046,0,17.75,6.5,17,20c-0.402,7.239,0,6.75,0,30.5C287,83.5,287,84.75,287,95.25z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M290,95c0,11.046-8.954,20-20,20c0,0-90,0-120,0s-120,0-120,0c-11.046,0-20-9-20-20c0-8.715,0-25.875,0-34.5c0-7.625,0-22.774,0-30.5c0-11.625,8.954-20,20-20c0,0,90,0,120,0s120,0,120,0c11.046,0,20,8.954,20,20c0,7.25,0,22.875,0,30.5C290,69.125,290,84.5,290,95z"/>
              </svg>
            </span>
                    <span class="button__text">点击我~</span>
                </button>
                <button class="button button--line button--effect-2">
            <span class="morph-shape" data-morph-active="M287,95.25c0,11.046-5.954,19.75-17,19.75c0,0-90-4-120-4s-120,4-120,4c-11.046,0-17.25-9.5-17.25-20.5c0-8.715,0.25-10.75,0.25-34s-0.681-26.257-1-33.75C11.5,15,18.954,10,30,10c0,0,90,3,120,3s120-3,120-3c11.046,0,17.75,6.5,17,20c-0.402,7.239,0,6.75,0,30.5C287,83.5,287,84.75,287,95.25z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M290,95c0,11.046-8.954,20-20,20c0,0-90,0-120,0s-120,0-120,0c-11.046,0-20-9-20-20c0-8.715,0-25.875,0-34.5c0-7.625,0-22.774,0-30.5c0-11.625,8.954-20,20-20c0,0,90,0,120,0s120,0,120,0c11.046,0,20,8.954,20,20c0,7.25,0,22.875,0,30.5C290,69.125,290,84.5,290,95z"/>
              </svg>
            </span>
                    <span class="button__text">点击我~</span>
                </button>
            </div>
            <!-- 第4种类型按钮 -->
            <div class="button-wrap">
                <button class="button button--line button--effect-1 button--anim-1">
            <span class="morph-shape" data-morph-active="M286,113c0,0-68.8-6-136-6c-78.2,0-137,6-137,6s2-15.802,2-50.5C15,33.999,13,12,13,12s59-6,137-6c85,0,136,6,136,6s-3,17.598-3,52C283,96.398,286,113,286,113z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M286,113c0,0-68.8,0-136,0c-78.2,0-137,0-137,0s0-15.802,0-50.5C13,33.999,13,12,13,12s59,0,137,0c85,0,136,0,136,0s0,17.598,0,52C286,96.398,286,113,286,113z"/>
              </svg>
            </span>
                    <span class="button__text">戳我~</span>
                </button>
                <button class="button button--line button--effect-2 button--anim-1">
            <span class="morph-shape" data-morph-active="M286,113c0,0-68.8-6-136-6c-78.2,0-137,6-137,6s2-15.802,2-50.5C15,33.999,13,12,13,12s59-6,137-6c85,0,136,6,136,6s-3,17.598-3,52C283,96.398,286,113,286,113z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M286,113c0,0-68.8,0-136,0c-78.2,0-137,0-137,0s0-15.802,0-50.5C13,33.999,13,12,13,12s59,0,137,0c85,0,136,0,136,0s0,17.598,0,52C286,96.398,286,113,286,113z"/>
              </svg>
            </span>
                    <span class="button__text">戳我~</span>
                </button>
            </div>
            <!-- 第5种类型按钮 -->
            <div class="button-wrap">
                <button class="button button--line button--effect-1">
            <span class="morph-shape" data-morph-active="M286.5,62.5c0,27.891-22.609,50.5-50.5,50.5c0,0-64.355-6-86-6c-21.645,0-86,6-86,6c-27.891,0-50.5-22.609-50.5-50.5l0,0C13.5,34.609,36.109,12,64,12c0,0,64.355,6,86,6c21.645,0,86-6,86-6C263.891,12,286.5,34.609,286.5,62.5L286.5,62.5z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M286.5,62.5c0,27.891-22.609,50.5-50.5,50.5c0,0-64.355,0-86,0c-21.645,0-86,0-86,0c-27.891,0-50.5-22.609-50.5-50.5l0,0C13.5,34.609,36.109,12,64,12c0,0,64.355,0,86,0c21.645,0,86,0,86,0C263.891,12,286.5,34.609,286.5,62.5L286.5,62.5z"/>
              </svg>
            </span>
                    <span class="button__text">推我~</span>
                </button>
                <button class="button button--line button--effect-2">
            <span class="morph-shape" data-morph-active="M286.5,62.5c0,27.891-22.609,50.5-50.5,50.5c0,0-64.355-6-86-6c-21.645,0-86,6-86,6c-27.891,0-50.5-22.609-50.5-50.5l0,0C13.5,34.609,36.109,12,64,12c0,0,64.355,6,86,6c21.645,0,86-6,86-6C263.891,12,286.5,34.609,286.5,62.5L286.5,62.5z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M286.5,62.5c0,27.891-22.609,50.5-50.5,50.5c0,0-64.355,0-86,0c-21.645,0-86,0-86,0c-27.891,0-50.5-22.609-50.5-50.5l0,0C13.5,34.609,36.109,12,64,12c0,0,64.355,0,86,0c21.645,0,86,0,86,0C263.891,12,286.5,34.609,286.5,62.5L286.5,62.5z"/>
              </svg>
            </span>
                    <span class="button__text">推我~</span>
                </button>
            </div>
            <!-- 第6种类型按钮 -->
            <div class="button-wrap">
                <button class="button button--line button--effect-1">
            <span class="morph-shape" data-morph-active="M282.5,62.5c0,27.891-17.583,50.176-46.5,53.5c-21.75,2.5-64.355,4-86,4c-21.645,0-65-1-86-4c-29.408-4.201-46.5-25.609-46.5-53.5l0,0C17.5,34.609,36.594,13.177,64,8c22.5-4.25,64.355-4,86-4c21.645,0,64.669,1.31,86,4C263.75,11.5,282.5,34.609,282.5,62.5L282.5,62.5z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M286.5,62.5c0,27.891-22.609,50.5-50.5,50.5c-21.5,0-64.355,0-86,0c-21.645,0-64.5,0-86,0c-27.891,0-50.5-22.609-50.5-50.5l0,0C13.5,34.609,36.109,12,64,12c21.5,0,64.355,0,86,0c21.645,0,64.5,0,86,0C263.891,12,286.5,34.609,286.5,62.5L286.5,62.5z"/>
              </svg>
            </span>
                    <span class="button__text">拱我~</span>
                </button>
                <button class="button button--line button--effect-2">
            <span class="morph-shape" data-morph-active="M282.5,62.5c0,27.891-17.583,50.176-46.5,53.5c-21.75,2.5-64.355,4-86,4c-21.645,0-65-1-86-4c-29.408-4.201-46.5-25.609-46.5-53.5l0,0C17.5,34.609,36.594,13.177,64,8c22.5-4.25,64.355-4,86-4c21.645,0,64.669,1.31,86,4C263.75,11.5,282.5,34.609,282.5,62.5L282.5,62.5z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M286.5,62.5c0,27.891-22.609,50.5-50.5,50.5c-21.5,0-64.355,0-86,0c-21.645,0-64.5,0-86,0c-27.891,0-50.5-22.609-50.5-50.5l0,0C13.5,34.609,36.109,12,64,12c21.5,0,64.355,0,86,0c21.645,0,64.5,0,86,0C263.891,12,286.5,34.609,286.5,62.5L286.5,62.5z"/>
              </svg>
            </span>
                    <span class="button__text">拱我~</span>
                </button>
            </div>
            <!-- 第7种类型按钮 -->
            <div class="button-wrap">
                <button class="button button--line button--effect-1">
            <span class="morph-shape" data-morph-active="M282.5,62.5c0,27.891-8.648,51.994-36.5,50.5c-24.049-1.29-44.75-8-96-8c-56.75,0-71.952,6.71-96,8c-27.851,1.494-36.5-22.609-36.5-50.5l0,0C17.5,34.609,26.215,9.572,54,12c23.973,2.095,39.75,7,96,7c51.502,0,72.01-5.125,96-7C273.807,9.827,282.5,34.609,282.5,62.5L282.5,62.5z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M286.5,62.5c0,27.891-12.609,50.5-40.5,50.5c-44.25,0-44.75,0-96,0c-56.75,0-56.5,0-96,0c-27.891,0-40.5-22.609-40.5-50.5l0,0C13.5,34.609,26.109,12,54,12c39.5,0,39.75,0,96,0c51.502,0,51.5,0,96,0C273.891,12,286.5,34.609,286.5,62.5L286.5,62.5z"/>
              </svg>
            </span>
                    <span class="button__text">按住我~</span>
                </button>
                <button class="button button--line button--effect-2">
            <span class="morph-shape" data-morph-active="M282.5,62.5c0,27.891-8.648,51.994-36.5,50.5c-24.049-1.29-44.75-8-96-8c-56.75,0-71.952,6.71-96,8c-27.851,1.494-36.5-22.609-36.5-50.5l0,0C17.5,34.609,26.215,9.572,54,12c23.973,2.095,39.75,7,96,7c51.502,0,72.01-5.125,96-7C273.807,9.827,282.5,34.609,282.5,62.5L282.5,62.5z">
              <svg width="100%" height="100%" viewBox="0 0 300 125" preserveAspectRatio="none">
                  <path d="M286.5,62.5c0,27.891-12.609,50.5-40.5,50.5c-44.25,0-44.75,0-96,0c-56.75,0-56.5,0-96,0c-27.891,0-40.5-22.609-40.5-50.5l0,0C13.5,34.609,26.109,12,54,12c39.5,0,39.75,0,96,0c51.502,0,51.5,0,96,0C273.891,12,286.5,34.609,286.5,62.5L286.5,62.5z"/>
              </svg>
            </span>
                    <span class="button__text">按住我~</span>
                </button>
            </div>
            <!-- 第8种类型按钮 -->
            <div class="button-wrap">
                <button class="button button--line button--round button--effect-1">
            <span class="morph-shape" data-morph-active="M251,150c0,93.5-29.203,143-101,143S49,243.5,49,150C49,52.5,78.203,7,150,7S251,51.5,251,150z">
              <svg width="100%" height="100%" viewBox="0 0 300 300" preserveAspectRatio="none">
                  <path d="M281,150c0,71.797-59.203,131-131,131S19,221.797,19,150S78.203,19,150,19S281,78.203,281,150z"/>
              </svg>
              <span>
              <span class="button__text">可放置logo哦~</span>
                </button>
                <button class="button button--line button--round button--effect-2">
            <span class="morph-shape" data-morph-active="M251,150c0,93.5-29.203,143-101,143S49,243.5,49,150C49,52.5,78.203,7,150,7S251,51.5,251,150z">
              <svg width="100%" height="100%" viewBox="0 0 300 300" preserveAspectRatio="none">
                  <path d="M281,150c0,71.797-59.203,131-131,131S19,221.797,19,150S78.203,19,150,19S281,78.203,281,150z"/>
              </svg>
            </span>
                    <span class="button__text">可放置logo哦~</span>
                </button>
            </div>
        </div>
    </div><!-- /main -->
</div>

<!-- 推荐开源CDN来选取需引用的外部JS //-->
<script type="text/javascript" src="http://cdn.gbtags.com/snap.svg/0.3.0/snap.svg-min.js"></script>

<script>
    /*Javascript代码片段*/
    (function() {

        function extend( a, b ) {
            for( var key in b ) {
                if( b.hasOwnProperty( key ) ) {
                    a[key] = b[key];
                }
            }
            return a;
        }

        function SVGButton( el, options ) {
            this.el = el;
            this.options = extend( {}, this.options );
            extend( this.options, options );
            this.init();
        }

        SVGButton.prototype.options = {
            speed : { reset : 800, active : 150 },
            easing : { reset : mina.elastic, active : mina.easein }
        };

        SVGButton.prototype.init = function() {
            this.shapeEl = this.el.querySelector( 'span.morph-shape' );

            var s = Snap( this.shapeEl.querySelector( 'svg' ) );
            this.pathEl = s.select( 'path' );
            this.paths = {
                reset : this.pathEl.attr( 'd' ),
                active : this.shapeEl.getAttribute( 'data-morph-active' )
            };

            this.initEvents();
        };

        SVGButton.prototype.initEvents = function() {
            this.el.addEventListener( 'mousedown', this.down.bind(this) );
            this.el.addEventListener( 'touchstart', this.down.bind(this) );

            this.el.addEventListener( 'mouseup', this.up.bind(this) );
            this.el.addEventListener( 'touchend', this.up.bind(this) );

            this.el.addEventListener( 'mouseout', this.up.bind(this) );
        };

        SVGButton.prototype.down = function() {
            this.pathEl.stop().animate( { 'path' : this.paths.active }, this.options.speed.active, this.options.easing.active );
        };

        SVGButton.prototype.up = function() {
            this.pathEl.stop().animate( { 'path' : this.paths.reset }, this.options.speed.reset, this.options.easing.reset );
        };

        [].slice.call( document.querySelectorAll( 'button.button--effect-1' ) ).forEach( function( el ) {
            new SVGButton( el );
        } );

        [].slice.call( document.querySelectorAll( 'button.button--effect-2' ) ).forEach( function( el ) {
            new SVGButton( el, {
                speed : { reset : 650, active : 650 },
                easing : { reset : mina.elastic, active : mina.elastic }
            } );
        } );

    })();
</script>
</body>
</html>

 

 

.

分享到:
评论

相关推荐

    SVG实现Loading加载按钮动画图标特效.zip

    总结,这个压缩包提供了一个使用SVG实现的加载按钮动画图标特效,利用SVG的矢量特性、CSS3动画和JavaScript交互,可以创建出高质量、可自定义的加载效果。对于前端开发者来说,这是一份很好的学习和实践资源。

    html5 svg点击图标按钮展开多个图标菜单特效

    本特效正是基于HTML5的SVG特性和JavaScript实现的,通过点击SVG图标按钮,动态展示或隐藏多个SVG图标菜单。 在这款特效中,SVG图标被用作主菜单的触发器。SVG的优势在于,其图形可以无限放大而不会失真,这使得它...

    SVG实现Loading加载按钮动画图标特效

    本项目"SVG实现Loading加载按钮动画图标特效"正是利用SVG的强大功能,创造出一款既美观又实用的加载按钮动画。 首先,SVG是一种基于XML的矢量图像格式,这意味着SVG图像可以无限放大而不会失真,这在响应式设计中...

    12个SVG Loading图标

    总之,这个"SVG Loading图标"资源包为开发者提供了12个高质量的SVG加载图标,适用于多种场景,特别是移动开发和HTML5项目,可以轻松集成并实现动态效果,提升用户体验。了解SVG的基本原理和使用方法,将有助于更好地...

    jQuery SVG实现Loading加载按钮动画图标特效.zip

    &lt;button class="control-button bordered make-it-fail"&gt;Make it fail &lt;button class="loading-button circular-loading top"&gt;... 一款个性好看的基于SVG实现的Loading加载按钮动画图标特效,SVG加载按钮动画代码。

    CSS3实现150个动画SVG图标.zip

    总之,“CSS3实现150个动画SVG图标”是一个展示CSS3与SVG结合力量的优秀资源库,它涵盖了多种动画效果,可以帮助开发者快速实现动态SVG图标,提升网页的视觉吸引力和互动性。通过深入理解和实践这些示例,开发者可以...

    12个SVG Loading图标演示

    2. SVG图标的应用:SVG图标常用于网页的导航菜单、按钮、提示图标以及加载动画。在网页开发中,可以将SVG代码内联插入HTML,或者作为外部文件引用,也可以通过CSS进行样式控制。 3. 动态SVG加载图标:这些12个图标...

    html5 svg点击图标按钮展开多个图标菜单特效.zip

    本资源“html5 svg点击图标按钮展开多个图标菜单特效.zip”包含了一个使用jQuery实现的互动菜单系统,该系统利用了HTML5的SVG元素来创建图标,以及jQuery库的强大功能来控制动画和事件。 SVG(可缩放矢量图形)是一...

    CSS3+SVG实现的WIFI动画图标特效源码.zip

    本资源"CSS3+SVG实现的WIFI动画图标特效源码.zip"提供了一种利用这两种技术创建逼真、动态的WIFI图标的方法。下面将详细解释这两个技术以及如何结合它们来实现动画图标。 CSS3(Cascading Style Sheets Level 3)是...

    CSS3 SVG镂空效果图标按钮.zip

    【CSS3 SVG镂空效果图标按钮】是一种利用现代Web技术,特别是CSS3和SVG(Scalable Vector Graphics)来创建具有动态视觉效果的交互式按钮的设计。这种设计方法结合了CSS3的样式控制和SVG的矢量图形特性,使得按钮在...

    HTML5 SVG图标按钮菜单特效.zip

    7. **响应式设计**:考虑到现代网页的跨设备兼容性,此特效可能还实现了响应式设计,使按钮和SVG图标在不同屏幕尺寸下都能正确显示和交互。 总的来说,这个压缩包提供了一个结合HTML5、SVG和jQuery的示例,展示了...

    漂亮图标SVG100

    在实际项目中,可以根据需求自定义这些图标,甚至结合JavaScript实现动态效果,如悬停动画、点击反馈等。 总之,“漂亮图标SVG100”这个资源提供了丰富的设计元素,帮助设计师和开发者创建更加吸引人且功能性的用户...

    html5 svg手机播放器按钮动画特效.zip

    在SVG按钮上添加交互事件,当用户滑动或点击音量控制,JavaScript会更新Audio对象的音量属性,从而实现音量的变化。 5. **手机适配**: 这个播放器是为手机设计的,因此很可能采用了响应式设计,以适应不同尺寸和...

    html5 svg喜欢点赞图标动画特效

    例如,用户点击点赞按钮时,可以改变心形图标的颜色,使其逐渐变大,或者添加一个心跳效果,让图标有节奏地跳动。 在CSS中,也可以利用关键帧动画(@keyframes)来实现更复杂的SVG动画。通过定义动画的不同阶段,你...

    SVG实现镂空动画图标.zip

    - SVG镂空动画图标常用于网站导航、加载指示器、按钮、图表等多种场景,提升用户体验。 - 通过调整SVG代码,可以轻松定制和扩展图标库,满足不同的设计需求。 综上所述,这个压缩包中的内容涵盖了SVG图形的创建、...

    html5基于svg实现的新品上市铃铛图标动画特效源码.zip

    例如,当用户滚动页面或点击按钮时,铃铛图标可能会有响应式的动画效果。 5. 响应式设计:为了适应不同设备和屏幕尺寸,此特效可能采用了响应式设计。通过媒体查询(Media Queries)或SVG的视口(viewBox)属性,...

    这是一款效果非常炫酷的html5svg图标变形动画特效插件

    本插件——"SVG Morpheus",是JavaScript开发的一个优秀实例,专用于实现SVG图标的炫酷变形动画效果。 SVG Morpheus插件的核心在于它利用了HTML5的SVG特性,SVG是一种基于XML的矢量图像格式,可以在任何分辨率下...

    CSS3 SVG手机移动端底部图标导航栏特效

    综上所述,"CSS3 SVG手机移动端底部图标导航栏特效"结合了CSS3的动态效果和SVG的矢量图形优势,创造出一种既美观又实用的交互式导航解决方案。通过合理布局HTML结构,编写CSS样式和JavaScript交互,我们可以创建出一...

    CSS3 SVG爱心点赞按钮点击散开动画特效

    本文将详细介绍如何使用CSS3和SVG技术创建一个动态的、具有视觉吸引力的“爱心点赞按钮”,该按钮在点击后会散开并自动收起,同时点亮爱心。这种效果可以为网站增添趣味性,提升用户互动性。 首先,**SVG(Scalable...

    CSS3+SVG镂空效果图标按钮.zip

    本资源"CSS3+SVG镂空效果图标按钮.zip"提供了一套利用这两种技术实现的镂空效果图标按钮,适用于前端开发。这个压缩包内包含了相关的CSS样式文件、SVG图标文件以及可能的HTML和JavaScript代码,帮助开发者快速构建...

Global site tag (gtag.js) - Google Analytics