-
Notifications
You must be signed in to change notification settings - Fork 20
/
index.html
84 lines (73 loc) · 2.05 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.button-container {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
button {
padding: 24px 48px;
font-size: 48px;
color: white;
border: none;
cursor: pointer;
margin-bottom: 24px;
border-radius: 5px;
margin-right: 24px;
}
.team-exists {
background-color: #4CAF50;
}
.team-not-exists {
background-color: grey;
}
button:hover {
opacity: 0.8;
}
button:focus {
outline: none;
}
h1 {
text-align: center;
font-size: 52px;
}
p {
text-align: center;
font-size: 32px;
}
body {
background-color: aliceblue;
}
</style>
</head>
<body>
<h1>우리 팀을 소개합니다!</h1>
<p>제출을 완료한 팀은 초록색으로 표시됩니다.</p>
<div class="button-container">
<script>
for (let i = 1; i <= 20; i++) {
const folderName = `team${i}`;
const button = document.createElement('button');
button.textContent = `${i}조`;
button.addEventListener('click', () => {
window.location.href = `${folderName}/index.html`;
});
const xhr = new XMLHttpRequest();
xhr.open('HEAD', `${folderName}/index.html`, false);
xhr.send();
if (xhr.status === 200) {
button.classList.add('team-exists');
} else {
button.classList.add('team-not-exists');
}
document.body.appendChild(button);
}
</script>
</div>
</body>
</html>