lottie实现下载按钮点击动画效果代码

代码语言:html

所属分类:其他

代码描述:lottie实现下载按钮点击动画效果代码

代码标签: 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": [{ "ty": "sh", "d": 1, "ks": { "a": 1, "k": [{ "t": 0, "s": [{ "c": false, "v": [[0, 11], [0, 14], [2, 16], [8.057408142089848, 16], [14, 16], [16, 14], [16, 11]], "i": [[0, 0], [0, -1], [-1.10457, 0], [-2.0191360473632827, 0], [-1.9808639526367173, 0], [0, 1.1046000000000014], [0, 1]], "o": [[0, 1], [0, 1.1046000000000014], [2.0191360473632827, 0], [1.9808639526367173, 0], [1.1046000000000014, 0], [0, -1], [0, 0]] }], "i": { "x": [0.75], "y": [0.75] }, "o": { "x": [0.25], "y": [0.25] } }, { "t": 11, "s": [{ "c": false, "v": [[0, 11], [0, 14], [2, 16], [8.057408142089848, 16], [14, 16], [16, 14], [16, 11]], "i": [[0, 0], [0, -1], [-1.10457, 0], [-2.0191360473632827, 0], [-1.9808639526367173, 0], [0, 1.1046000000000014], [0, 1]], "o": [[0, 1], [0, 1.1046000000000014], [2.0191360473632827, 0], [1.9808639526367173, 0], [1.1046000000000014, 0], [0, -1], [0, 0]] }], "i": { "x": [0.75], "y": [0.75] }, "o": { "x": [0.25], "y": [0.25] } }, { "t": 20, "s": [{ "c": false, "v": [[0, 11], [0, 14.62092399597168], [2.1115846633911133, 17.028654098510742], [8, 17.88016700744629], [13.9740571975708, 17.028654098510742], [16, 14.62092399597168], [16, 11]], "i": [[0, 0], [0, -1], [-1.380039930343628, -0.3817138671875], [-2.0191360473632827, 0], [-1.5562171936035156, 0.5285263061523438], [0, 1.1046000000000014], [0, 1]], "o": [[0, 1], [0, 1.1046000000000014], [1.3800396919250488, 0.3817138671875], [1.9808639526367173, 0], [1.5562162399291992, -0.5285263061523438], [0, -1], [0, 0]] }], "i": { "x": [0.75], "y": [0.75] }, "o": { "x": [0.25], "y": [0.25] } }, { "t": 29, "s": [{ "c": false, "v": [[0, 11], [0, 14], [2, 16], [8.057408142089848, 16], [14, 16], [16, 14], [16, 11]], "i": [[0, 0], [0, -1], [-1.10457, 0], [-2.0191360473632827, 0], [-1.9808639526367173, 0], [0, 1.1046000000000014], [0, 1]], "o": [[0, 1], [0, 1.1046000000000014], [2.0191360473632827, 0], [1.9808639526367173, 0], [1.1046000000000014, 0], [0, -1], [0, 0]] }], "i": { "x": [0.75], "y": [0.75] }, "o": { "x": [0.25], "y": [0.25] } }, { "t": 40, "s": [{ "c": false, "v": [[0, 11], [0, 14], [2, 16], [8.057408142089848, 16],
  [14, 16], [16, 14], [16, 11]], "i": [[0, 0], [0, -1], [-1.10457, 0], [-2.0191360473632827, 0], [-1.9808639526367173, 0], [0, 1.1046000000000014], [0, 1]], "o": [[0, 1], [0, 1.1046000000000014], [2.0191360473632827, 0], [1.9808639526367173, 0], [1.1046000000000014, 0], [0, -1], [0, 0]] }], "i": { "x": [0.75], "y": [0.75] }, "o": { "x": [0.25], "y": [0.25] } }], "ix": 2 } }, { "ty": "tm", "s": { "a": 0, "k": 0, "ix": 2 }, "e": { "a": 0, "k": 100, "ix": 2 }, "o": { "a": 0, "k": 0, "ix": 2 }, "m": 1 }, { "ty": "tr", "p": { "a": 0, "k": [-1.77635683940025e-15, -1.77635683940025e-15], "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 }, "sk": { "a": 0, "k": 0, "ix": 2 }, "sa": { "a": 0, "k": 0, "ix": 2 } }] }, { "ty": "gr", "it&quo.........完整代码请登录后点击上方下载按钮下载查看

网友评论0