croqo/lottie-plugin

Lottie播放器:为您的网站提供轻量级、无损可缩放的动画

安装次数: 79

依赖项: 0

建议者: 0

安全性: 0

星标: 5

关注者: 2

分支: 1

类型:october-plugin

v3.0.0-alpha-2 2023-10-03 10:42 UTC

This package is auto-updated.

Last update: 2024-09-15 09:32:29 UTC


README

October CMS插件允许您轻松地将Lottie动画添加到您的网站上。

og-image

🤔 什么是Lottie?@lottiefiles.com

组件播放器

在INI部分使用此代码将JS播放器注入当前页面/部分/布局。

[lottie]

完成之后,您可以使用Lottie播放器,并使用不同值的url属性多次。

  • url

    指向Lottie动画json的HTTP链接。

    以下示例代码将生成两个连续的动画

    {% component 'lottie' url='https://path.to/file1.json' %}
    
    {% component 'lottie' url='https://path.to/file2.json' %}
  • 查看

    Lottie播放器CSS预设

    {% component 'lottie' url='https://path.to/file1.json' look='image' %}}
    
    {% component 'lottie' url='https://path.to/file2.json' look='wallpaper' %}}
  • 长宽比

    preserveAspectRatio选项(rendererSettings)

    {% component 'lottie' url='https://path.to/file1.json' ratio='xMidYMid slice' %}}    
    
    {% component 'lottie' url='https://path.to/file2.json' ratio='xMidYMid meet' %}}