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

riot-animation-context

v0.1.11

Published

animation-context Riot JS Tag animation context for dealing with css transitions and animated addition and removal of riot tags

Downloads

27

Readme

riot-animation-context riot tag (animation-context)

Build Status

Riot JS Tag animation context for dealing with css transitions and animated addition and removal of riot tags or just dynamically ineracting with css animations

Demonstration

riot-animation-context

Includes animate.css for base animations, these can be overridden or added to in external css.

Why not just use animate.css

You can still use animate.css. This tag helps when dynamically mounting riotjs tags and causing some animation effects to occur. Because the animation can be controlled through opts, the effects themselves can be dynamically changed and played.

The other benefit is that it handles animation on unmount of riot tags nicely.

Getting Started

1. Installation

npm install riot-animation-context

2. Examples

   
   require('riot-animation-context')
   

the following animation-context when mounted will immediately rubberBand, then wait 2000ms and lightSpeedOut note that inner scope belongs to animation-context so to call methods and interact with opts and properties of the outer tag the parent property is required. Because animate-on-mount is true, the animate-out will also cause the animation-context to unmount once it is finished.


<my-riot-tag>
    <!-- animate anything inside the animation context -->
    <animation-context name="animator"
        animate-on-mount="true" 
        animate-infinitely="true" 
        animate-in="rubberBand" 
        animate-auto-out-delay="2000"
        animate-out="lightSpeedOut"
        >
        <button onclick={ parent.becomeAwesome }>CLICK ME TO <em>BECOME AWESOME</em></button>
    </animation-context>

    <script>
        // By assigning a name to the animation context you can use it 
        // as in the following code sample:-
        // this.animator.in()
        // this.animator.out()
        // in() and out() font need to be manually called because we have 
        // supplied the animate-on-mount="true" attribute
        
        this.becomeAwesome = function() {
            alert('impossible!')
        }
    </script>
</my-riot-tag>

<script>
    riot.mount('my-riot-tag');
</script>

3. Riot Tag

animation-context Tag Attributes

  • animate-in="{{class}}" eg. "lightSpeedIn", "fadeIn" The css animation to play when the tag's in() method is called
    <animation-context animate-in="rotateIn">...</animation-context>
  • animate-infinitely="{{true|false}}" eg. "true", "false" Play the animate-in animation infinitely when it is called
    <animation-context animate-infinitely="true">...</animation-context>
  • animate-out="{{class}}" eg. "lightSpeedOut", "rotateOut" The css animation to play when the tag's out() method is called
    <animation-context animate-out="fadeOut">...</animation-context>
  • animate-on-mount="{{true|false}}" eg. "true", "false" Start the animate-in animation as soon as the tag is mounted
    <animation-context animate-on-mount="false">...</animation-context>
  • animate-auto-in-delay="{{milliseconds}}" eg. "0", "1000" Wait x number of milliseconds before animate-in when animate-on-mount is true
    <animation-context animate-auto-in-delay="500">...</animation-context>
  • animate-auto-out-delay="{{milliseconds}}" eg. "0", "1000" Wait x number of milliseconds after animate-in has finished to start playing animate-out
    <animation-context animate-auto-out-delay="2000" animate-out="hinge">...</animation-context>

Copyright and license

Copyright (c) 2015 Anycode [email protected]

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.