@myway42/sparkly
v1.0.3
Published
Add sparkle to your text, a webComponent built with JavaScript and CSS
Downloads
246
Maintainers
Readme
<sparkly-view>
Easily start.
<sparkly-view>hello world</sparkly-view>
Description
This is a custom element that allows you to add sparkly animation to the text
、button
、img
and so on.
Installation
npm install @myway42/sparkly
then import
import '@myway42/sparkly'
Or
import Sparkly from '@myway42/sparkly/dist/component.js'
// same as previously
Sparkly.register()
// registering as a different tag-name:
Sparkly.register('nice-sparkly')
Or grab from unpkg.com CDN:
<script src="https://unpkg.com/@myway42/sparkly" type="module"></script>
Usage
<sparkly-view canclick="true" color="red" minsize="12" maxsize="24">hello world</sparkly-view>
Attributes
| Name | type | default | Description |
| :------: | :-----: | :-----: | :---------------------------------------------: |
| canclick | boolean | false | Whether the Sparkly
can be click to hide/show |
| color | string | #FFC700 | Sparkle
color |
| minsize | number | 10 | Sparkle
min size |
| maxsize | number | 20 | Sparkle
max size |