Skip to content

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

License

Notifications You must be signed in to change notification settings

YerkoPalma/keyframe-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published