Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
keyframe-animation
Advanced tools
Pure javascript animation manager similar to css animations with keyframes.
Pure javascript animation manager similar to css animations with keyframes.
via NPM
npm i keyframe-animation
via Yarn
yarn add keyframe-animation
const KeyframeAnimation = require('keyframe-animation');
const myAnimation = new KeyframeAnimation();
myAnimation.set({
fps: 60, // frames per second
duration: 2, // seconds
animation: 'linear', // linear, ease-out
iterationCount: 'infinite' // 1, 2, ... , infinite
})
// Similar to CSS Animations
.keyframes({
0: {
width: 100,
}
50: {
width: 150,
},
100: {
width: 200
}
});
// Start the animation
myAnimation.animate(data => {
document.getElementById('myBox').style.width = `${data.width}px`;
});
// Stop the animation
myAnimation.stop();
// HTML
<div id="myBox" style="width: 100px; height:2px; background-color: crimson;"></div>
import KeyframeAnimation from 'keyframe-animation';
export default class MyComponent extends React.Component {
constructor(props) {
super(props);
this.width = 100;
}
startAnimation() {
...
.animate(data => {
this.width = data.width;
this.forceUpdate(); // Important
});
}
render() {
return (
...
);
}
}
You can decrease the fps to improve the performance.
(50 - 40) is recommended for React/React Native.
FAQs
Pure javascript animation manager similar to css animations with keyframes.
We found that keyframe-animation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.