1.0.1 • Published 6 years ago
snap-fade-away v1.0.1
snap-fade-away
The effection like Thanos snapping finger
Installation
npm install snap-fade-away
# or use yarn
yarn add snap-fade-awayUsage
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-neworgit 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, moyuyc95@gmail.com.
License
MIT - imcuttle 🐟