2.0.0 • Published 2 years ago

reshake v2.0.0

Weekly downloads
3,055
License
MIT
Repository
-
Last release
2 years ago

reshake

CSShake as a React Functional Component.

Playground :: Blog Post (ES)
npm i --save reshake styled-components

Full customizable way

import React from 'react'
import { Shake } from 'reshake'

const MyShake = () => (
  <Shake h={10} v={0} r={3}>
    Brrr...
  </Shake>
)

Available props:

PropDescTypeDefaultResult unit
hmax horizontalNumber5px
vmax verticalNumber5px
rmax rotationNumber5deg
durcomplete animation cycle durationNumber300ms
qiterations quantityNumber String'infinite'
tfCSS animation-timing-functionString'ease-in-out'
intinterval between each @keyframe, a kind of fine tuning for the animationNumber10%
maxmax @keyframe value, in case other than 100% creates a pause in the animationNumber100%
origCSS transform-originString'center center'
fixedfixed animationBooleanfalse
freezpause in the animation when interactingBooleanfalse
activeactive the animationsBooleantrue
triggerCSS pseudo-class which interacts with animationStringtrue
fixedStopAllows to stop the animation with trigger when animation is fixedStringfalse

Easy way with defaults:

import React from 'react'
import { ShakeLittle, ShakeSlow, ShakeHorizontal } from 'reshake'

const MoreShakes = () => (
  <div>
    <ShakeLittle>Tiny brrr...</ShakeLittle>
    <ShakeSlow>SlowMo ving...</ShakeSlow>
    <ShakeHorizontal>
      <span>āœ‹</span>
    </ShakeHorizontal>
  </div>
)

Available Components:

  • <ShakeLittle />
  • <ShakeSlow />
  • <ShakeHard />
  • <ShakeHorizontal />
  • <ShakeVertical />
  • <ShakeRotate />
  • <ShakeCrazy />

All components accept also the same props as <Shake />. The defaults could be imported as

import { shakes } from reshake

Playground

2.0.0

2 years ago

1.2.4

3 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.8

7 years ago

1.0.7

8 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago