开发者社区> 镜像站> NPM> keyframe-parser
keyframe-parser
Parse a valid css keyframe string into a Keyframe Object for the Web Animations API
Last updated 3 years ago by yerkopalma .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install keyframe-parser 
SYNC missed versions from official npm registry.

keyframe-parser

Build Status js-standard-style

Parse a valid css keyframe string into a Keyframe Object for the Web Animations API.

Usage

var keyframe = require('keyframe-parser')
var animation = require('nanoanimation')

var move = animation(keyframe`@keyframes move {
  from {
    top: 0px;
  },
  to {
    top: 100px;
  }
}`, 1000)

move(document.getElementById('elem'), () => console.log('done'))

API

var keyframe = require('keyframe-parser')

A single function is exported and is a tagged template literal. Pass in a string for a css keyframe animation definition, and it will return a Keyframe Object to be used with the Web Animation API.

License

MIT

Current Tags

  • 1.0.1                                ...           latest (3 years ago)

2 Versions

  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (4)
Dependents (0)
None