-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy patheurovision-bingo.js
179 lines (171 loc) · 4.89 KB
/
eurovision-bingo.js
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
function random_range(lower, upper) {
return lower + Math.floor((upper - lower) * Math.random());
}
function extract_random_element(array_) {
index = random_range(0, array_.length);
return array_.splice(index, 1)[0];
}
var VERSION = "v2";
onLoad = function() {
cells = document.querySelectorAll("td");
// Load and store state in local storage
state = localStorage.getItem(VERSION);
if (!state) {
tropes = [];
trope_indexes = [];
all_tropes.forEach(function (_, i) {
trope_indexes.push(i);
});
for (var i = 0; i < cells.length; i++) {
// Randomize content
tropes.push(extract_random_element(trope_indexes));
}
state = {
"tropes": tropes,
"checked": []
}
localStorage.setItem(VERSION, JSON.stringify(state));
} else {
state = JSON.parse(state);
for (var i = 0; i < cells.length; i++) {
if (state.checked[i]) {
cells[i].classList.add("checked");
}
}
}
state.tropes.forEach(function(_, i) {
cells[i].textContent = all_tropes[state.tropes[i]];
// Set up click listener to toggle "checked" class on target element
cells[i].addEventListener("click", function (event) {
event.currentTarget.classList.toggle("checked");
state.checked[i] = event.currentTarget.classList.contains("checked");
localStorage.setItem(VERSION, JSON.stringify(state));
ga('send', 'event',
'Cell',
event.currentTarget.classList.contains("checked") ? 'check' : 'uncheck',
event.currentTarget.textContent);
});
});
document.querySelector("#reset").addEventListener("click", function(event) {
localStorage.clear();
location.reload();
ga('send', 'event',
'Reset');
});
};
document.addEventListener('DOMContentLoaded', onLoad, false);
all_tropes = [
"On-stage change of clothes",
"Gimmicky instrument",
"Key change, truck driver's or otherwise",
"Rap",
"Notably bad accent",
"Wind machine",
"Platforms on stage",
"Trying for audience participation",
"Pyrotechnics and/or confetti",
"Ethnic influences",
"References to European community",
"Implied homosexuality",
"Band name used in decoration",
"Odd singing registers (falsetto, tuvan throat singing, yodeling, etc)",
"Retro-famous dance move",
"\"Hello Malmö!\"", // TODO: update next year
"\"I love you Malmö!\"", // TODO: update next year
"Side step-dance",
"GLITTER",
"Tight overall (clothing)",
"Song is not serious song",
"Preposterous shoes",
"Band name with pun",
"\"Love\" in song title",
"Eastern-bloc votes for eastern-bloc",
"Scandinavia votes for Scandinavia",
"Country sent their best singer to competition",
"An actual famous band",
"Technical failure",
"Technical delay",
"Boob shock",
"Vocal microphone effects",
"Wailing",
"Balloons",
"Greeting from artist that was unable to make it",
"Shoutout/wave to family member in the audience",
"Overwhelming cringe",
"Dancers' uniforms do not match artist and/or are irrelevant to song",
"Artist < 18 years of age",
"Artist > 18 years of age, acts like < 18",
"Duet performers with socially unacceptable age span",
"Unexpected techno segue",
"Sunglasses",
"Lasershow",
"Audience aware of being filmed, points/stares at video screen",
"Two hands gripping the microphone",
"Foul language",
"Facial paint",
"Parody of real band",
"Music medley",
"Host/hostess dancing",
"Pointing into camera",
"Microphone between legs",
"Visible camera",
"Obvious local audience-pleaser",
"Performers leaning back-to-back",
"Smoke machine",
"Backstage footage",
"Live outdoors footage",
"Sepia-filter",
"Accordion, violin, flute, harmonica or harp",
"Hand movement 5+ sec",
"Questionable props",
"Heavy breathing in microphone",
"Lyrics other than English or native language",
"Shocking nudity",
"Patriotism",
"Belly button showing",
"\"Is the UK/France/Germany taking this seriously?\"",
"Interim entertainment would have easily won",
"Artist of color",
"Clicking one's heels",
"Screaming fans up close",
"Pun in song title",
"Reference to ABBA",
"Sign with name",
"Comical sign",
"Peace theme from war nation",
"Walking in circles around each other",
"Kissing on stage",
"Song inappropriate for senior citizens",
"Siblings on stage",
"Pornstache",
"Song sharing a title with one previously performed", //As made famous 2015
"Disposal of footwear",
"Preposterous dress",
"Shocking shoes",
"Flying",
"(Dis)apparation",
"Demonic ritual",
"Cape",
"On-stage selfie",
"Tinfoil hat",
"Destroying equipment",
"Winking to camera",
"Selfie stick used by artist",
"Person banging on drums", // Thanks Kathi
"Appearing taller than they really are",
"Animal costume",
"Dreads",
"Artist in tracksuit or acti-leisure wear",
"Face as decoration",
"Breakdance",
"Obviously artificial hair",
"Multiple performers with same hair dress",
"Artificial nails",
"Ostrich feathers",
"Unicorn in audience",
"Floor glass crack effect",
"Good evening Europe!",
"Good morning Australia!",
"Latin-inspired from outside the Iberian Peninsula",
"Voguing",
]