gsap实现方形拖拽伸缩动画效果代码
代码语言:html
所属分类:拖放
代码描述:gsap实现方形拖拽伸缩动画效果代码,结合了Draggable3。
下面为部分代码预览,完整代码请点击下载或在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; } </style> </head> <body > <svg id="mainSVG" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 600"> <defs> <filter id="drop" x="-100%" y="-100%" width="300%" height="300%"> <feOffset result="offOut" in="SourceGraphic" dx="2" dy="2" /> <feGaussianBlur in="offOut" stdDeviation="4" result="blur" /> <feComponentTransfer> <feFuncA type="linear" slope="0.57" intercept="0" /> </feComponentTransfer> <feComposite in="SourceGraphic" operator="over" /> </filter> <filter id="glow" x="-100%" y="-100%" width="250%" height="250%"> <feGaussianBlur stdDeviation="15 1" result="coloredBlur" /> <feOffset dx="0" dy="0" result="offsetblur"></feOffset> <feFlood id="glowAlpha" flood-color="red" flood-opacity="1"></feFlood> <feComposite in2="offsetblur" operator="in"></feComposite> <feMerge> <feMergeNode/> <feMergeNode in="SourceGraphic"></feMergeNode> </feMerge> </filter> </defs> <g fill="#FFF" stroke="#121212" stroke-width="0.2"> <rect filter="url(#drop)" rx="60" class="box" x="240" y="140" width="240" height="240" /> <rect filter="url(#drop)" rx="60" class="box" x="240" y="140" width="240" height="240" /> <rect filter="url(#drop)" rx="60" class="box" x="240" y="140" width="240" height="240" /> <rect filter="url(#drop)" rx="60" class="box" x="240" y="140" width="240" height="240" /> <rect filter="url(#drop)" rx="60" class="box" x="240" y="140" width="240" height="240" /> <rect filter="url(#drop)" rx="60" class="box" x="240" y="140" width="240" height="240" /> <rect filter="url(#drop)" rx="60" class="box" x="240" y="140" width="240" height="240" /> <rect filter="url(#drop)&quo.........完整代码请登录后点击上方下载按钮下载查看
网友评论0