-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
85 lines (84 loc) · 1.95 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
85
<!DOCTYPE html>
<html lang="en">
<head>
<script>
const js = {
"cv":"change-val.js",
"fn":"function.js",
"hw":"hello-world.js",
"obj":"objects.js"
}
const c = {
"hw":"hello-world.c",
"struct":"struct.c",
}
const cs = {
"hw":"hello-world.cs",
"hw6":"net6.x-hw.cs",
}
const python = {
"cl":"class.py",
"fb":"foo-bar.py",
"hw":"hello-world.py",
"mn":"main.py",
"py2c":"py2compatibility.py",
}
const lua = {
"fb":"foo-bar.lua",
"hw":"hello-world.lua",
"tbls":"tables.lua",
}
const files = {js, c, cs, python, lua} //Hopefully last error fix? This better work >:(
for (dir in files) {
let element = document.createElement("<div>");
element.innerHTML = templates.innerHTML + "\n<div class='" + dir.toString()+"' id='" + dir.toString() + "'>" + dir.toString()
for (fl in dir) {
let curr = document.getElementById(dir.toString())
let reader = new FileReader();
reader.addEventListener('load', function(e) {
let text = e.target.result;
document.querySelector("#file-contents").textContent = text;
});
let res = reader.readAsText("./" + dir.toString() + fl);
document.getElementById(dir.toString()).innerHTML = document.getElementById(dir.toString()).innerHTML + "\n" + res
}
}
</script>
<title>
ToastersUnited
</title>
<style>
* {
font-family: system-ui;
}
body {
background-color: black;
}
.title {
color: green;
position: fixed;
left: 50%;
font-size: 30px;
}
.abt {
position: absolute;
left: 50%;
color: white;
top: 5%;
border-color: black;
border-decoration: dashed;
border-radius: 7px;
border-color: white;
}
</style>
</head>
<body>
<div class="title"><strong>Lang-Templates</strong></div>
<div class="abt">
Templates for your favourite programming languages.<br>It's that simple.<br><strong><a href=https://github.com/NILL2021/lang-templates>Contribute some templates on Github!</a>
<br>
This uses JavaScript to loop over the files in the repo and write them to the screen. Pretty cool, eh?
<br>
</div>
</body>
</html>