forked from ColinEberhardt/applause-button
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
29 lines (27 loc) · 754 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html>
<html lang="en">
<head>
<title>Clapper test page</title>
<link rel="stylesheet" href="dist/applause-button.css" />
<script src="dist/applause-button.js"></script>
<style>
applause-button {
width: 8rem;
margin-inline: auto;
font-family: sans-serif;
}
</style>
</head>
<body>
<applause-button id="applause" multiclap="true" url="google.com"></applause-button>
<script type="text/javascript">
const button = document.getElementById("applause");
button.initialClapCount.then(function(count) {
console.log("initial clap count", count);
});
button.addEventListener("clapped", function(event) {
console.log("button clapped", event.detail);
});
</script>
</body>
</html>