-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
37 lines (35 loc) · 951 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
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Counter</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>Counter</h1>
<span class="value">0</span>
<div class="btn-container">
<button class="btn decrease">decrease</button>
<button class="btn reset">reset</button>
<button class="btn increase">increase</button>
</div>
<div class="user">username...</div>
</div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/tabletop.js/1.5.1/tabletop.min.js'></script>
<script>
function init() {
Tabletop.init( { key: '1_RfcIObpWQypYpC-ItrVaLOOpfzGcQyUE6DQW2SFBuw',
callback: showInfo,
simpleSheet: true } )
}
function showInfo(data, tabletop) {
for (var i = 0; i < data.length; i++){
document.querySelector('.user').innerText = data[i].username;
}
console.log(data);
}
window.addEventListener('DOMContentLoaded', init)
</script>
</body>
</html>