@@ -13,12 +13,20 @@ const keyframesSlideOut = require('./keyframes/slideOut');
1313const keyframesFadeIn = require ( './keyframes/fadeIn' ) ;
1414const keyframesFadeOut = require ( './keyframes/fadeOut' ) ;
1515
16- module . exports = function ( ) {
17- return function ( { addUtilities, variants } ) {
16+ module . exports = function ( settings = { } , variants = [ 'responsive' ] ) {
17+ return function ( { e, addUtilities, variants } ) {
18+
19+ // set fallback if speed not defined
20+ const animatedSpeed = settings . settings . animatedSpeed ? settings . settings . animatedSpeed : 1000 ;
21+ const heartBeatSpeed = settings . settings . heartBeatSpeed ? settings . settings . heartBeatSpeed : 1000 ;
22+ const hingeSpeed = settings . settings . hingeSpeed ? settings . settings . hingeSpeed : 2000 ;
23+ const bounceInSpeed = settings . settings . bounceInSpeed ? settings . settings . bounceInSpeed : 750 ;
24+ const bounceOutSpeed = settings . settings . bounceOutSpeed ? settings . settings . bounceOutSpeed : 750 ;
25+ const opacity = settings . settings . opacity ? settings . settings . opacity : 1 ;
1826
1927 addUtilities ( {
2028 '.animated' : {
21- animationDuration : '1s' ,
29+ animationDuration : ` ${ animatedSpeed } ms` ,
2230 animationFillMode : 'both'
2331 } ,
2432 '.infinite' : {
@@ -59,12 +67,12 @@ module.exports = function () {
5967 } ,
6068 '.heartBeat' : {
6169 animationName : 'heartBeat' ,
62- animationDuration : '1s' ,
70+ animationDuration : ` ${ heartBeatSpeed } ms` ,
6371 animationTimingFunction : 'ease-in-out'
6472 } ,
6573 '.hinge' : {
6674 animationName : 'hinge' ,
67- animationDuration : '2s' ,
75+ animationDuration : ` ${ hingeSpeed } ms` ,
6876 } ,
6977 '.jackInTheBox' : {
7078 animationName : 'jackInTheBox' ,
@@ -160,7 +168,7 @@ module.exports = function () {
160168 } ,
161169 '.bounceOut' : {
162170 animationName : 'bounceOut' ,
163- animationDuration : '0.75s'
171+ animationDuration : ` ${ bounceOutSpeed } ms` ,
164172 } ,
165173 '.bounceOutDown' : {
166174 animationName : 'bounceOutDown' ,
0 commit comments