
Security News
Risky Biz Podcast: AI Agents Are Raising the Stakes for Software Supply Chain Security
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.
react-component-keyframe-animation
Advanced tools
React KeyframeAnimation
npm install react-component-keyframe-animation --save
import KeyframeAnimation from 'react-component-keyframe-animation'
export default class XX extends Component{
render(){
return (
<KeyframeAnimation
name='test'
frames={['1.png','2.png','3.png']}></KeyframeAnimation>
);
}
}
设置关键帧动画的名字
设置关键帧序列,此方式是以单张图片按照横向或者是纵向连续排列,数据结构如下:
{
source: String.isRequired,
direction: String, // ['row', 'column'] 'row' as default
frameCount: Number.isRequired //
}
设置关键帧的帧序列
是否进行预加载.当组件第一次render完成之后将预加载图片资源
是否自动播放.如果设置了预加载,之后再预加载完成之后才会执行,否则立即执行
动画开始时的事件监听
动画结束时的事件监听
动画迭代完一次时的事件监听
样式设置
开始播放动画
停止播放动画
// 当资源预加载完成之后会进行自动播放
<KeyframeAnimation
name='test'
frames={['1.png','2.png','3.png']}></KeyframeAnimation>
<KeyframeAnimation
sprite={{
source:require('./sprite1.jpg'),
frameCount:8
}}
name="test-sprite1"/>
<KeyframeAnimation
sprite={{
source:require('./sprite2.jpg'),
frameCount:8,
direction:'column'
}}
name="test-sprite2"/>
FAQs
React KeyframeAnimation
We found that react-component-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
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.