emoji claps
v0.1.7
鼓掌的體驗成癮元素? / 喜歡? / 不喜歡? 。
是的,您可以click
並hold
以增加數量。在 Codepen 上嘗試!
$ yarn add emoji-claps // ES module
或在瀏覽器中
< script src =" https://unpkg.com/emoji-claps/dist/emoji-claps.umd.js " > </ script >
<!-- It's umd bundle-->
動畫使用Element.animate
方法和effect.target
,它很奇特且命令式,但不完全支援低版本瀏覽器和 Safari,因此請在初始之前運行下一個web-animation next
填充。
< script src =" https://rawgit.com/web-animations/web-animations-js/master/web-animations-next-lite.min.js " > </ script >
< emoji-claps
emoji =" ? "
currentcount =" 30 "
maxcount =" 50 "
bullets =' ["?","?","","?"] '
bulletcount =" 6 "
prefix =" + "
> </ emoji-claps >
當currentcount === maxcount
時, full
事件將會觸發。
舉個例子
const emojiClaps = document . querySelector ( 'emoji-claps' ) ;
emojiClaps . addEventListener ( 'full' , e => {
// Do something if currentcount is 50 (maxcount)
} )
當使用者點擊emoji-claps
時,將觸發click
事件。
舉個例子
const emojiClaps = document . querySelector ( 'emoji-claps' ) ;
emojiClaps . addEventListener ( 'click' , e => {
// Do something track after user click
} )
許可 MIT © 2019 realdennis