1.0.3 • Published 2 years ago
@myway42/sparkly v1.0.3
\
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/sparklythen 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 |