
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
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
The npm package react-component-keyframe-animation receives a total of 0 weekly downloads. As such, react-component-keyframe-animation popularity was classified as not popular.
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
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.