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

@tap-payments/loader

v2.0.1

Published

Animated tap logo

Downloads

2,772

Readme

Loader

Loader is a React component to animate tap logo. It is developed using Lottie and After Effects software. Component modifiable features are color, size, and duration/speed.

Color replacement

Modify the data.json file (the animation src) by using this website: Color editor Second URL. Animation json source file will be found in the gitHub repo. To implement a different color animation, refer to the Advanced implementation section.

Loader with closing animation

To get a closing animation, refer to the Adding a closing animation

Demo

Animation Files

Animation JSON files are available in the src file

Install the package

npm i --save @tap-payments/loader

Usage

  1. Import the loader component.
import {Loader} from '@tap-payments/loader'
  1. Wrap the loader component in a container.
<div>
  <Loader
  toggleAnimation={this.state.animating}
  duration={5}
  />
</div>
  1. Toggle it with a true/false variable to control the animation.
  2. Pass {true} to toggleAnimation to start the animation immediately.
  3. Pass {false} to toggleAnimation to stop the animation whenever it is possible.

Advanced

This component can be used to control any animation. To pass the animation source, import it in the parent component and pass it to the Loader component, the default duration is 10 sec, if the file has different duration, it should be passed also.

example:

Import the animation file:

import * as animationData from './data.json'

Pass it to the component, suppose that the new animation duration is 5 sec.

<Loader
toggleAnimation={this.state.animating}
duration={5.0}
animationData={animationData}
dataDuration={5.0}
/>

It is possible to change the duration of the animation by controlling duration prop, but dataDuration prop should be similar to the exporting settings in After Effects, in Tap Loader it is 10.0 sec.

Closing_Animation

Another animation can be integrated with the regular loading animation. This is done for the purpose of success, error and warning closing animation. To add the closing animation, pass the data of the closing animation as a json file in the props and it will be shown when the original animation is finished.

example:

Import the animation file:

import * as successAnimation from './success.json'

Pass it to the component.

  <Loader
  toggleAnimation={this.state.animating}
  duration={this.state.animating?3.5:2}
  animationData={animationData}
  secondData={successAnimation}
  secondDuration={10}
  />
duration= {this.state.animating?3.5:2} // the duration of the original motion, an 'if' condition is used to make the loader close faster.
animationData={animationData} // the animation src file of the loader
secondData= {successAnimation} // the animation src file of the closing animation
secondDuration = {10} // the duration of the closing animation, 10 = 100% of the AE file

To change the duration of the closing animation, change secondDuration and it will act as a percentage of the src file duration. Default duration is 10. If the duration of AE file animation is known, use secondDuration with secondDataDuration to get the exact preferred duration.

Main Options

| Name | Type | Default | Description | | :--- | :---: | :---: | --- | |animationData|JSON|tap loader JSON file|the src file| |toggleAnimation|bool|false|Start/Stop controller| |duration|float|10.0|The duration of full animation| |dataDuration|float|10.0|The duration of the source file (from After Effects)| |completeIndicator|function|null|To indicate every full loop| |secondData|json|null|The src file of the second animation| |secondDuration|float|10.0|The duration of full animation (second animation)| |secondDataDuration|float|10.0|The duration of the source file of the second animation (from After Effects)|

Author