keyframe-parser

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i keyframe-parser

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

56.9 kB

Total Files

17

Last publish

Collaborators

  • yerkopalma