定制 trych/kirby-lottie-file-preview 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

trych/kirby-lottie-file-preview

最新稳定版本:1.0.2

Composer 安装命令:

composer require trych/kirby-lottie-file-preview

包简介

Kirby CMS plugin that adds Lottie animation file previews to the panel.

README 文档

README

A Kirby CMS plugin that adds Lottie animation file previews to the panel.

Kirby Lottie File Preview

Features

  • 🎬 Preview Lottie animations directly in the Kirby Panel
  • ⚙️ Configurable player options (controls, autoplay, loop, speed, etc.)
  • 🔧 Custom detail fields support

Installation

Via Composer (recommended)

composer require trych/kirby-lottie-file-preview

Manual Installation

  1. Download the latest release
  2. Extract to site/plugins/lottie-file-preview

Via Git Submodule

git submodule add https://github.com/trych/kirby-lottie-file-preview.git site/plugins/lottie-file-preview

Requirement

  • Kirby v5

Usage

The plugin automatically adds a preview for Lottie JSON files in the panel file view. No additional configuration is required for basic usage.

Configuration

You can customize the plugin behavior with the following properties in your config.php (shown are the default values):

<?php
return [
  'trych.lottie-file-preview' => [
    'controls' => true,            // show player controls
    'autoplay' => true,            // auto-play animations
    'loop' => true,                // loop animations
    'speed' => 1,                  // playback speed
    'background' => 'transparent', // background color
    'direction' => 1,              // 1 = forward, -1 = reverse
    'mode' => 'normal',            // 'normal' or 'bounce'

    // custom detail fields
    'details' => [
      [
        'title' => 'Author',
        'text' => '{{ file.author }}',
        'link' => '{{ file.authorlink.toUrl }}'
      ],
      [
        'title' => 'License',
        'text' => '{{ file.license }}',
        'link' => '{{ file.licenselink.toUrl }}'
      ]
    ]
  ]
];

As shown above, the detail text and link accepts Kirby query strings.

Asset Loading

The plugin automatically handles loading the Lottie player library:

  • Default: Uses CDN (unpkg.com) - cached by browser, always up-to-date
  • Offline support: Automatically uses local copy if assets/lottie-player.js exists

For Offline Usage (Optional)

If you need offline support, simply download the Lottie player:

# Download latest version
curl -o assets/lottie-player.js https://unpkg.com/@lottiefiles/lottie-player@latest/dist/lottie-player.js

Or download it manually and place it in site/plugins/lottie-file-preview/assets/lottie-player.js.

The plugin will detect and use the local file.

Credits

Changelog

See CHANGELOG.md for details.

License

MIT License © 2025 Timo Rychert

统计信息

  • 总下载量: 439
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固