-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
showcase.html
369 lines (357 loc) · 21.6 KB
/
showcase.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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
<html>
<head>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Fredoka+One|Open+Sans&display=swap" rel="stylesheet">
<title>ChatBlocks Challenge Showcase!</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-135113520-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-135113520-1');
</script>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
<script src="https://cdn.jsdelivr.net/npm/comfytwitch@latest/web/comfytwitch.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/comfy.js/dist/comfy.min.js"></script>
<style>
html, body {
font-family: "Fredoka One", "sans-serif";
color: #ffffff;
background-color: #333;
}
a, a:hover {
color: #ffa600;
}
.translucent-purple-bg {
background-color: rgba( 100, 65, 165, 0.5 );
border-color: rgba( 100, 65, 165, 0.5 );
color: #ccc;
}
.btn-purple-outline {
background-color: #fff;
border-color: #fff;
color: #6441a5;
}
.btn-purple {
background-color: #6441a5;
border-color: #6441a5;
color: #fff;
}
.btn-primary {
background-color: #4C97FF;
border-color: #4C97FF;
}
.btn-warning {
background-color: #ffa600;
border-color: #ffa600;
}
.card {
background-color: #6441a5;
color: #fff;
}
.card-img-top {
width: 100%;
height: 25vw;
object-fit: cover;
}
.pre {
white-space: pre-wrap;
}
</style>
</head>
<body class="container">
<div id="login-group" class="py-2 float-right" hidden><button id="login" class="btn btn-purple center">Log In with <i class="fa fa-twitch"></i> Twitch</button></div><div id="profile-group" class="py-2 float-right" hidden><span><span id="username"></span> <img id="profile-image" class="rounded" src="" alt="Profile Image" height="38" width="38"></span> <button id="logout" class="btn btn-purple">Log Out</button></div>
<h1>ChatBlocks by <a href="https://www.instafluff.tv" target="_blank">Instafluff</a></h1>
<p>ChatBlocks Challenge Showcase!</p>
<div id="entries" class="row">
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
<script>
const params = new URLSearchParams( location.search );
let submissions = [
{
"challenge": 1,
"creator": "shadesofpixie",
"description": `A superhero name generator! When you type the command !superhero you get back your superhero name.`,
"notes": `It's smol but hopefully fun ^_^`,
"screenshots": [ "1_superhero_01.png", "1_superhero_02.png" ],
"file": "1_superhero.cbs"
},
{
"challenge": 1,
"creator": "airsickmammal",
"description": `My Stepsons (11y) first piece of coding - a Chatblocks bot that pulls a random cat fact on !fluffyfact and a random "useless" fact on !generalfluff :) So proud :)`,
"notes": `Thank you for all the work on chatblocks, from the smile on his face when he saw the bot working, i know this has had a positive on Jeff who i hope will continue to work on this and get more into the comfy coding world :)`,
"screenshots": [ "2_fluffyfacts_01.png" ],
"file": "2_fluffyfacts.cbs"
},
{
"challenge": 1,
"creator": "airsickmammal",
"description": `What is it?
A Subscriber ""care package"" upon subscription, renewal, gift, but separates out prime subs from normal subs with the message that goes out. This bot is geared towards the instafluff channel but text can be easily modified without need to update the logic.
Why?
When someone subscribes for the first time, renews, is gifted or continues a gift sub, i thought it would be nice if they got a message from the channel to welcome them, and explain that e.g. you get the emotes, you can help defeat the fluffboss, you can !plink and !drop etc.. As well as for celebrating anniversaries, each range (1m-11m, 12m, 13m-23m, 24m etc..) giving a different private message and for big anniversaries.. or members over 24 months getting specific chat shout-outs as well as the on-stream WAAA-fest :)`,
"notes": `I will continue to work on normalising the code, the last section is long because you can have a prime subscription and also be on a subscription streak.`,
"screenshots": [ "3_subhandler_01.png" ],
"file": "3_subhandler.cbs"
},
{
"challenge": 1,
"creator": "Ellenary",
"description": `This Endangered Species Spotlight ChatBlock allows the use of the !species command to pull up information about one of 5200+ endangered or critically endangered species from the IUCN Red List. https:/www.iucnredlist.org/.`,
"notes": `I am so happy this project worked out! Using ChatBlocks was so much fun and this allowed me to make a Twitch bot that will promote conservation. I downloaded information about 20,000 species from the IUCN Red List website and aggregated a few IUCN datasets using R. The magic took place in Excel. I removed a lot of entries with special characters or missing information, removed a ton of info that'd turn it into a wall of text, and made it easier for streamers to read (E.g. changing words like Sarcopterygii to lobe-finned fish). I even received official copyright permission from the IUCN to redistribute parts of their data. That process involved explaining Twitch, Instafluff, ChatBlocks, Blockly, and my project... and crossing my fingers.`,
"screenshots": [ "4_speciesspotlight_01.png" ],
"file": "4_speciesspotlight.cbs"
},
{
"challenge": 1,
"creator": "walpolea",
"description": `I created a block to pull inspirational quotes`,
"notes": `Very excellent giveaway! Would submit again! A+++ :)`,
"screenshots": [ "5_inspireme_01.png" ],
"file": "5_inspireme.cbs"
},
{
"challenge": 1,
"creator": "informathemusic",
"description": `Represents people's activity by giving them out points when they chat somewhere`,
"notes": `You better talk! >:D`,
"screenshots": [ "6_trackthor_01.png", "6_trackthor_02.png", "6_trackthor_03.png" ],
"file": "6_trackthor.cbs"
},
{
"challenge": 1,
"creator": "holloway87",
"description": `"It's a local session tracker for high and low drop game scores, since it won't save the scores permanently. Might even be useful for giveaways over a specific time period.
What you can do:
!droprecord [low|high] check the lowest, highest or both drop scores.
!resetdroprecord [low|high] reset the lowest, highest or both drop scores.
!lowestdrop [enable|disable] check the lowest drop status, enable or disable it. It is enabled by default."`,
"notes": ``,
"screenshots": [ "7_localdroptracker_01.png" ],
"file": "7_localdroptracker.cbs"
},
{
"challenge": 1,
"creator": "Gilokk0",
"description": `This is a simple chatbot that does simple commands. And does gifts, instant answers, jokes, rolls a twelve sided dice, checks teams and if a user is following the channel.`,
"notes": `I did want !followage to tell you how long you've been following, but I didn't have the tools to do so.`,
"screenshots": [ "8_gilokk0_01.png" ],
"file": "8_gilokk0.cbs"
},
{
"challenge": 1,
"creator": "sparky_pugwash",
"description": `you type !smile and it compliments you to make you smile`,
"notes": `smile !!`,
"screenshots": [ "9_smile_01.jpg" ],
"file": "9_smile.cbs"
},
{
"challenge": 1,
"creator": "Atanerah",
"description": `Get weather data from any city in the world using the Open Weather Maps API using the !weather chat command`,
"notes": ``,
"screenshots": [ "10_weather_01.png", "10_weather_02.png" ],
"file": "10_weather.cbs"
},
{
"challenge": 1,
"creator": "Kurokirisu",
"description": `A dice roll command based on a DnD roll for initiative.`,
"notes": `:3`,
"screenshots": [ "11_rollinit_01.png" ],
"file": "11_rollinit.cbs"
},
{
"challenge": 1,
"creator": "Kurokirisu",
"description": `A password guessing game which can save guessed passwords.`,
"notes": `uwu`,
"screenshots": [ "12_passwordfinder_01.png" ],
"file": "12_passwordfinder.cbs"
},
{
"challenge": 1,
"creator": "Kurokirisu",
"description": `A fishing tournament game, based loosely on Animal Crossing.`,
"notes": `Does not work perfectly yet because of Twitch' anti spam rules. Also the timers sometimes just break, ¯\\_(ツ)_/`,
"screenshots": [ "13_fishing_01.png", "13_fishing_02.png", "13_fishing_03.png", "13_fishing_04.png", "13_fishing_05.png" ],
"file": "13_fishing.cbs"
},
{
"challenge": 2,
"creator": "KimballDonald",
"description": `A simple command that sends users on a quest! Generates a location and an action randomly.`,
"notes": `Thank you Instafluff for making such a neat tool!`,
"screenshots": [ "1_quest_01.png" ],
"file": "1_quest.cbs"
},
{
"challenge": 2,
"creator": "walpolea",
"description": `I created a math chat game to test out your knowledge of expression evaluation. With the !mathlete command, chat is given an expression and can guess answers with !math [answer]. But hurry up, because you only have a limited amount of time to answer!`,
"notes": ``,
"screenshots": [ "2_mathlete_01.png", "2_mathlete_02.png" ],
"file": "2_mathlete.cbs"
},
{
"challenge": 2,
"creator": "KimballDonald",
"description": `I recreated the Wind Waker Squid Hunt minigame! I manually set the locations which contain empty squares and which contains octoroks, and then whoever redeems the command gets to use 24 cannonballs to try to hit!`,
"notes": ``,
"screenshots": [ "3_windwaker_01.png" ],
"file": "3_windwaker.cbs"
},
{
"challenge": 2,
"creator": "sparky_pugwash",
"description": `Cleaning tips`,
"notes": `Cleaning tips bot !clean`,
"screenshots": [ "4_cleanbot_01.jpg", "4_cleanbot_02.jpg" ],
"file": "4_cleanbot.cbs"
},
{
"challenge": 2,
"creator": "Gilokk0",
"description": `"This is a chatbot that uses Fun Translations API (https://funtranslations.com/api/) to translate to Klingon, Leetspeak, Minion, Morse, Pirate, Vulcan and Zoda (from English). It also translates from Morse to English.
The translation API has a ratelimit. Fun Translations has this on the API page: ""Our translation API is public. To maintain our service level we ratelimit the number of API calls. For public API calls this is 60 API calls a day with distribution of 5 calls an hour. For paid plans this limit is increased according to the service level described in the plan.""
This chatbot also has a shoutout command (named shout), to shoutout other streamers during stream (or to shoutout themselves, if chatmessage is empty)."`,
"notes": `Hope you all enjoy it! ;D`,
"screenshots": [ "5_funtranslations_01.png" ],
"file": "5_funtranslations.cbs"
},
{
"challenge": 2,
"creator": "ellenary",
"description": `A numeric counter for when you want to keep track of a number of things. This is just the base counter, but the possibilities are limitless! You can put several counters as different keys in the same bin, use if/else statements so you can choose if only mods or subscribers can use the command and you can even set multiple commands to point to the same counter! ChatBlocks is amazing!!`,
"notes": `Figuring out permanent storage has opened a whole new world to me. Thank you so much to Schublo for inspiring this counter and helping test it, InformaTheMusic for helping me get this working, and to EveryDayGamerM for letting me use her stream as a guinea pig!`,
"screenshots": [ "6_counter_01.png", "6_counter_02.png" ],
"file": "6_counter.cbs"
},
{
"challenge": 2,
"creator": "wabes1",
"description": `Fishing Stream !commands: count the fish in chat, with TTS alerts. Plus more !`,
"notes": `"My Chat-block was made for the streamer who does live Fishing.
!commands count the fish in chat.
Anyone in chat can type:
wow - gg - fishon - fishoff (All TTS Alerts)
Any Mod & Sub only can type:
!fish+ (TTS, Add # to counter) (and if two mod, both key in, next line down)
!fish- (TTS, Subtract # to counter) (So total # can go up and down)
!fish (TTS, Total # at anytime) (so if someone shows up late, they can get-
a update count)
Any Mod only can type:
!fishreset (TTS, Puts counter back to zero)
!123drink (TTS, A slow count down for a drink up) "`,
"screenshots": [ "7_fishing_01.png" ],
"file": "7_fishing.cbs"
},
{
"challenge": 2,
"creator": "Caffidget",
"description": `text-to-speech for any events so I can hear when things happen`,
"notes": `I love ChatBlocks - still new and figuring things out so this is rudimentary.`,
"screenshots": [ "8_eventtts_01.png" ],
"file": "8_eventtts.cbs"
},
{
"challenge": 2,
"creator": "informathemusic",
"description": `Tell me the odds of winning for the chatblocks!`,
"notes": ``,
"screenshots": [ "9_cbwinodds_01.png" ],
"file": "9_cbwinodds.cbs"
},
];
(async () => {
let entries = [];
submissions.forEach( ( entry, i ) => {
console.log( entry, i );
let carouselIndicators = "";
let carouselItems = "";
entry.screenshots.forEach( ( s, n ) => {
carouselIndicators += `<li data-target="#carousel_${i}" data-slide-to="${n}" ${n === 0 ? 'class="active"' : ''}></li>`;
carouselItems += `<div class="carousel-item ${n === 0 ? "active" : ""}"><img src="web/vote${entry.challenge}/${s}" class="d-block w-100 card-img-top" alt="screenshot"></div>`
});
entries.push(`
<div class="col-4 pb-4">
<div class="card">
<div id="carousel_${i}" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
${carouselIndicators}
</ol>
<div class="carousel-inner">
${carouselItems}
</div>
<a class="carousel-control-prev" href="#carousel_${i}" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carousel_${i}" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<div class="card-body">
<p class="card-text text-warning">CB Challenge #${entry.challenge}</p>
<h5 class="card-title">Built By: <span class="text-warning">${entry.creator}</span></h5>
<a href="web/vote${entry.challenge}/${entry.file}" target="_blank" class="btn btn-info">Download</a>
<br/><br/>
<p class="card-text pre"><small>${entry.description}</small></p>
<br/><br/>
<small><i>${entry.notes}</i></small>
</div>
</div>
</div>`);
});
// Shuffle entries
for( let i = entries.length - 1; i > 0; i-- ) {
const j = Math.floor( Math.random() * ( i + 1 ) );
[ entries[ i ], entries[ j ] ] = [ entries[ j ], entries[ i ] ];
}
entries.forEach( e => {
$( "#entries" ).append( e );
});
})();
const clientId = "xrxinjwucvs83rf1b6lxq758yslj3c";
const baseUrl = window.location.origin + window.location.pathname;
ComfyTwitch.Check()
.then( async result => {
console.log( result );
if( result ) {
// Logged In
let user = await ComfyTwitch.GetUser( clientId, result.user_id );
document.getElementById( "username" ).innerText = user.display_name;
document.getElementById( "profile-image" ).src = user.profile_image_url;
document.querySelector( "#login-group" ).setAttribute( "hidden", true );
document.querySelector( "#profile-group" ).removeAttribute( "hidden" );
document.querySelector( "#logout" ).addEventListener( "click", function() {
ComfyTwitch.Logout();
window.location.reload();
});
}
else {
// Logged Out
document.querySelector( "#profile-group" ).setAttribute( "hidden", true );
document.querySelector( "#login-group" ).removeAttribute( "hidden" );
document.querySelector( "#login" ).addEventListener( "click", function() {
ComfyTwitch.Login( clientId, baseUrl, [ "user:read:email" ] );
});
}
});
</script>
</body>
</html>