The effection like Thanos snapping finger
npm install snap-fade-away
# or use yarn
yarn add snap-fade-away
import snapFadeAway from 'snap-fade-away'
async (() => {
await snapFadeAway(window.root)
// Animated!
})()
The effect like Thanos snapping finger
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>
- 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 :)
This library is written and maintained by imcuttle, moyuyc95@gmail.com.
MIT - imcuttle 🐟