gsap+svg实现蚊香型圈圈旋转动画效果代码

代码语言:html

所属分类:动画

代码描述:gsap+svg实现蚊香型圈圈旋转动画效果代码

代码标签: gsap svg 蚊香 圈圈 旋转 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">

  
  
  
  
<style>
body {
 background-color: #FFFCF9;
 overflow: hidden;
 text-align:center;
  display: flex;
  align-items: center;
  justify-content: center; 
}

body,
html {
 height: 100%;
 width: 100%;
 margin: 0;
 padding: 0;
}

svg {
 width: 100%;
 height: 100%;
 visibility: hidden;
 
}

/* #mainSVG circle:nth-child(even) {
	mix-blend-mode: multiply;
} */
</style>




</head>

<body  >
  <svg id="mainSVG" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600">
<defs>
<circle class="path" r="10" cx="400" cy="300" fill="red" />
<circle class="dot" r="2" cx="400" cy="300" fill="none" />
	</defs>

</svg>

<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/gsap.3.8.0.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/MotionPathPlugin.min.js"></script>
      <script id="rendered-js" >
gsap.config({trialWarn: false});
let select = s => document.querySelector(s),
		q = gsap.utils.selector(document),
		toArray = s => gsap.utils.toArray(s),
		mainSVG = select('#mainSVG'),
		d.........完整代码请登录后点击上方下载按钮下载查看

网友评论0