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

@wizdm/animate

v3.1.0

Published

On Scroll Animation for Angular

Downloads

33

Readme

Animate

Animate is an Angular package providing a directive-like component designed to animate its transcluded content. The animation can be selected among a series of attention seekers, entrances and exists inspired by the famous Animate.css. The main purpose of the package, however, is to trigger the selected animation when the element is scrolling into the view.

Usage example

Start by adding the wmAnimate directive to the element you want to animate. The aos flag is then used to enable the "Animate On Scroll" triggering mechanism:

<section wmAnimate="landing" aos> 
  My animated content goes here
</section>

Supported animations

Animations are grouped in three catetgories: Attention seekers, Entrances and Exists.

Attention seekers

Attention seekers animate starting and ending with the original element's style. Possible values are:

beat, bounce, flip, headShake, heartBeat, jello, pulse, rubberBand, shake, swing, tada, wobble.

Entrances

Entrances start with opacity level set to '0' (invisible) and animate ending with the original element's style. Possible entrance values are:

bumpIn, bounceIn, bounceInDown, bounceInLeft, bounceInUp, bounceInRight, fadeIn, fadeInRight, fadeInLeft, fadeInUp, fadeInDown, flipInX, flipInY, jackInTheBox, landing, rollIn, zoomIn, zoomInDown, zoomInLeft, zoomInUp, zoomInRight.

Exists

Exits start from the original element's style ending with the opacity level set to '0' (invisible). Possible exit values are:

bounceOut, bounceOutDown, bounceOutUp, bounceOutRight, bounceOutLeft, fadeOut, fadeOutRight, fadeOutLeft, fadeOutDown, fadeOutUp, hinge, rollOut, zoomOut, zoomOutDown, zoomOutRight, zoomOutUp, zoomOutLeft.

Trigger

The animation will trigger as soon as the component renders if not specified otherwise.

Replay

The animation can be triggered again using the replay input. Every change in this input value will trigger the animation again provided the value can be coerced into a truthful boolean. Use the paused flag to prevevnt the animation from triggering at first in order to get the full control about when the triggering will happen.

Animate On Scroll

Setting the aos flag enables the "Animate On Scroll" mechanism with a default threshold of 0.5, so, the animation triggers as soon as the 50% of the element area intersects the viewport area. The triggering threshold can be customized setting the aos input to a different numeric value from 0 (escluded) up to 1 (included). Setting aos=0 disables the trigger.

When the element scrolls out completely, the trigger resets, so, the animation will trigger as soon as the element enters the visible portion of the viewport again. Use the once flag to prevent the trigger to reset for the animation to run just once.

Timing

By default every animation applies the optimal timing. However, timing can be overridden with the speed input. Possible values are:

  • slower: running the animation with a 3s timing
  • slow: running the animation with a 2s timing
  • normal: running the animation with a 1s timing
  • fast : running the animation with a 500ms timing
  • faster: running the animation with a 300ms timing

Additionally, the animation can be delayed using delay input. The input accepts both a string describing the delay such as '1s' or '250ms' or a number that will be considered a delay expressed in ms.

Viewport

When aos is enabled each animated element's area is checked against the viewport area to evaluate its visibility ratio and trigger the animation accordingly.

The triggering area can optionally be adjusted, so, to shrink (or expand) the effective area by left, top, right and bottom margins:

<div class="container" wmAnimateView top="64">

  <section wmAnimate="landing" aos> 
    My animated content goes here
  </section>
  ...
</div>

By using the wmAnimateView directive on a parent container in the example above, the effective triggering area has been reduced by a 64 pixels offset from the top of the viewport.

Alternatively, by setting the useElement flag, the container's client bounding box will be used as the triggering area instead of the viewport:

<div class="container" wmAnimateView useElement top="64">

  <section wmAnimate="landing" aos> 
    My animated content goes here
  </section>
  ...
</div>

The customizations above will affect the container's children elements only, so, different triggering areas can be used for different containers.