-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.html
More file actions
80 lines (67 loc) · 3.43 KB
/
lib.html
File metadata and controls
80 lines (67 loc) · 3.43 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quark Standard Library</title>
<style>
@media (max-aspect-ratio: 1) {
main > nav {
display: none !important;
}
main > div {
width: 100vw !important;
padding: 2em !important;
padding-top: 7em !important;
}
}
</style>
<link rel="shortcut icon" href="assets/icon.png" />
<link rel="stylesheet" href="style.css" />
<script src="js/loader.js"></script>
<script src="js/markdown.js"></script>
</head>
<body>
<nav style="height: 5em; position: fixed; top: 0; display: flex; align-items: center; box-sizing: border-box;
padding: 0 1em; width: 100%; background: linear-gradient(to bottom, var(--background) 30%, transparent),
linear-gradient(#0004, #0004);">
<a href="index.html" style="display: grid; place-items: center; border-bottom: none;">
<img src="assets/title.png" style="height: 4em;"/>
</a>
<div style="margin-left: auto; padding: 2em; display: flex; gap: 2em;">
<a href="https://github.com/quark-programming/quark" target="_blank">GitHub</a>
<a href="index.html">Home</a>
</div>
</nav>
<main style="display: flex; height: 100vh; background: var(--background);">
<nav style="width: 15em; background: var(--gray); box-sizing: border-box; padding: 1em; padding-top: 6em;
display: flex; flex-direction: column; gap: 0.5em; overflow-y: scroll; box-shadow: 2px 0 0 #0004;">
<script>
const nav_clicks = {};
let last_inset = 0;
load_self("markdown/lib/nav.json", text => Promise.all(JSON.parse(text).map(async ([label, value, cls = ""], i) => {
if(typeof value === "number") {
return `<h${value} class="${cls}" style="margin-${value - 2 ? "top" : "bottom"}: .25em;">
${label}
</h${value}>`;
}
if (label.startsWith(">")) label = `<code class="no-code"><pre>${["i. ", "ii. ", "iii. ", "iv. ", "v. "][last_inset++]}</pre></code>${label.slice(1).trim()}`;
else last_inset = 0;
const render = markdown(await fetch(`markdown/lib/${value}.md`).then(res => res.text()));
nav_clicks[value] = () => {
document.querySelector("article").innerHTML = render;
document.querySelector("main > div").scrollTo(0, 0);
}
if (location.hash.slice(1) === value || i === 1) nav_clicks[value]();
return `<a class="${cls} nav" style="text-decoration: none" href="javascript:" onclick="location.hash = '#${value}'">${label}</a>`;
})));
window.onhashchange = () => nav_clicks[location.hash.slice(1)]?.();
</script>
<a href="docs.html" style="color: #ccc;" target="_blank">Docs</a>
</nav>
<div style="width: calc(100vw - 15em); box-sizing: border-box; padding: 4em; padding-top: 9em; overflow-y: scroll;">
<article style="display: flex; flex-direction: column; gap: 2em; color: #ddd;"></article>
</div>
</main>
</body>
</html>