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

timeplate

v0.1.0

Published

A modern animation timeline built for performance and simplify some complex usage for animator needs.

Downloads

7

Readme

Software License Tweet

Timeplate

A modern animation timeline built for performance and simplify some complex usage for animator needs.

Dependent on EventPine as Event Manager.

<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>

Example

Some feature still being improved and undocumented yet. Being used by StefansArya for some project. If you're interested with this library please reach me on GitHub to update the documentation.

Timeline for selected elements

Any animateable CSS can used for keyframe, including filter (blur, hueRotate, etc).

var plate = Timeplate.for(/* El Selector */ '.Apple', /* Keyframes */[
  {offset:0  , translateX: '50px', scaleY: 1, easing: 'ease-in'},
  {offset:0.1, translateX: '120px'},
  {offset:0.5, translateX: '100px', emit: "I'm triggered"},
  {offset:1  , translateX: '75px', scaleY: 0.5},
], {duration: 1000});

// plate.duration = 1000;

plate.on("I'm triggered", function(){
  console.log("Henlo", plate.currentTime);
});

// plate.currentTime = 100; -> 100ms = offset 0.1
// Will immediately play from 100ms if above was set

plate.play();

Parallel Timeline

Animate every timeline parallely.

var plate = Timeplate.parallel(/* Default duration for one timeline */ 1000);
plate.timeline = [
  Timeplate.for(/* El Selector */ '.Apple', /* Keyframes */[
    {offset:0  , translateX: '50px', scaleY: 1, easing: 'ease-in'},
    {offset:0.1, translateX: '120px'},
    {offset:0.5, translateX: '100px', emit: "I'm triggered"},
    {offset:1  , translateX: '75px', scaleY: 0.5},
  ]),
  Timeplate.for('.Orange', [
    {offset: 0.5, translateX: '75px', scaleY: 0.5, easing: 'ease-in'},
    {offset: 1  , translateX: '50px', scaleY: 1},
  ]),
];

plate.on("I'm triggered", function(){
	console.log("Henlo", plate.currentTime);
});

// plate.currentTime = 100; -> 100ms = offset 0.1
// Will immediately play from 100ms if above was set

plate.play();

Series Timeline

Animate ordered timeline from first index and continue to another timeline.

var plate = Timeplate.series(/* Default duration for a timeline if not set */ 1000);
plate.timeline = [
  Timeplate.series(/* El Selector */ '.Apple', /* Keyframes */[
    {offset:0  , translateX: '50px', scaleY: 1, easing: 'ease-in'},
    {offset:0.1, translateX: '120px'},
    {offset:0.5, translateX: '100px', emit: "I'm triggered"},
    {offset:1  , translateX: '75px', scaleY: 0.5},
  ]),
  Timeplate.for('.Orange', [
    {offset: 0.5, translateX: '75px', scaleY: 0.5, easing: 'ease-in'},
    {offset: 1  , translateX: '50px', scaleY: 1},
  ]),
];

plate.on("I'm triggered", function(){
  console.log("Henlo", plate.currentTime);
});

// plate.currentTime = 100; -> 100ms = offset 0.1
// Will immediately play from 100ms if above was set

plate.play();

Combined Timeline

Play your ordered timeline inside of a timeline easily.

/*
             Series 1 Timeplate

                [Parallel 1]
 [Series 2] --> [Parallel 2] --> [Series 3]
                [Parallel 3]
 */

var Series1 = Timeplate.series(1000);
Series1.timeline = [
  // Series 2
  Timeplate.series(1000, [
    Timeplate.for(...), // Dummy element animation maybe..
  ]),

  // Parallel 1,2,3
  Timeplate.parallel(1000, [
    Timeplate.for(...), // Playing together
    Timeplate.for('.element', [ // Playing together
      {offset: 0.5, emit:"middle animation"}
    ]),
    Timeplate.for(...), // Playing together
  ]),

  // Series 3 (Will be played after Series 2)
  Timeplate.series(1000, [
    Timeplate.for(...),
    Timeplate.for(...),
  ]),
];

Series1.on('middle animation', function(){
  // May be inaccurate
  //                      Series 1 + Paralel * 0.5
  Series1.currentTime === 1000     + 500;
});

Series1.play();

License

Timeplate is under MIT License

But don't forget to put a link to the repository, or share it maybe.