本地启动服务即可
- 将
dist
下的资源放在项目的public
等,几个文件要在同一个目录下 - 页面
script
加载tgsticker.min.js
- 页面动画的标签为如下,其他
srcset
为pako
压缩后的文件, 参考index.js
<picture class="js-tgsticker"><source type="application/x-tgsticker" srcset="/json/8940838e7dddc787d8"></picture>
- 开启动画:
document.querySelectorAll('.js-tgsticker').forEach(function (imgEl) {
RLottie.init(imgEl, {"maxDeviceRatio":2, "cachingModulo":3, "unsupportedURL":"\/?notgs=1"});
});