npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sequence-frames

v1.0.0

Published

这是一个图片序列帧播放项目,通过js能够实现图片的顺序播放,循环播放。

Downloads

3

Readme

SequenceFrames

这是一个图片序列帧播放项目,通过js能够实现图片的顺序播放,循环播放。

This is a picture frame sequence of play items, the order can be achieved by js picture playback, loop playback.

NPM

使用方法:

<div id="mycanvas" width=1000 height=562></div>
<script>
var sf
function slFun(){
	var arr =['img1.jpg','img2.jpg','img3.jpg']
	sf = new SequenceFrames("mycanvas",arr,1000,562,{autoPlay:true,fps:10,onLoaded:()=>{
		sf.play();
	}});
}
slFun();
</script>

SequenceFrames(id,array,width,height,{fps:30,autoPlay:true,homePage:10,onLoaded=>{},onComplate:()=>{}})


SequenceFrames初始化参数


| 属性 | 说明 | |---|---| | id| 装载div id | | array| 序列帧数组 | | width| canvas的宽 | | hieght| canvas的高 | | autoPlay| true/false 设置自动播放 | | fps| number 设置帧率 | | homePage| number 设置第一帧 | | onLoaded| function 图片加载完毕 | | onComplate| function 播放完毕 |


SequenceFrames可用方法


| 方法 | 说明 | 示例| |---|---|---| | play() | 顺序播放 | sf.play()| | pause() | 暂停播放 | sf.pause()| | stop() | 停止播放,回到第一帧 | sf.stop()| | reverse() | 倒序播放 | sf.reverse()| | nextFrame() | 向后播放一帧 | sf.nextFrame();| | prevFrame() | 向前播放一帧 | sf.prevFrame(); | | setLoop(int,int) | 设置循环帧 |sf.setLoop(10,20)| | gotoAndPlay(int) | 从第n帧开始播放 | sf.gotoAndPlay(10)| | gotoAndStop(int) | 停止到第n帧 | sf.gotoAndStop(10)| | loop() | 循环播放 | sf.loop(10,20,yoyo);yoyo=true/false //正循环和倒循环| | playTo(int) | 播放并停止到某帧 | sf.playTo(20)|

demo