-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy paththebutton.html
74 lines (65 loc) · 2.12 KB
/
thebutton.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<head>
<title>Build Your Own /r/thebutton</title>
<script src="https://www.google.com/jsapi"></script>
<script>google.load("visualization", "1", {packages:["corechart"]});</script>
</head>
<body>
<nav>
<h1>The Button</h1>
<div class="thebutton-participants">
{{numParticipants}} participants
</div>
{{> loginButtons align="right"}}
</nav>
{{> thebutton}}
<div class="what-is-this">
<h2>How does this work? Read <a href="https://medium.com/@Rahul/build-your-own-r-thebutton-with-meteor-d4b878fbb0d2">Build your own /r/thebutton</a></h2>
<p>
Made by <a href="http://twitter.com/rahul">@Rahul</a> with <a href="http://meteor.com">Meteor</a>.
</p>
<p>
<iframe src="https://ghbtns.com/github-btn.html?user=primigenus&repo=thebutton&type=star&count=true" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
<iframe src="https://ghbtns.com/github-btn.html?user=primigenus&repo=thebutton&type=fork&count=true" frameborder="0" scrolling="0" width="100px" height="20px"></iframe>
</p>
</div>
</body>
<template name="thebutton">
<div class="thebutton-container">
<div class="thebutton-button">
{{#if currentUser}}
{{#if timeRemainingWhenClicked}}
You clicked on {{clicked}} with <span class="remaining-{{timeRemainingWhenClicked}}">{{timeRemainingWhenClicked}}s</span> remaining
{{else}}
{{#if timeRemaining}}
<button title="Click it!"></button>
{{else}}
<button disabled></button>
{{/if}}
{{/if}}
{{else}}
{{#if timeRemaining}}
<button disabled>You must log in</button>
{{else}}
<button disabled></button>
{{/if}}
{{/if}}
</div>
{{> piechart}}
{{> countdown}}
</div>
</template>
<template name="piechart">
<div>
<div class="thebutton-piechart-container">
<div class="thebutton-piechart"></div>
</div>
</div>
</template>
<template name="countdown">
<div class="thebutton-countdown">
<span class="countdown-60s">{{countdown60s}}</span>
<span class="countdown-10s">{{countdown10s}}</span>
<span class="countdown-100ms">{{countdown100ms}}</span>
<span class="countdown-10ms">{{countdown10ms}}</span>
</div>
</template>