init
This commit is contained in:
commit
c4863a8bb5
18
bingo.html
Normal file
18
bingo.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!doctype html>
|
||||
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<title>Bingo</title>
|
||||
<meta name="description" content="Stammtisch Bingo">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table>
|
||||
</table>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
50
script.js
Normal file
50
script.js
Normal file
@ -0,0 +1,50 @@
|
||||
let fields = [
|
||||
'MARTINAA',
|
||||
'JAAAAA??!!',
|
||||
'Brain-AFK',
|
||||
'Rant über Kollegen',
|
||||
'Redet in StammTV rein',
|
||||
'Häää?',
|
||||
'Bin mal kurz mitem Hund',
|
||||
'*schnupft*',
|
||||
'Habt ihr des neue ... schon gesehen?',
|
||||
'Random Nonsense-Problem',
|
||||
'Auf Ausbildung freuen',
|
||||
'Erzählt von Hinz und Kunz',
|
||||
'Was heißt eigentlich ...?',
|
||||
'Wiederholung',
|
||||
'Story geht länger als nötig',
|
||||
'Labert direkt los',
|
||||
'Haljo',
|
||||
'Klicken im Mikro',
|
||||
'Schlafen',
|
||||
'Akustik',
|
||||
'Spielt LoL',
|
||||
'Schlafen',
|
||||
'A',
|
||||
'B',
|
||||
];
|
||||
|
||||
let shuffled = fields
|
||||
.map(value => ({ value, sort: Math.random() }))
|
||||
.sort((a, b) => a.sort - b.sort)
|
||||
.map(({ value }) => value)
|
||||
|
||||
shuffled.splice(12, 0, "Freies Parken");
|
||||
|
||||
function generateTable() {
|
||||
let table = document.querySelector("table");
|
||||
let thead = table.createTHead();
|
||||
let row = null;//thead.insertRow();
|
||||
shuffled.forEach(function(field, index) {
|
||||
if (index % 5 == 0){
|
||||
row = thead.insertRow();
|
||||
}
|
||||
let cell = row.insertCell();
|
||||
let text = document.createTextNode(field);
|
||||
cell.appendChild(text);
|
||||
});
|
||||
}
|
||||
|
||||
generateTable();
|
||||
|
Loading…
Reference in New Issue
Block a user