• svg实现光环波纹效果


    效果dome:

    <svg width="580" height="400" xmlns="http://www.w3.org/2000/svg">
    <!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ -->
    <g>
    <title>background</title>
    <rect fill="#fff" id="canvas_background" height="402" width="582" y="-1" x="-1"/>
    <g display="none" overflow="visible" y="0" x="0" height="100%" width="100%" id="canvasGrid">
    <rect fill="url(#gridpattern)" stroke-width="0" y="0" x="0" height="100%" width="100%"/>
    </g>
    </g>
    <g>
    <title>Layer 1</title>
    <g id="svg_4">
    <g>
    <ellipse ry="50" rx="50" id="svg_1" cy="189.8" cx="259.4" stroke-width="10" stroke="#ff0000" fill="#fff"/>
    <animate id='ani1' attributeName='stroke-opacity' attributeType='XML' begin='0s;ani2.end' dur='2s' from='1' to='0' fill='freeze'/>
    <animate id='ani2' attributeName='stroke-opacity' attributeType='XML' begin='ani1.end' dur='2s' from='0' to='1' fill='freeze'/>
    </g>
    <g>
    <ellipse ry="30" rx="30" id="svg_2" cy="189.3" cx="259.9" stroke-width="10" stroke="#ff0000" fill="#fff"/>
    <animate id='ani3' attributeName='stroke-opacity' attributeType='XML' begin='0s;ani4.end' dur='2s' from='0' to='1' fill='freeze'/>
    <animate id='ani4' attributeName='stroke-opacity' attributeType='XML' begin='ani3.end' dur='2s' from='1' to='0' fill='freeze'/>
    </g>
    <g>
    <ellipse ry="15" rx="15" id="svg_3" cy="188.8" cx="259.4" stroke-opacity="null" stroke-width="10" stroke="#ff0000" fill="#56ffff"/>
    <animate id='ani5' attributeName='fill-opacity' attributeType='XML' begin='0s;ani6.end' dur='2s' from='1' to='0' fill='freeze'/>
    <animate id='ani6' attributeName='fill-opacity' attributeType='XML' begin='ani5.end' dur='2s' from='0' to='1' fill='freeze'/>
    </g>
    </g>
    </g>
    </svg>

    1.通过svg在线编辑器画出基础的样式。(连个线条为红色的圆环包围一个线条为红色填充蓝色的园)

    2.分别给圆环和圆添加animate属性。

      2.1 “attributeName='fill-opacity”改变填充色;

      2.3 “attributeName='stroke-opacity'”改变线条样式;

      2.3 “ begin='0s;ani6.end' dur='2s' from='1' to='0' ”样式改变的时间设置,以及效果设置。

  • 相关阅读:
    Andriod ADT v22.6.2版本中在Mainactivity.java中使用fragment_main.xml中TextView控件对象的问题
    SQL学习:查询的用法(1)
    SQL学习:主键,外键,主键表,外键表,数据库的表与表之间的关系;
    HTML基础(2) 格式标签 文本标签
    2013年10月15日数据库学习:约束
    HTML基础(1) 全局架构标签,特殊字符
    2013年10月13日学习:SQL通过命令语句来创建表
    2013年10月13日学习:SQL通过图形化界面创建表
    Tomcat和Nutch的安装
    sqlserver 处理连接池问题
  • 原文地址:https://www.cnblogs.com/wxx-17-5-13/p/9336004.html
Copyright © 2020-2023  润新知