lottie实现下载按钮点击动画效果代码
代码语言:html
所属分类:其他
代码描述:lottie实现下载按钮点击动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { min-height: 100vh; display: flex; justify-content: center; align-items: center; } * { box-sizing: border-box; } .btn { background-color: rgba(0, 0, 0, 0.04); color: black; padding: 12px; display: inline-flex; align-items: center; cursor: pointer; border-radius: 24px; transition: all 0.2s ease; font-size: 16px; -webkit-tap-highlight-color: transparent; } .btn:hover { background-color: rgba(0, 0, 0, 0.06); } #download { width: 24px; height: 24px; transform: translate3d(0, 0, 0); } #download svg path { stroke: black; margin: 0 auto; } </style> </head> <body translate="no"> <div class="btn"> <div id="download"></div> </div> <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/lottie.5.12.2.js"></script> <script > var animationData = { "v": "5.7.5", "fr": 100, "ip": 0, "op": 40, "w": 24, "h": 24, "nm": "Comp 1", "ddd": 0, "assets": [], "layers": [{ "ddd": 0, "ind": 1, "ty": 4, "nm": "Path's solid stroke", "sr": 1, "ks": { "p": { "a": 0, "k": [0, 0], "ix": 2 }, "a": { "a": 0, "k": [0, 0], "ix": 2 }, "s": { "a": 0, "k": [100, 100], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 2 }, "o": { "a": 0, "k": 100, "ix": 2 } }, "ao": 0, "shapes": [{ "ty": "gr", "it": [{ "ty": "gr", "it": .........完整代码请登录后点击上方下载按钮下载查看
网友评论0