https://github.com/knowankit/google-holi
A npm package similar to google Holi
https://github.com/knowankit/google-holi
colors google google-holi holi holi-npm splash
Last synced: 5 months ago
JSON representation
A npm package similar to google Holi
- Host: GitHub
- URL: https://github.com/knowankit/google-holi
- Owner: knowankit
- Created: 2020-03-21T17:22:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-21T18:43:50.000Z (over 6 years ago)
- Last Synced: 2025-10-28T22:46:12.572Z (8 months ago)
- Topics: colors, google, google-holi, holi, holi-npm, splash
- Size: 10.1 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# google-holi
A Javascript package similar to google Holi.
## Demo
[Click here](https://google-holi.netlify.com/)
## Installation
### Install via npm:
`$ npm install google-holi`
## Usage
To use Google Holi in your website, import `initHoli` from `google-holi`, add the appropriate class to the button.
`$ import initHoli from 'google-holi'`
or use a CDN version by [jsDelivr](https://cdn.jsdelivr.net/npm/google-holi/index.js)
## Code detail
`initHoli` method expects three argument `canvas` element, element to trigger holi splash and element to reset/clear the splash
```
const canvas = document.getElementById('myCanvas')
const triggerElement = document.getElementById('holi-img')
const resetElement = document.getElementById('holi-div')
initHoli(canvas, triggerElement, resetElement)
```