-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
248 lines (225 loc) · 6.64 KB
/
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
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Super Mario Maker 2 Bingo</title>
<script src="https://unpkg.com/lodash"></script>
<script src="https://unpkg.com/vue"></script>
</head>
<body>
<script type="text/x-template" id="bingo-template">
<table>
<tbody>
<tr v-for="items in grid">
<td v-for="item in items" @click="toggleDone(item)" :style="getStyle(item)">
{{ item.label }}
</td>
</tr>
</tbody>
</table>
</script>
<div class="flex-container">
<div id="bingo">
<h1>Super Mario Maker <span style="color: #E80115">2</span></h1>
<h2>Bingo</h2>
<div id="bingo-config">
<label for="multiplayer">
<input id="multiplayer" type="checkbox" :value="levelConfiguration.multiplayer" />
Multiplayer
</label>
<button @click="newGame">
New Game!
</button>
</div>
<bingo :grid="grid" v-if="grid.length > 0"></bingo>
</div>
</div>
<script>
// register component
Vue.component("bingo", {
template: "#bingo-template",
props: {
grid: Array
},
methods: {
toggleDone: function(item) {
item.checked = !item.checked
this.checkBingo();
},
checkBingo: function() {
// TODO
},
getStyle: function(item) {
let style = 'text-transform: uppercase; ';
if (item.bgColor) {
style += 'background-color: ' + item.bgColor + ' ';
}
if (item.checked) {
style += 'color: #d6d6d6; ';
style += 'background-color: #bf9d4d; ';
}
return style;
}
}
});
var myBingo = new Vue({
el: "#bingo",
data: {
levelConfiguration: {
// add multiplayer value
multiplayer: false,
// grid size
size: 5,
},
grid: [],
bingoData: {
singleplayer: [
// https://i.imgur.com/y1Rg8Y8.png
{label: "enemy spam"},
{label: "sound effects everywhere"},
{label: "bring yoshi to the goal"},
{label: "tech level"},
{label: "pick a door / pipe"},
{label: "1-1 remake"},
{label: "collect all coins"},
{label: "music level"},
{label: "softlock with no way of dying"},
{label: "infinite fire flower boss fight"},
{label: "no checkpoints (without clear condition)"},
{label: "enemy spam (with star)"},
{label: "good level"},
{label: "builder / superball level"},
{label: "themed after another game"},
{label: "kaizo blocks"},
{label: "level can be cheesed"},
{label: "auto mario level"},
{label: "“first level in title”"},
{label: "meowser or boom-boom"},
{label: "title level"},
{label: "terribly named level"},
{label: "kills mario at start"},
{label: "on/off blocks"},
// extra
{label: "troll level"},
{label: "#DGR"},
{label: "super mario bros remake level"},
{label: "little timmy level"},
{label: "first clear"},
{label: "world record"},
{label: "multi player themed"},
{label: "kaizo level"},
{label: "bean burrito level"},
{label: "speed run"},
{label: "link power"},
{label: "my first level"},
{label: "version X of the level"},
{label: "tutorial level"},
{label: "car level"},
{label: "dev route"},
{label: "title in Japanese"},
{label: "search after a kaizo block to win"},
{label: "THX"},
{label: "Kill yoshi for free"},
{label: "Kill at te end"},
{label: "Uno mas"},
],
multiplayer: [
{label: "communication error occured"},
{label: "lag"},
{label: "lag free"},
{label: "kill someone"},
{label: "stole victory condition"},
{label: "stole somebody's power up"},
{label: "everyone end at flag"},
{label: "beat an S+ ranked player"},
{label: "someone wait at flag"},
{label: "played 3 times the same character in arow"},
{label: "boss fight"},
{label: "being carried by someone"},
{label: "kill someone with a shell"},
{label: "throw someone in a hole"},
{label: "throw someone at an enemy"},
{label: "someone block door/pipe"},
{label: "on/off switch spam"},
],
},
},
mounted: function() {
this.newGame();
},
methods: {
newGame: function() {
this.grid = [];
let numberOfElements = Math.pow(this.levelConfiguration.size, 2) - 1;
// take numberOfElements element randomly
let bingo = this.bingoData.singleplayer;
if (this.levelConfiguration.multiplayer) {
bingo = this.bingoData.multiplayer;
if (bingo.length < numberOfElements) {
// complete bingo with single player
bingo = _.union(bingo, _.sampleSize(this.bingoData, numberOfElements - bingo.length));
}
}
let gridSelected = _.sampleSize(bingo, numberOfElements);
gridSelected = _.shuffle(gridSelected);
gridSelected = _.map(gridSelected, function(item) {
let newItem = { ...item };
newItem.checked = false
return newItem;
});
// inject middle free cell. Middle will be at index "numberOfElements / 2" (so if 25 elements => 24 / 2 => index 12 (position 13 in the index))
gridSelected.splice(numberOfElements / 2, 0, {label: "free", bgColor: "#FFFFFF", checked: false});
this.grid = _.chunk(gridSelected, this.levelConfiguration.size);
}
},
});
</script>
<style>
@font-face {
font-family: "Super-Mario-Maker-Font";
src: url("Super Mario Maker Font.ttf") format("truetype");
}
body {
font-family: Super-Mario-Maker-Font, Helvetica Neue, Arial, sans-serif;
font-size: 14px;
color: #444;
background-color: #FFD302;
}
h1, h2 {
text-align: center
}
table {
border: 2px solid #000000;
border-collapse: collapse;
table-layout: auto;
max-width: 600px;
}
table td {
border: 2px solid #000000;
background-color: #FFE9B7;
height: 4em;
width: 20%;
padding: 0.2em;
text-align: center;
vertical-align: middle;
overflow: hidden;
text-overflow: ellipsis;
transition: 0.3s;
}
.flex-container {
display: flex;
justify-content: center;
min-height: 100vh;
align-items: center;
}
#bingo-config {
margin-bottom: 1rem;
}
</style>
<footer>
DGR ask it in <a href="https://www.youtube.com/watch?v=iI-OLOuRn5w">his video</a><br />
font from : https://famfonts.com/super-mario-maker/<br />
Made By <a href="https://twitter.com/Grummfy">Grummfy </a> - change it <a href="https://github.com/grummfy/fun_super-mario-maker2-bingo/">on github</a>
</footer>
</body>
</html>