gsap+svg实现播放按钮点击变形动画效果代码
代码语言:html
所属分类:动画
代码描述:gsap+svg实现播放按钮点击变形动画效果代码,还用到了MorphSVGPlugin3插件
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { display: grid; justify-content: center; align-items: center; min-height: 100vh; overflow: hidden; background: #222; } button.play { width: 100%; height: 100%; height: 7em; width: 8em; padding: 1em; overflow: visible; border: none; background-color: red; position: relative; border-radius: 60px/17px; } button.play:before { content: ""; position: absolute; top: 10%; bottom: 10%; right: -7%; left: -7%; background: inherit; border-radius: 20px/60px; z-index: -1; } button.play svg { display: block; height: 60%; width: 60%; margin: auto; overflow: visible; transform: scale(1.25); } button.play svg path { filter: drop-shadow(3px 5px 2px rgba(0, 0, 0, 0.4)); } </style> </head> <body> <button type="button" id="controls" class="play"> <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <path id="play&.........完整代码请登录后点击上方下载按钮下载查看
网友评论0