Game-Jaming/Frontend/Javascript/Games.js

26 lines
855 B
JavaScript
Raw Normal View History

2021-05-05 06:25:01 +00:00
// JavaScript source code
var numberOfGameJam = 6
var oldGameJam = document.getElementById("oldGameJam");
var html = '<div class="row">'
var numberOfGame = 5
//game jams
for (let i = 1; i <= numberOfGameJam; i++) {
html += '<div class="col-sm">' +
'<button type="button" class="Collapsible" data-bs-toggle="collapse" data-bs-target="#oldGame-' + i + '">Kategori</button>' +
'<div class="collapse" id="oldGame-' + i + '">'
//spil
for (let j = 0; j < numberOfGame; j++) {
html += '<button type="button" class="" data-bs-toggle="collapse" data-bs-target="#oldGame-' + i + '-game-' + j + '" id="gameDataId">Spil</button>';
}
html += '</div>'
html += '</div>'
if ((i % 3 == 0) && (i != numberOfGameJam)) {
html += '</div><div class="row">'
}
}
html += '</div>'
oldGameJam.innerHTML += html;