-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselect-map.html
35 lines (32 loc) · 969 Bytes
/
select-map.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Arx Chess</title>
<link rel="stylesheet" href="play.css" />
<!-- TODO: own stylesheet -->
<link rel="icon" href="bishop-knight-white.png">
<script type="module">
const maps = import.meta.glob(
"./src/maps/*.txt",
{
query: "?raw",
eager: true,
},
);
const menu = document.getElementById("menu")
let html = "<li><h1>Select map</h1></li>"
for (const mapPath in maps) {
const map = mapPath.slice(11, -4)
const mapCapitalized = mapPath[11].toUpperCase() + mapPath.slice(12, -4)
html += `<li><a href="/play.html?map=${map}" class="button">${mapCapitalized}</a></li>`
}
html += "<li><a href='/' class='button hollow'>Back to main menu</a></li>"
menu.innerHTML = html
</script>
</head>
<body>
<menu id="menu">
</menu>
</body>