index.html
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> 25Author 26</th> 27<td> 28<a 29class="author-url" 30></a> 31</td> 32</tr> 33<tr> 34<td colspan="2"> 35<a 36class="download" 37>Theme CSS</a> 38</td> 39</tr> 40</table> 41</li> 42</template> 43 44<script type="module"> 45const ThemeList = await fetch("themes.xml") 46.then(res => res.text()) 47.then(txt => { 48const parser = new DOMParser(); 49const doc = parser.parseFromString(txt, "text/xml"); 50return doc; 51}); 52 53const ThemeListElementTemplate = document.querySelector("#ThemeListElement"); 54const HTMLThemeList = document.querySelector("#ThemeList"); 55 56const themes = ThemeList.querySelectorAll("theme"); 57for (let index = 0; index < themes.length; index++) { 58const theme = themes[index]; 59 60const title = theme.querySelector("title").textContent; 61const author = theme.querySelector("author"); 62const path = theme.querySelector("uri").textContent; 63 64const ListEl = ThemeListElementTemplate.content.cloneNode(true); 65ListEl.querySelector(".theme-name").textContent = title; 66ListEl.querySelector(".download").href = "themes/" + path; 67 68const Author = ListEl.querySelector(".author-url"); 69Author.href = author.getAttribute("uri"); 70Author.textContent = author.textContent; 71 72HTMLThemeList.appendChild(ListEl); 73} 74</script> 75</body> 76 77</html> 78