DEV Community

Sam Prince Franklin K
Sam Prince Franklin K

Posted on

3 2

How to Lotify?

What is Lottie?
A Lottie is a JSON-based animation file format that allows designers to distribute animations on any platform just like static assets. They are tiny files that can be scaled up or down without pixelation and operate on any device.


Lottifiels.com - A sample

You have a Lottie or dotLottie format file. Let's get started on incorporating it into your website. This method may be applied to any webpage, blog, or platform that allows you to modify HTML.

Insert a script tag into the LottieFiles web player component:

LottieFiles maintains the lottie-player> web component, which allows you to simply put a Lottie player anywhere else on your webpage by utilising our unique web component. To include the web component, copy the script URL for the player and paste it into the head> section of your page HTML (or anywhere on the page).

lottiefiles workspace

This is how your workspace of lottifiles looks :)

lottifiles workspace

By clicking, you will get the above interface where you get the JavaScript code for the above animation made using Adobe After Effects.

Sample :

<script src="https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js"></script>
<lottie-player src="https://assets1.lottiefiles.com/packages/lf20_kyu7xb1v.json"  background="transparent"  speed="1"  style="width: 300px; height: 300px;"  loop controls autoplay></lottie-player>
Enter fullscreen mode Exit fullscreen mode

Editing your HTML file with the JavaScript block from the Lottiefiles :

Here below, I have added the Lottifiles script in the Line 64 & 65

javascript code in line 64 &65

So by this way, you can add Adobe After Effects animations to your Webpages :)

SurveyJS custom survey software

Simplify data collection in your JS app with a fully integrated form management platform. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more. Integrates with any backend system, giving you full control over your data and no user limits.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more