Comparing version 1.0.0 to 1.0.1
31
index.js
(function() { | ||
const types = { | ||
'animation':'animationend', | ||
'MSAnimation':'MSAnimationEnd', | ||
'WebkitAnimation':'webkitAnimationEnd', | ||
} | ||
const event = types[ | ||
Object.keys(types).filter(x => | ||
document.body.style.hasOwnProperty(x) | ||
)[0] | ||
] | ||
const Actuate = animations => $ => new Promise ((resolve, reject) => { | ||
@@ -8,20 +20,11 @@ | ||
const event = [ | ||
'animationsend', | ||
'webkitAnimationEnd', | ||
'oAnimationEnd', | ||
'mozAnimationEnd', | ||
'MSAnimationEnd', | ||
] | ||
const done = () => { | ||
const done = _ => { | ||
$.classList.remove('animated', commands[0]) | ||
event.forEach(e => $.removeEventListener(e, done)) | ||
$.removeEventListener(event, done) | ||
commands.shift() | ||
commands.length > 0 ? | ||
animate() : resolve($) | ||
commands.length ? animate() : resolve($) | ||
} | ||
const animate = () => { | ||
event.forEach(e => $.addEventListener(e, done)) | ||
const animate = _ => { | ||
$.addEventListener(event, done) | ||
$.classList.add('animated', commands[0]) | ||
@@ -28,0 +31,0 @@ } |
{ | ||
"name": "actuatejs", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "One line easy actuation of CSS animation sequences.", | ||
"main": "index.js", | ||
"main": "index.min.js", | ||
"repository": { | ||
@@ -10,3 +10,9 @@ "type": "git", | ||
}, | ||
"keywords": ["css", "animate", "animation", "sequencing", "promise"], | ||
"keywords": [ | ||
"css", | ||
"animate", | ||
"animation", | ||
"sequencing", | ||
"promise" | ||
], | ||
"author": "Luke Jackson <lukejacksonn@gmail.com>", | ||
@@ -17,3 +23,18 @@ "license": "MIT", | ||
}, | ||
"homepage": "https://github.com/lukejacksonn/Actuate#readme" | ||
"homepage": "https://github.com/lukejacksonn/Actuate#readme", | ||
"scripts": { | ||
"build": "babel index.js > index.min.js", | ||
"minify": "uglifyjs -c -m -o index.min.js -- index.min.js", | ||
"prepublish": "npm run build && npm run minify" | ||
}, | ||
"babel": { | ||
"presets": [ | ||
"env" | ||
] | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.24.0", | ||
"babel-preset-env": "^1.3.2", | ||
"uglify-js": "^2.8.21" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6414
5
31
3