NotifyCss
Notify CSS animation/transition events
GOAL:
Provide a simple way of adding/removing event listeners for CSS animation/transition.
Live demo
Build Requires:
- NodeJs
- Gulp
Installation
$ npm install notifycss --save-dev
Gulp Tasks
gulp gulp gulp
Testing:
npm test
Package contains two files:
dist/notifycssdist/notifycss-transpiled
Ways to import
//ES6import notifyCss from './notifycss'; //CommonJSvar notifyCss = require('notifycss-transpiled.js'); //inline script
CSS Demo
button {
opacity:0;
transition: opacity .3s;
}
h1 {
animation:animationShow .5s 1 forwards cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
@keyframes animationShow {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
Usage ES6
; //setuplet notifyCss = ; //DOM elementlet elm = document0; //add transition listener to an DOM elementnotifyCss; //add animation listener to any animation on the elementnotifyCss; //add animation listener to a specific animation by namenotifyCss; //remove transition listener from the elementnotifyCss; //remove animation listener from the elementnotifyCss;
Usage (Transpiled)
//setupvar notifyCss = ; //DOM elementvar elm = document0; //add transition listener to an DOM elementnotifyCss; //add animation listener to any animation on the elementnotifyCss; //add animation listener to a specific animation by namenotifyCss; //remove transition listener from the elementnotifyCss; //remove animation listener from the elementnotifyCss;