emoji-claps
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

Emoji-Claps

like

An experience-addicted element for claping👏 / liking👍 / disliking👎 .

dislike

What's new?

Yes, you can click and hold to increase the number. Try it on Codepen!

Installation

$ yarn add emoji-claps // ES module

or in browser

<script src="https://unpkg.com/emoji-claps/dist/emoji-claps.umd.js"></script>
<!-- It's umd bundle-->

Polyfill

The animation use Element.animate method and effect.target, it's fancy and imperative but not fully support for low version browser & Safari, so please run the web-animation next polyfill before initial.

<script src="https://rawgit.com/web-animations/web-animations-js/master/web-animations-next-lite.min.js"></script>

Usage

<emoji-claps 
             emoji="👏" 
             currentcount="30" 
             maxcount="50" 
             bullets='["😍","🎉","🔥","😆"]' 
             bulletcount="6" 
             prefix="+"
             ></emoji-claps>

Event

full

The full event will trigger when currentcount === maxcount.

Take an example

const emojiClaps = document.querySelector('emoji-claps');
emojiClaps.addEventListener('full',e=>{
  // Do something if currentcount is 50 (maxcount)
})

click

The click event will trigger when user click emoji-claps.

Take an example

const emojiClaps = document.querySelector('emoji-claps');
emojiClaps.addEventListener('click',e=>{
  // Do something track after user click
})

LICENSE MIT © 2019 realdennis

Readme

Keywords

none

Package Sidebar

Install

npm i emoji-claps

Weekly Downloads

3

Version

0.1.7

License

MIT

Unpacked Size

53.9 kB

Total Files

10

Last publish

Collaborators

  • realdennis