keyframe-parser
v1.0.1
Published
Parse a valid css keyframe string into a Keyframe Object for the Web Animations API
Downloads
6
Maintainers
Readme
keyframe-parser
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.