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

animations.css

v1.0.1

Published

CSS3 Animation Cheat Sheet

Downloads

6

Readme

animations.css npm

CSS3 Animation Cheat Sheet

Installation

  • npm npm install --save-dev animations.css
  • yarn yarn add --dev animations.css
  • bower bower install --save-dev animations.css

How it works

The CSS3 Animation Cheat Sheet is a set of preset, plug-and-play animations for your web projects. All you need to do is add the stylesheet to your website and apply the premade CSS classes to the elements you want animated.

The CSS3 Animation Cheat Sheet uses CSS3 @keyframes and works on all the latest browsers (that's IE 10). Using CSS3 @keyframes, you don't have to worry about positioning the element to accommodate the animations - it will animate into place. Also for users with older browsers, the animated element will be visible and in place, even if the animation doesn't trigger. Below are instructions on how to get started.

Add the animation stylesheet to the <head> element of your webpage:

<head>
  <link rel="stylesheet" href="animations.css">
</head>
  • Replace css with the name of the directory where the animation stylesheet is.

Add an animation class to the element you want animated:

<div id="object" class="slideUp">

Replace slideUp with the desired animation class.

For entrance animations, you need to make them invisible by adding the visibility: hidden property to the animated element:

#object {
  background-color: #fe5652;
  visibility: hidden;
}
  • visibility: hidden; is used to hide elements before the animation is activated.

The values for these animations are relative to the element's size. That means bigger images have more exaggerated animations and smaller images have more subtle animations. While these animations are simple to implement, feel free to tweak values in the stylesheet to get the right effect.

Adding effects

By default, these animations will trigger when the page loads - even if the element is further down the page - but by using jQuery there are many ways you can activate the animations. See how you can use these animations on your website.

Add jQuery to the <head> element of your webpage:

<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
  • Add this before the </body> tag to trigger the animation when the user scrolls to the element:
<script>
  $(window).scroll(function() {
    $('#animatedElement').each(function(){
    var imagePos = $(this).offset().top;

    var topOfWindow = $(window).scrollTop();
      if (imagePos < topOfWindow+400) {
        $(this).addClass("slideUp");
      }
    });
  });
</script>
  • Replace #animatedElement with the ID or class of the element you want animated.
  • Replace slideUp with an animation class.
  • 400 represents the space between the element and the top of the screen. The animation activates when the element is 400px from the top of the screen. Increase this number to make the animation activate sooner.

Add this before the </body> tag to trigger the animation when the user clicks on the element:

<script>
  $('#animatedElement').click(function() {
    $(this).addClass("slideUp");
  });
</script>
  • Replace #animatedElement with the ID or class of the element you want animated.
  • Replace slideUp with an animation class.

License

MIT © Rodney Dennis