Lottie

http://airbnb.io/lottie 的 Lottie 文档。「Lottie documentation for http://airbnb.io/lottie」

  • Owner: airbnb/lottie
  • Platform: Android, iOS, Web browsers, Windows
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

适用于 AndroidiOSWebReact NativeWindows 的 Lottie

Lottie(洛蒂)是一个适用于Android、iOS、Web 和 Windows 的库,它可以使用 Bodymovin 解析以 json 格式导出的 Adobe After Effects 动画,并在移动设备和 Web 上原生呈现它们!

第一次,设计人员可以创建和发布精美的动画,而无需工程师费心地手工制作。 他们说一张图片值1,000个字,所以这里有13,000个字:

Lottie Logo animation

Example1

Example2

Example3

Example4

所有这些动画都是在 Adobe After Effects 中创建的,并与 Bodymovin 一起导出,并且无需进行任何额外的工程设计即可进行本地渲染。

Bodymovin 是由 Hernan Torrisi 创建的 After Effects 插件,可将 After Effects 文件导出为 json,并包含一个 JavaScript 网络播放器。 我们基于他的出色工作,将其用法扩展到Android,iOS,React Native和Windows。

在我们的博客文章上阅读有关它的更多信息,或者通过 GitHub 或通过lottie@airbnb.com与我们联系。

其他平台

示例应用

您可以自己构建适用于 Android 的示例应用,也可以从 Play 商店下载。 该示例应用程序包含一些内置的动画,但是还允许您从内部存储或 URL 加载动画。

对于 Windows,您可以使用 Lottie Viewer 应用程序预览 Lottie 动画和 codegen 类,并使用 Lottie Samples 应用程序开始使用代码示例和简单教程。

用 Lottie 运送东西吗?

给我们发送电子邮件至lottie@airbnb.com,很快我们将创建一个包含世界各地 Lottie 的真实用法的证明和用例页面。 我们还有一个内部回归测试存储库,可用来防止您的动画引起回归。

备选方案

  1. 手工构建动画。对于 Android 和 iOS 系统的设计和工程来说,手工构建动画需要花费大量的时间。通常很难甚至不可能证明花这么多时间来做好动画是合理的
  2. Facebook Keyframes(关键帧)。Keyframes 是一个来自 Facebook 的很棒的新库,他们为响应(reactions)而建。然而,Keyframes 不支持 Lottie 的一些特性,如遮罩、蒙层、修剪路径、破折号图案等等
  3. GIF。 Gif 的大小是 bodymovin JSON 的两倍多,并且以固定大小呈现,无法放大以匹配大型和高密度屏幕。
  4. Png序列。 Png 序列比 gif 还要糟糕,因为它们的文件大小通常是 bodymovin json 大小的 30-50 倍,并且也无法放大。
  5. 可绘制矢量动画(仅适用于 Android)。性能更高,因为它在 RenderThread 而不是主线程上运行。仅支持 Lottie 功能的子集。无法手动设置进度。不支持文字或动态颜色。无法以编程方式或通过互联网加载。

为什么叫 Lottie?

洛蒂(Lottie)以德国电影导演和剪影动画的先驱者的名字命名。 她最著名的电影是《阿奇迈德王子历险记》(1926年),这是现存的最古老的长篇动画电影,比沃尔特·迪斯尼的长篇小说《白雪公主和七个小矮人》(1937年)要早十年。

贡献

贡献者非常受欢迎。 只需上传带有更改说明的 PR。

如果您想添加更多 JSON 文件,请随时添加!

问题或功能要求?

归档 github 问题以解决任何意外损坏的问题。 如果 After Effects 文件不起作用,请将其附加到您的问题中。 没有原始文件的调试要困难得多。

(The first version translated by vz on 2020.06.20)

Main metrics

Overview
Name With Ownerairbnb/lottie
Primary LanguageHTML
Program languageHTML (Language Count: 1)
PlatformAndroid, iOS, Web browsers, Windows
License:MIT License
所有者活动
Created At2017-06-21 01:10:05
Pushed At2025-01-03 02:36:39
Last Commit At2025-01-02 18:36:39
Release Count0
用户参与
Stargazers Count4.8k
Watchers Count68
Fork Count323
Commits Count265
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count82
Pull Requests Open Count2
Pull Requests Close Count34
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Lottie for Android, iOS, Web, React Native, and Windows

Lottie is a library for Android, iOS, Web, and Windows that parses Adobe After Effects animations exported as json with Bodymovin and renders them natively on mobile and on the web!

For the first time, designers can create and ship beautiful animations without an engineer painstakingly recreating it by hand. They say a picture is worth 1,000 words so here are 13,000:

Lottie Logo animation

Example1

Example2

Example3

Example4

All of these animations were created in After Effects, exported with Bodymovin, and rendered natively with no additional engineering effort.

Bodymovin is an After Effects plugin created by Hernan Torrisi that exports After effects files as json and includes a javascript web player. We've built on top of his great work to extend its usage to Android, iOS, React Native, and Windows.

Read more about it on our blog post
Or get in touch on GitHub or via lottie@airbnb.com

Other Platforms

Sample App

You can build the sample app for Android yourself or download it from the Play Store. The sample app includes some built in animations but also allows you to load an animation from internal storage or from a url.

For Windows, you can get the Lottie Viewer app to preview Lottie animation and codegen classes, and the Lottie Samples app to get started with code samples and simple tutorials.

Shipping something with Lottie?

Email us at lottie@airbnb.com and soon we will create a testimonals and use cases page with real world usages of Lottie from around the world.
We also have an internal regression testing repo that we can use to prevent causing regressions with your animations.

Alternatives

  1. Build animations by hand. Building animations by hand is a huge time commitment for design and engineering across Android and iOS. It's often hard or even impossible to justify spending so much time to get an animation right.
  2. Facebook Keyframes. Keyframes is a wonderful new library from Facebook that they built for reactions. However, Keyframes doesn't support some of Lottie's features such as masks, mattes, trim paths, dash patterns, and more.
  3. Gifs. Gifs are more than double the size of a bodymovin JSON and are rendered at a fixed size that can't be scaled up to match large and high density screens.
  4. Png sequences. Png sequences are even worse than gifs in that their file sizes are often 30-50x the size of the bodymovin json and also can't be scaled up.
  5. Animated Vector Drawable (Android only). More performant because it runs on the RenderThread instead of the main thread. Supports only a subset of Lottie features. Progress can't be manually set. Doesn't support text or dynamic colors. Can't be loaded programatically or over the internet.

Why is it called Lottie?

Lottie is named after a German film director and the foremost pioneer of silhouette animation. Her best known films are The Adventures of Prince Achmed (1926) – the oldest surviving feature-length animated film, preceding Walt Disney's feature-length Snow White and the Seven Dwarfs (1937) by over ten years
The art of Lotte Reineger

Contributing

Contributors are more than welcome. Just upload a PR with a description of your changes.

If you would like to add more JSON files feel free to do so!

Issues or feature requests?

File github issues for anything that is unexpectedly broken. If an After Effects file is not working, please attach it to your issue. Debugging without the original file is much more difficult.

Articles, Interviews & Podcasts

Here are some articles and podcasts from the Lottie team @ Airbnb

Behind the scenes: Why we built Lottie, our new open-source animation tool here.

Dig into the details and back story with Brandon Withrow and Salih Abdul-Karim on the School of motion podcast

Learn more about Lottie from Gabriel Peal on the Fragmented Podcast

Lottie Animation with Brandon Withrow and Gabriel Peal on Software engineering daily podcast

Community articles and videos

Heres some links from around the community

A Lottie to Like by Nick Butcher

Creating better user experiences with animations and Lottieby Samo Korosec and Stefan Keileithner

How to use Lottie (In Chinese) by PattyDraw

A Beginning’s Guide to Lottie: Creating Amazing Animations in iOS Apps by Simon NG

Take your animations to the next level with Airbnb framework, Lottie by James Rochabrun

iOS Swift Tutorial: Animations with After Effects and Lottie by Brian Advent

iOS Swift Tutorial: Interactive Animations with After Effects and Lottie by Brian Advent

After Effects for wiOS Developers: Dynamic Content in Animations by Brian Advent

Creating cool animations in android using LottieChetan Sachdeva by Chetan Sachdeva

Boost Your User Experience with Lottie for React Native by Samuli Hakoniemi

How to use 'Lottie' in Framer X by ruucm