react-simple-animate
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -108,8 +108,7 @@ import * as React from 'react'; | ||
const animationLength = keyframes.length; | ||
return `${keyframes.reduce((previous, keyframe, currentIndex) => { | ||
if (keyframe) { | ||
return `${previous} ${animationLength === 2 ? currentIndex * 100 : parseFloat((100 / (animationLength - 1)).toFixed(2)) * currentIndex}% {${keyframe}}`; | ||
} | ||
return `${previous} ${Object.keys(keyframe)[0]}% {${Object.values(keyframe)[0]}}`; | ||
}, `@keyframes ${animationName} {`)}}`; | ||
return `${keyframes.reduce((previous, keyframe, currentIndex) => typeof keyframe === 'string' | ||
? `${previous} ${animationLength === 2 | ||
? currentIndex * 100 | ||
: parseFloat((100 / (animationLength - 1)).toFixed(2)) * currentIndex}% {${keyframe}}` | ||
: `${previous} ${Object.keys(keyframe)[0]}% {${Object.values(keyframe)[0]}}`, `@keyframes ${animationName} {`)}}`; | ||
} | ||
@@ -116,0 +115,0 @@ |
@@ -111,8 +111,7 @@ 'use strict'; | ||
const animationLength = keyframes.length; | ||
return `${keyframes.reduce((previous, keyframe, currentIndex) => { | ||
if (keyframe) { | ||
return `${previous} ${animationLength === 2 ? currentIndex * 100 : parseFloat((100 / (animationLength - 1)).toFixed(2)) * currentIndex}% {${keyframe}}`; | ||
} | ||
return `${previous} ${Object.keys(keyframe)[0]}% {${Object.values(keyframe)[0]}}`; | ||
}, `@keyframes ${animationName} {`)}}`; | ||
return `${keyframes.reduce((previous, keyframe, currentIndex) => typeof keyframe === 'string' | ||
? `${previous} ${animationLength === 2 | ||
? currentIndex * 100 | ||
: parseFloat((100 / (animationLength - 1)).toFixed(2)) * currentIndex}% {${keyframe}}` | ||
: `${previous} ${Object.keys(keyframe)[0]}% {${Object.values(keyframe)[0]}}`, `@keyframes ${animationName} {`)}}`; | ||
} | ||
@@ -119,0 +118,0 @@ |
{ | ||
"name": "react-simple-animate", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "react simple animate", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
283265
694