By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 index.html

View raw Download
text/html • 2.33 kiB
HTML document, ASCII text
        
            
1
<!DOCTYPE html>
2
<html lang="en-US">
3
4
<head>
5
<title>Unofficial Roundabout Theme Index</title>
6
</head>
7
8
<body>
9
<h1><sub>Unofficial</sub> Roundabout Theme Index</h1>
10
11
<p>Don't know how to install a theme? See <a href="install.html">install.html</a></p>
12
13
<ul id="ThemeList"></ul>
14
15
<template id="ThemeListElement">
16
<li>
17
<table class="table-root">
18
<tr>
19
<th class="theme-name" colspan="2">
20
21
</th>
22
</tr>
23
<tr>
24
<th>
25
Author
26
</th>
27
<td>
28
<a
29
class="author-url"
30
></a>
31
</td>
32
</tr>
33
<tr>
34
<td colspan="2">
35
<a
36
class="download"
37
>Theme CSS</a>
38
</td>
39
</tr>
40
</table>
41
</li>
42
</template>
43
44
<script type="module">
45
const ThemeList = await fetch("themes.xml")
46
.then(res => res.text())
47
.then(txt => {
48
const parser = new DOMParser();
49
const doc = parser.parseFromString(txt, "text/xml");
50
return doc;
51
});
52
53
const ThemeListElementTemplate = document.querySelector("#ThemeListElement");
54
const HTMLThemeList = document.querySelector("#ThemeList");
55
56
const themes = ThemeList.querySelectorAll("theme");
57
for (let index = 0; index < themes.length; index++) {
58
const theme = themes[index];
59
60
const title = theme.querySelector("title").textContent;
61
const author = theme.querySelector("author");
62
const path = theme.querySelector("uri").textContent;
63
64
const ListEl = ThemeListElementTemplate.content.cloneNode(true);
65
ListEl.querySelector(".theme-name").textContent = title;
66
ListEl.querySelector(".download").href = "themes/" + path;
67
68
const Author = ListEl.querySelector(".author-url");
69
Author.href = author.getAttribute("uri");
70
Author.textContent = author.textContent;
71
72
HTMLThemeList.appendChild(ListEl);
73
}
74
</script>
75
</body>
76
77
</html>
78