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

studiojs

v0.0.4

Published

2d rendering engine Focuses on Keyframes Animation

Downloads

16

Readme


studiojs

studiojs 是一款专注于帧动画的、简单的、渐进式的 2D 渲染引擎。

主要包含类: Frame、Track、Stage。 可独立使用、组合使用。

查看 API 使用文档

推荐使用 gka 一键生成数据,gkagka-tpl-studiojs

Install

npm install studiojs

or use CDN

  • https://unpkg.com/studiojs/dist/studiojs.min.js

Usage

Frame

Frame 是帧动画的基础单位,声明帧动画的播放内容。

示例: 使用 Frame 播放单个帧动画

var Frame = studiojs.Frame,
    canvas = document.getElementById('myCanvas');

var data = {
    images: [img],
    frames: [
        // x, y, width, height, offX*, offY*, imageIndex*
        [355, 0, 86, 282, 34, 9],
        [853, 27, 79, 76, 37, 9],
        // etc.
    ],
    animations: {
        forward: ["0-24"],
        back: ["24-0"],
    }
};

var material = new Frame(data, "forward", 20, canvas);

setInterval(()=> {
    material.update();
}, 16);

frame   示例完整代码使用gka一键生成示例代码

Track

轨道,能够加入多个 Frame,使其排队顺序播放

示例: 使用 Track + Frame 顺序排队播放多个帧动画

var track = new Track(canvas);

var material1 = new Frame(data, 'forward'),
    material2 = new Frame(data, 'back');

track.add([material1, material2]);

setInterval(()=> {
    track.update();
}, 16);

track  示例完整代码

Stage

舞台,能够包含多个 Track,各个 Track 并列播放, 合并展示

示例: 使用 Stage + Track + Frame 并列播放 Track

var stage = new Stage(canvas)
var track1 = new Track(),
    track2 = new Track();

stage.add([track1, track2]);

//  ...

track1.add([material1, material2]);
track2.add([material3, material4]);

setInterval(()=> {
    stage.update();
}, 16);

stage  示例完整代码

Welcome

  • 欢迎 Pull requests、Issues 一般在24小时内处理
  • 讨论与咨询请+QQ 3201590286 :D

License

MIT

Copyright (c) 2017 - present, joeyguo