0.1.1 • Published 9 months ago

re-ani-motion v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Re-Ani-Motion

ReAniMotion is a flexible and customizable animation wrapper component for React. It allows you to easily add various types of animations to your React components, making your UI more engaging and dynamic. AniMotion provides a range of animation options and settings that you can configure to create eye-catching animations without the need for complex CSS or external animation libraries. It provides various animation types and customizable animation settings.

Usage

import { MouseOverMotion, EntryMotion } from 're-ani-motion';

<MouseOverMotion
  animationType="border"
  animationSettings={{ borderColor: 'blue', borderWidth: 1, duration: 0.3, delay: 0.1 }}
  className="custom-box"
  style={{ width: '100px', height: '100px' }}
>
  Hover Me
</MouseOverMotion>

MouseOverMotion

The MouseOverMotion component is a React component that enables smooth animations when hovering over an element.

EntryMotion

The EntryMotion component is a React component that enables smooth animations when page is visible.

List of Effects

Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge Badge

Props

  • animationType (string, default: 'border'): The type of animation to apply when hovering over the element.

  • animationSettings (object, default: {}): Animation settings specific to the chosen animation type.

  • className (string): Additional CSS class names for styling.

  • style (object): Inline styles for the component.

  • children (React nodes): Content to display within the MouseOverMotion component.

Available Animation Types And Settings

  • border: Changes border color and width.

    SettingDescriptionDefault Value
    borderColorBorder color during animationN/A
    borderWidthBorder width during animationN/A
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • background: Changes background color.

    SettingDescriptionDefault Value
    backgroundColorBackground color during animationN/A
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • scale: Applies a scaling effect.

    SettingDescriptionDefault Value
    scaleFactorScaling factor during animation1.2
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • rotate: Applies a rotation effect.

    SettingDescriptionDefault Value
    degreesDegrees of rotation during animationN/A
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • fade: Changes opacity (fade effect).

    SettingDescriptionDefault Value
    fadeValueOpacity value during animationN/A
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • colorChange: Changes text color.

    SettingDescriptionDefault Value
    targetColorTarget text color during animation#000
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • slideUp: Slides the children up.

    SettingDescriptionDefault Value
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • slideDown: Slides the children down.

    SettingDescriptionDefault Value
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • slideLeft: Slides the children left.

    SettingDescriptionDefault Value
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • slideRight: Slides the children right.

    SettingDescriptionDefault Value
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • zoomIn: Zoom in the children.

    SettingDescriptionDefault Value
    zoomCountNumber of times to animate (can use number or string='infinite')1
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • zoomOut: Zoom out the children.

    SettingDescriptionDefault Value
    zoomCountNumber of times to animate (can use number or string='infinite')1
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • bounce: Applies bounce effect.

    SettingDescriptionDefault Value
    bounceCountNumber of times it should bounce (can use number or string='infinite')1
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • spin: Applies spin effect.

    SettingDescriptionDefault Value
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • flip: Applies flip effect.

    SettingDescriptionDefault Value
    flipCountNumber of times it should flip (can use number or string='infinite')1
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • elastic: Applies elastic effect.

    SettingDescriptionDefault Value
    elasticityCountNumber of times it should show elasticity (can use number or string='infinite')1
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • pulse: Applies pulse effect.

    SettingDescriptionDefault Value
    pulseCountNumber of times it should show pulse effect (can use number or string='infinite')1
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • blink: Applies blink effect.

    SettingDescriptionDefault Value
    blinkCountNumber of times it should blink (can use number or string='infinite')1
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • shake: Applies shake effect.

    SettingDescriptionDefault Value
    shakeCountNumber of times it should shake (can use number or string='infinite')1
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • zigzag: Applies zigzag effect.

    SettingDescriptionDefault Value
    zigzagCountNumber of times it should zigzag (can use number or string='infinite')1
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • spring: Applies spring effect.

    SettingDescriptionDefault Value
    springCountNumber of times it should spring (can use number or string='infinite')1
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • fadeIn: Applies fadeIn effect.

    SettingDescriptionDefault Value
    fadeCountNumber of times it should fadeIn (can use number or string='infinite')1
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • fadeOut: Applies fadeOut effect.

    SettingDescriptionDefault Value
    fadeCountNumber of times it should fadeOut (can use number or string='infinite')1
    durationAnimation duration in seconds1
    delayAnimation delay in seconds0

  • spinner: Add a spin loader effect.

    SettingDescriptionDefault Value
    heightHeight of the loader20
    widthWidth of the loader20
    borderWidthBorder width of the loader4
    circleColorColor of the loaderrgba(0, 0, 0, 0.1)
    spinnerColorColor of the loading spinner#000
    speedSpeed of the loader1