1.0.1 • Published 6 years ago

keyframe-parser v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

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