Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

nanoanimation

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanoanimation

Safety wrapper around the Web Animation API

Source
npmnpm
Version
2.0.2
Version published
Maintainers
1
Created
Source

nanoanimation

npm version build status downloads js-standard-style

Safety wrapper around the Web Animations API. Allows animations to safely be defined in Node, and browsers that don't support the Web Animation API. Default behavior is to do nothing.

Usage

var animation = require('nanoanimation')
var css = require('sheetify')
var html = require('bel')

css('tachyons')

var el = html`
  <div class="bg-red h5 w5" onclick=${() => animation.play()}>
    Hello planet
  </div>
`

var keyFrames = [
  { transform: 'translateY(0%)' },
  { transform: 'translateY(100%)' }
]

var timingProperties = {
  duration: 1000,
  fill: 'forwards'
}

var animate = animation(keyFrames, timingProperties)
animate(el, function () {
  console.log('event ended')
})
document.body.appendChild(el)

API

animate = animation(keyFrames, timingProperties)

Create a new animation.

WebAnimation = animate(el, [done])

Apply an animation to an element, calls done when finished. Returns the nativate Web Animation object.

See Also

License

MIT

Keywords

animate

FAQs

Package last updated on 28 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts