简体   繁体   English

我如何在我的项目中使用 useanimations.com 提供的图标

[英]How I can use icons provided by useanimations.com in my project

I am trying to use icons provided by useanimations.com in my project but after downloading a specific icon, I don't know what to do with the json file of icon...and somehow also the animation in not running?我正在尝试在我的项目中使用由 useanimations.com 提供的图标,但在下载特定图标后,我不知道如何处理图标的 json 文件......不知何故动画没有运行? please help请帮忙

This site explains how to set up the Lottie Player to run the animations and then link to the animations.该站点解释了如何设置 Lottie Player 以运行动画,然后链接到动画。

https://lottiefiles.com/blog/working-with-lottie/how-to-add-lottie-animation-in-web-page https://lottiefiles.com/blog/working-with-lottie/how-to-add-lottie-animation-in-web-page

Step 1: Add the following script to the head section of the page:步骤1:在页面的head部分添加以下脚本:

<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>

Step 2: Get the URL of the animation either by uploading it to your website or use the public link第 2 步:通过将动画上传到您的网站或使用公共链接来获取动画的 URL

Step 3: Copy and paste the below code where you want it to appear on your site.第 3 步:将以下代码复制并粘贴到您希望它出现在您网站上的位置。 The URL should be the link to the Lottie animation file. URL 应该是 Lottie 动画文件的链接。

<lottie-player src="<URL HERE>" background="transparent"  speed="1"  style="width: 300px; height: 300px;" loop controls autoplay></lottie-player>

That's it.而已。

Use Lotties player使用Lotties播放器

Source : https://lottiefiles.com/web-player来源: https : //lottiefiles.com/web-player

 <script src="https://unpkg.com/@lottiefiles/lottie-player@0.4.0/dist/lottie-player.js"></script> <lottie-player id="firstLottie" src="https://assets8.lottiefiles.com/packages/lf20_rx3jheuy.json" style="width:200px; height: 200px;" autoplay loop></lottie-player>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在dijit.menuItems中使用自己的图标? - How can I use my own icons in dijit.menuItems? 如何使用 material-ui 图标中的图标? - How can I use Icons from material-ui icons? 如何在占位符中使用 React 图标? - How can I use React icons in Placeholder? 如何在我要基于它创建的自定义库中使用 leaflet 中提供的 distanceTo 方法? - How can I use the distanceTo method provided in leaflet in my custom library that I want to create based on it? 我应该使用图标库还是手动将图标下载到我的 ReactJs 项目中? - Should I use a library for Icons or manually download Icons into my ReactJs project? 如何在我的 vue 项目中使用 mailjet? - How can I use mailjet with my vue project? 我如何在我的 vuejs 项目中使用 v-for 循环 - how can i use v-for loop in my vuejs project 使用 flex-box 时如何保持图标居中? 我有一个案例,我在一个页面中有 2 个图标,在另一个页面中有 3 个图标用于反应项目 - How can I keep my icon centered while using flex-box? I have a case where I have 2 icons in 1 page and 3 icons in another for a react project 我如何在我的角度项目中使用此jquery函数 - How can i use this jquery function in my angular project 如何将 JavaScript 用于我的 HTML 项目? - How can I use JavaScript for my HTML Project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM