gsap+svg实现彩灯绳子闪烁动画效果代码

代码语言:html

所属分类:动画

代码描述:gsap+svg实现彩灯绳子闪烁动画效果代码

代码标签: gsap svg 彩灯 绳子 闪烁 动画

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

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

<head>
  <meta charset="UTF-8">

  
<style>
body {
  width: 100%;
  height: 90%;
  background-color: #000;
  margin: 0px;
}
</style>


  
  
</head>

<body translate="no">
  <svg id="stringlights" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" width="100%" height="100%" viewBox="0 0 1024 800">
</svg>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/gsap.3.12.5.js"></script>
      <script >
//Preference
const colors = ["#F2C12E", "#D99518", "#A64F03"]; //Hue of the light bulbs
const sharpe = 325; //Change value to get diffrent shapes

//Setup
const svg = document.getElementById("stringlights");

function createBulb(x, y, i) {
  const circle = document.createElementNS(
    "http://www.w3.org/2000/svg",
    "circle"
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0