-
Notifications
You must be signed in to change notification settings - Fork 28
/
index.html
executable file
·64 lines (58 loc) · 2.2 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>Hacktober 2019</title>
<link rel="stylesheet" href="./css/bootstrap.min.css">
<link rel="stylesheet" href="./css/animate.css">
<link rel="stylesheet" href="./css/custom.style.css">
</head>
<body>
<h1 class="text-center my-5 masthead">
<span class="masthead-hacktober">Hacktober</span>
<span class="masthead-fest">Fest</span>
<span class="masthead-2019">2019</span>
</h1>
<div class="container">
<div id="peserta" class="row">
</div>
</div>
<script src="./js/index.js" charset="utf-8"></script>
<script src="./js/jquery-3.3.1.slim.min.js"></script>
<script src="./js/popper.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script src="./js/wow.min.js"></script>
<script charset="utf-8">
// Awali wow.js untuk animasi
new WOW().init();
// Generator card
const temp = peserta;
let foo = [];
const kotak = document.getElementById("peserta");
const btn_colors = ["btn-primary", "btn-secondary", "btn-danger", "btn-success", "btn-warning", "btn-dark"];
for (const label in temp) {
let col = document.createElement("div");
let card = document.createElement("div");
let cardBody = document.createElement("div");
let img = document.createElement("img");
let btn = document.createElement("a");
let text = document.createTextNode(label);
img.setAttribute("src", temp[label].photo);
img.classList.add("card-img-top", "img-thumbnail");
const random_btn = Math.ceil(Math.random() * 5);
btn.classList.add("btn", btn_colors[random_btn], "btn-block");
btn.setAttribute("href", temp[label].link);
btn.appendChild(text);
cardBody.classList.add("card-body");
cardBody.appendChild(btn);
card.classList.add("card", 'wow', 'bounceInUp');
card.appendChild(img);
card.appendChild(cardBody);
col.classList.add("col-md-4", "h-100", "my-3");
col.appendChild(card);
kotak.appendChild(col);
}
</script>
</body>
</html>