-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
42 lines (36 loc) · 1.02 KB
/
index.html
File metadata and controls
42 lines (36 loc) · 1.02 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./mi.css">
<title>mi.css</title>
</head>
<body>
<header style="margin:0">
<h1 style="margin:0">ʕ•ᴥ•ʔ mi.css</h1>
<div style="display:flex;gap:2px;font-size:0.8em">
<a style="cursor:pointer;text-decoration:underline" onclick="load('home')">Home</a> |
<a style="cursor:pointer;text-decoration:underline" onclick="load('post')">Post Example</a> |
<a style="cursor:pointer;text-decoration:underline" onclick="load('form')">Form Example</a>
</div>
</header>
<div id='root'>
</div>
</body>
<script>
var root = document.getElementById('root');
var html5 = {};
function load(key) {
if (html5[key])
return root.innerHTML = html5[key];
fetch(`./pages/${key}.txt`)
.then(res => res.text())
.then(data => {
html5[key] = data;
load(key);
})
}
load('home');
</script>
</html>