snap-fade-away
v1.0.1
Published
The effection like Thanos snapping finger
Downloads
3
Maintainers
Readme
snap-fade-away
The effection like Thanos snapping finger
Installation
npm install snap-fade-away
# or use yarn
yarn add snap-fade-away
Usage
const snapFadeAway = require('snap-fade-away')
async (() => {
await snapFadeAway(window.root)
// Animated!
})()
API
snapFadeAway
The effect like Thanos snapping finger
Parameters
elem
{HTMLElement} The animating elementopts
{{}}opts.frameCount
{number} (optional, default20
)opts.debug
{boolean} (optional, defaultfalse
)opts.duration
{string} The animation duration (optional, default'2s'
)opts.relativeElem
{HTMLElement} Mount on where (optional, defaultdocument.documentElement
)opts.canvasClassName
{string} (optional, default'snap-fade-away-canvas'
)
Returns Promise<any>
Contributing
- Fork it!
- Create your new branch:
git checkout -b feature-new
orgit checkout -b fix-which-bug
- Start your magic work now
- Make sure npm test passes
- Commit your changes:
git commit -am 'feat: some description (close #123)'
orgit commit -am 'fix: some description (fix #123)'
- Push to the branch:
git push
- Submit a pull request :)
Authors
This library is written and maintained by imcuttle, [email protected].
License
MIT - imcuttle 🐟