-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
75 lines (60 loc) · 2.33 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
<!-- There's no place like ~ -->
<html>
<head>
<title>Birthday Bingo</title>
<!-- Front page images & css -->
<script src="data/index.txt"></script>
<link rel="stylesheet" type="text/css" href="data/index.css">
<link rel="stylesheet" type="text/css" href="data/bingo.css">
<!-- Font & Website logo -->
<link href='https://fonts.googleapis.com/css?family=Playfair+Display' rel='stylesheet'>
<link href='https://fonts.googleapis.com/css?family=DM+Mono' rel='stylesheet'>
<link rel="icon" href="https://img.icons8.com/flat_round/64/000000/whale--v1.png">
</head>
<body>
<h1>Birthday Bingo</h1>
<noscript>
<div class="error">
<strong>Problem:</strong>
<p><em>
You do not have JavaScript enabled. JavaScript must be enabled for this application to work.
</em></p>
</div>
</noscript>
<p>
<br> It seems to be your birthday today, and your friends have put together a little game to virtually spend time celebrating you on your <strong>quarantine birthday</strong>
</p>
<div>
<a href="bingo.html">PLAY BINGO!</a>
</div>
<div style="text-align: center;">
<div id="collage_grid" style="display: block;"></div>
</div>
<script type="text/javascript">
var collage_grid = document.getElementById("collage_grid");
var files = images;
if (files) {
var column_count = no_of_columns; // from file
var row_count = files.length;
console.log("Number of pictures in each column = " + row_count)
var image_count = 0;
var grid = "";
grid += "<div class=\"row\">";
for (var i = 0; i < column_count; i++) {
var used_images = new Array(row_count).fill(0);
grid += "<div class=\"column\">";
for (var j = 0; j < row_count; j++) {
do {
var random_num = Math.round(Math.random() * (row_count - 1));
} while (used_images[random_num] == 1);
grid += "<img src=\"" + files[random_num].url + "\" height=\"\">";
used_images[random_num] = 1;
}
grid += "</div>";
}
grid += "</div>";
collage_grid.innerHTML = grid;
}
</script>
</body>
</html>