gsap实现6个正方形组成立方体盒子动画效果代码
代码语言:html
所属分类:动画
代码描述:gsap实现6个正方形组成立方体盒子动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { background-color: hsl(20, 28%, 75%); } svg { max-height: 90vh; max-width: 90vw; margin: 0 auto; display: block; } rect { fill: hsl(20, 28%, 65%); } #shadow { fill: hsl(20, 28%, 25%); opacity: 0; filter: blur(10px); } </style> </head> <body > <svg height="100%" width="100%" viewBox="0 0 500 400"> <g id="cube"> <rect id="side-left-back" x="90" y="160" width="100" height="100" /> <rect id="side-right-back" x="310" y="160" width="100" height="100" /> <rect id="shadow" x="200" y="160" width="100" height="100" /> <rect id="side-bottom" x="200" y="160" width="100" height="100" /> <rect id="side-left" x="90" y="50" width="100" height="100" /> <rect id="side-right" x="310" y="50" width="100" height="100" /> <rect id="side-top" x="200" y="50" width="100" height="100" /> </g> </svg> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/gsap.3.11.0.js"></script> <script > var tl = gsap.timeline({ repeat: -1, repeatDelay: 2, yoyo: true, defaults: { ease: "elastic.out(1,0.3)" } }); // Create ISO cube – Scale, Skew, Rotate. tl.to("#cube", { delay: 1, scale: 1.4, transformOrigin: "center center&q.........完整代码请登录后点击上方下载按钮下载查看
网友评论0