1.1.3 • Published 5 months ago

react-flying-item v1.1.3

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

react-flying-item

Npm Library to make the selected item image seem to fly to top left corner (e.g: fly to cart icon)

NPM JavaScript Style Guide Bundle Size Downloads PRs Welcome

Demo CodePen

Example Gif

Install

npm install --save react-flying-item

Customizable values props

Field NameTypeRequired/OptionalDefault valueDetails
targetTopStringOptional'5%'By default, animation ends in the top 5%
targetLeftStringOptional'5%'By default, animation ends in the left 5%
customAnimationStringOptional'' (e.g: 20%{translate:80% 80%;})customizing the animation from 1% to 99%
animationDurationIntOptional0.9By default, animations takes 0.9s to finish
flyingItemStylingObjectOptional{ borderRadius: '4rem', width: '8rem' }Custom style the flying item

Main Behavior Points

  • Animation period is 900 ms
  • Animation ends with Opacity 0
  • Position is Fixed and values of top and left are reset from event mouse clientX,clientY to 5%,5%

Usage

import React from 'react'
import FlyingButton from 'react-flying-item'

const App = () => {
  return (
    <div>
      <img src='[src-url]]' alt='' />
      <FlyingButton src='[src-url]'>fly</FlyingButton>
    </div>
  )
}

export default App

License

MIT © Ahmed-Elswerky

1.1.4

5 months ago

1.1.3

5 months ago

1.1.2

2 years ago

1.1.1

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago