zoukankan      html  css  js  c++  java
  • 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' ”样式改变的时间设置,以及效果设置。

  • 相关阅读:
    Java8新特性-日期时间
    解决有道云笔记导入md文件无法加载文件内的图片方式
    Mac安装Navicat Premium 12 永久破解
    MacBook Pro安装和配置Tomcat
    MySQL不支持DELETE使用表别名?
    JAVA设计模式之模板方法
    Lombok中的@Builder注解
    JAVA设计模式之策略模式
    Stream中的Peek操作
    MySql插入一条数据不提交事务主键仍自增的理解
  • 原文地址:https://www.cnblogs.com/wxx-17-5-13/p/9336004.html
Copyright © 2011-2022 走看看