Coder Social home page Coder Social logo

realdennis / emoji-claps Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 0.0 302 KB

<emoji-claps /> An experience-addicted web component for claping / liking / disliking.

License: MIT License

HTML 9.22% JavaScript 6.26% TypeScript 84.51%
web-component web-components lit-element lit-html web-animation typescript custom-elements shadowdom

emoji-claps's Introduction

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

emoji-claps's People

Contributors

gh-action-bump-version avatar realdennis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.