deathcrafter / dotlottie-player-core

dotLottie player core

Home Page:dotlottie-player-core-playground.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dotLottie-player-core

Only fetching and parse functions.

🕹 Live Playground

Features

  • 🏎 High performance (using fflate)
  • ⚙️ Fetch API based
  • 📦 CJS and ESM support
  • 💪 fylly typed with TypeScript

Install

pnpm add @reslear/dotlottie-player-core

Usage

fetchLottie

fetch method for get animation and parse to lottie json.

import { fetchLottie } from '@reslear/dotlottie-player-core'

const lottieJson = await fetchLottie('/my-animation.lottie')

// {"v":"5.6.8","fr":24,"ip":0,"op":144,"w":2161,"h"...}

Arguments:

  1. url - path to .lottie, .json animation file

also support base64 data URI

fetchLottie('data:application/json;base64,<base64>')
  1. fetchOptions - Fetch API options
fetchLottie(url, {
  mode: 'no-cors',
})

Inspired

License

MIT by @reslear

About

dotLottie player core

dotlottie-player-core-playground.vercel.app

License:MIT License


Languages

Language:TypeScript 79.2%Language:CSS 17.1%Language:HTML 3.7%