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

@marionebl/react-web-animation

v0.7.2

Published

react-web-animation is a set of React components that expose the Web Animations API in a declarative way.

Downloads

4

Readme

react-web-animation

react-web-animation is a set of React components that expose the Web Animations API in a declarative way.

build status npm version npm downloads semantic-release Commitizen friendly

Demos

Check out how you can use it here - http://react-web-animation.surge.sh

Why?

Why use this over other animation libraries for React? react-web-animation uses the Web Animations API polyfill so eventually it will use the native browser implementation and not depend on any third-party animation frameworks or CSS. Chrome has the greatest support for these today and if you view the source on the demos, you can see it isn't using CSS at all!

Web Animations API

Want to know more about the Web Animations API? Here are some great resources.

Installation

react-web-animation requires the following peer dependencies to be installed

npm install react
npm install react-dom
npm install prop-types
npm install react-web-animation

react-web-animation has a runtime dependency on the next version Web Animations API polyfill. The easiest way to get this is to grab it from cdnjs and include it in your application.

<script src="https://cdnjs.cloudflare.com/ajax/libs/web-animations/2.2.1/web-animations-next.min.js"></script>

Features

  • Animate Single Elements with a <Animated.[componentName]> e.g. <Animated.div> and control play state (play, pause, stop, reverse)
  • Animate Single Elements with a <Animation> and control play state (play, pause, stop, reverse)
  • Animate Multiple animations in parallel with a <AnimationGroup>, controlling them with one timeline
  • Animate Multiple animations serially with a <AnimationSequence>, controlling them with one timeline

Usage

Creating an animated element is as simple using an <Animated.[elementName]> component and supplying keyframes and a timing config.

import React, { Component } from 'react';
import { Animated } from 'react-web-animation';


export default class Basic extends Component {

    getKeyFrames() {
        return [
            { transform: 'scale(1)',    opacity: 1,     offset: 0 },
            { transform: 'scale(.5)',   opacity: 0.5,   offset: 0.3 },
            { transform: 'scale(.667)', opacity: 0.667, offset: 0.7875 },
            { transform: 'scale(.6)',   opacity: 0.6,   offset: 1 }
        ];
    }

    getTiming( duration ) {
        return {
            duration,
            easing: 'ease-in-out',
            delay: 0,
            iterations: 2,
            direction: 'alternate',
            fill: 'forwards'
        };
    }

    render() {
        return
            <Animated.div keyframes={this.getKeyFrames()}
                       timing={this.getTiming(2500)}>
                    Web Animations API Rocks
            </Animated.div>;
    }
}

Advanced Usage

For more advanced usage, head over to the source documentation or check out the http://react-web-animation.surge.sh

License

MIT