0.0.7 • Published 3 years ago

react-thanos-glove v0.0.7

Weekly downloads
11
License
MIT
Repository
github
Last release
3 years ago

React Thanos Glove

Infinity gauntlet button for react

npm Build Status min minzip

tanos snap tanos time

Installation

yarn:

yarn add react-thanos-glove

npm:

npm install --save react-thanos-glove

Usage

import ThanosGlove from 'react-thanos-glove'

...
<ThanosGlove onClick={handleClick} />
<ThanosGlove size={100} type="time" onAnimationEnd={handleAnimationEnd} mute />
...

Props

size: (optional, number, default:80)

  • Button's height and width. (px)

duration: (optional, number, default: 2000)

  • Anmation's duration. (ms)

type: (optional, 'snap' | 'time', default: 'snap')

  • Button's type

mute: (optional, boolean, default: false)

  • Whether mute the action sound

onClick: (optional, (e: MouseEvent) => void)

  • Glove onClick handler

onAnimationEnd: (optional, (e: AnimationEvent) => void)

If you want to change type of the glove, use this api rather than onClick

  • Triggered when glove animation is ended