-
Notifications
You must be signed in to change notification settings - Fork 0
/
prompt.html
204 lines (168 loc) · 8.16 KB
/
prompt.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Press+Start+2P&display=swap" rel="stylesheet">
<title>Twitch Controls Minecraft</title>
<style>
body {
background: url('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAASABIAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAECgAwAEAAAAAQAAAEAAAAAA/+0AOFBob3Rvc2hvcCAzLjAAOEJJ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/N5Xl57ZznH+FY885h2jYWzTTuS1Y6WCD+yw3zeb5ntjGP8A9dYNhr32EyZtS+/H8eMY/CtDw5beWLnMmc7eo+tO1a4E/k/Jt25759KVo7bju99j/9DJ14fYfs/8e8t7YxitG3uPIDfLu3e9Z1/f/bvL/dbNme+c5q5/YP8A08/+Of8A168p7anqre6MzSoPI8/5s7sdsetZv285OIj+Brcltd+Pnxj2qrpGriDzh5G7OP4vr7Vo7XdtTNXsr6FOec6nt+UxeX75zn/9VXbfVf7LDD7OZfM98Yx+HvU2u3+fs+Iu57/StKfVxCF/cbs/7X/1qlvTYtLXcxoJ/J3fLnd70uk6T5/nfv8AGMfw59ferWmReb5vOMY7fWlgg8jd8+c02mlfuSmm7dj/0cj/AI/f9jZ+Oap2F+T5n7s9u9XP+PL/AG9/4YxU+k3HkCb5N27Hf615nQ9PqZhv/sX/ACyL7/fGKzILczljuK49q37HrJ+FXWvvtv8Ayy2bPfOafNbYOW5Ssekn4VnXE/kFBtzuPritXRk/s3z+fM8zHtjGf8aytX1b+1DCBAYvLJ/iznOPb2p8rUrMm6cbo6r+z+P9b+lc1Y2BBk/ent2rYzxWZqmpmTysQEYz3+ntUwWj1Km9Vof/0uVg0nzt2ZyMf7P/ANersE/k7vl3Zqa+/wCWf41pwQf2WG+bzfN9sYx/+uvMcu56iiYPQ1r35+2iP+DZn3zWPf2GTH+87ntUup6Z5Xknzic5/h+lVy83vLoRzcvuvqVLicwbfkJznvikt9W8nd+43Z/2v/rVv35+2iPjZsz75rNgm8ncNuc0k7rYbVnuT2Fj9t8w+bs2Y7Zzmtj7eP8Anl+tZcumeVg+dnP+zVS41byNv7ndn/apSg72Y4zVro//2Q==') repeat;
}
.container-fluid {
text-align: center;
}
h1, h2, h3, h4, h5, h6, p {
font-family: 'Press Start 2P', cursive;
color: #FFFFFF;
text-shadow: 3px 3px #000000;
font-smooth: never;
-webkit-font-smoothing : none;
}
.overlay {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: #000000;
opacity: 0.65;
}
.heading {
font-size: 22px;
line-height: 50px;
margin-top: 40px;
padding-bottom: 5px;
margin-bottom: 10px;
}
.heading-minecraft {
font-size: 36px;
}
.voting-box {
position: relative;
background: rgba(0, 0, 0, 0.5);
border: 3px solid #000000;
width: 100%;
min-height: 550px;
margin-bottom: 20px;
padding: 20px;
}
.voting-name {
font-size: 22px;
text-transform: uppercase;
}
.voting-description {
font-size: 14px;
margin-bottom: 20px;
}
.voting-timer {
position: absolute;
left: 10px;
right: 10px;
bottom: 10px;
}
.voting-timer h5 {
font-size: 14px;
text-align: center;
}
.voting-timer p {
font-size: 12px;
margin: 0;
color: green;
}
.voting-option {
outline: 2px solid black;
background-image: url('http://charliecowan.co.uk/mcbuttongenerator/button_center.png');
background-repeat: repeat;
text-align: center;
color: white;
padding: 5px 0;
text-shadow: 3px 3px #4C4C4C;
border-bottom: 4px solid #565656;
border-right: 2px solid #565656;
border-left: 2px solid #AAA;
border-top: 2px solid #AAA;
box-sizing: border-box;
font-size: 14px;
margin-bottom: 20px;
}
.voting-option-selected {
outline: 4px solid green !important;
}
.voting-option-name {
margin: 0 0 5px 0;
}
.voting-option-count {
margin: 0;
font-size: 10px;
}
.created-by {
font-size: 14px;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="overlay"></div>
<div class="row">
<div class="col">
<h2 class="heading">Twitch Controls<br /><span class="heading-minecraft">MINECRAFT</span></h2>
<div class="voting-box">
<h4 class="voting-name">Loading...</h4>
<p class="voting-description">Connecting to service...</p>
<div class="voting-options"></div>
<div class="voting-timer">
<h5>Voting Ends In:<span class="voting-timer-seconds">0</span>s</h5>
<p>To vote, enter the number you want to vote for into the chat.</p>
</div>
</div>
<p class="created-by">Created by @MrThisIsFine</p>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<script type="text/javascript">
var lastCommandUUID = null;
var currentVote = null;
$(function() {
// main tick timer
setInterval(function() {
$.getJSON('/voting.json', function(data) {
currentVote = data;
var command = currentVote.command;
if (lastCommandUUID != command.uuid) {
lastCommandUUID = command.uuid;
$('.voting-name').text(command.name);
$('.voting-description').text(command.description);
$('.voting-options').empty();
$(command.options).each(function(index, value) {
var quantity = (value.quantity || value.experience || value.repeatCommand) ? ' (x' + (value.quantity || value.experience || value.repeatCommand) + ')' : '';
$('.voting-options').append(
'<div class="voting-option">' +
'<p class="voting-option-name">' + (index + 1) + ': ' + value.name + quantity + '</p>' +
'<p class="voting-option-count"><span class="votes">0</span> Votes</p>' +
'</div>'
);
});
}
var highestVoteIndex = 0;
$(command.optionVotes).each(function(index, votes) {
$('.votes').eq(index).text(votes.length);
highestVoteIndex = (votes.length > command.optionVotes[highestVoteIndex]) ? index : highestVoteIndex;
});
$('.voting-option').removeClass('voting-option-selected');
if (command.optionVotes[highestVoteIndex].length > 0) {
$('.voting-option').eq(highestVoteIndex).addClass('voting-option-selected');
}
$('.voting-timer-seconds').text(Math.floor((currentVote.roundEndsAt - Date.now()) / 1000));
});
}, 1000);
});
</script>
</body>
</html>