1.0.2 ā€¢ Published 2 months ago

@reslear/dotlottie-player-core v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

dotLottie-player-core

Only fetching and parse functions.

npm npm Libraries.io dependency status for latest release NPM Unpacked Size install size semantic-release

npm.io

šŸ•¹ 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

1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago

0.0.5

1 year ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago