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 🙏

© 2025 – Pkg Stats / Ryan Hefner

anim8js-scrollmagic

v1.0.4

Published

anim8 ScrollMagic

Readme

anim8js

anim8 your ScrollMagic project.

Installation

  • Bower: bower install anim8js-scrollmagic
  • Node: npm install anim8js-scrollmagic
  • Download: anim8js-scrollmagic

Index

Examples

new ScrollMagic.Scene({triggerElement: '#trigger', duration: '100%'})
  .addTo( controller )
  // Triggered when transitioning from outside to inside scene
  .enter(function() {
    this.animator('#element', function() {
      this.play('tada'); // ANY functions on animator
    });
    // this.animators
    // this.movie
    // this.player
  })
  // Triggered when transitioning from inside to outside scene
  .exit(function() {
    this.animator('#element', function() {
      this.transition('2s', 'rollOut');
    });
  })
  // Triggered when going from inside scene to BEFORE scene
  .before(function() {
    this.animators('#letters', function() {
      this.sequence( 100 ).play('fadeIn'); // ANY functions on animators
    });
  })
  // Triggered when going from inside scene to AFTER scene
  .after(function() {
    this.movie( movie, function() {
      this.play(); // ANY functions on MoviePlayer
    });
  })
  // Triggered while in scene - the calls are interpolated while scrolling
  .during(function() {
    this.animator('#box', function() {
      this.play('wiggle');
    });
  })
  // Generic Transitioning (any state to AFTER scene)
  .transition('*', 'AFTER', function() {
    this.animator('#element', function() {
      this.queue('wiggle inf');
    });
  })
  // Multiple
  listen('enter before *>AFTER', function() {
    // Execute on enter, when we go before the scene, and when we go after the scene
  })
  // A short cut to a single call
  .animate('during', 'animator', '#box', 'play', 'wiggle')
  // Switch the direction of the scene
  .setBackwards( true )
;

Documentation

This plugin works by detecting events relative to the current scene, and invoking a function which builds commands to play when the event is triggered.

Events (occurs when you...)

  • after: go from inside the scene to AFTER, or if you land on the page AFTER the scene.
  • fromAfter: go from AFTER the scene to anywhere else
  • before: go from inside the scene to BEFORE or if you land on the page BEFORE the scene.
  • fromBefore: go from BEFORE the scene to anywhere else
  • enter: go from outside the scene to inside or if you land on the page in the scene
  • exit: go from inside the scene to outside
  • any: go from any state to another
  • start: land on the page
  • startBefore: land on the page before the scene
  • startAfter: land on the page after the scene
  • startDuring: land on the page inside the scene
  • intro: same as enter except it applies the initial state of the animations if the user lands on the page BEFORE the scene
  • outro: same as exit except it applies the final state of the animations if the user lands on the page AFTER the scene
  • during: are scrolling through the scene. animations are interpolated from start to finish over the duration of the scene

You can listen for events by using the event name as a function and passing a function, or by using the following functions:

  • listen: animate on multiple events specified in a space-delimited string or array of strings
  • transition: animate when from one state to another - the events above use this function

Build Commands

  • animator( subject or query, function which makes animator calls )
  • animators( subjects or query, function which makes animators calls )
  • movie( movie, function which makes movie player calls )
  • player( player, function which makes movie player calls )

Quick Animate

This allows you to add animations in a shorthand manner:

  • animate( event, build, subject, subject method, subject arguments... )

Backwards

ScrollMagic works by having the user scroll down or to the right of a page. If you set a scene to backwards with setBackwards( true ) then the BEFORE/AFTER and progress through a scene is swapped for anim8js functions. This allows you to have scroll up and scroll left pages (make sure to set the scrollbar the whole way to the bottom/right when you initialize your scenes)