-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
58 lines (53 loc) · 2.17 KB
/
index.html
File metadata and controls
58 lines (53 loc) · 2.17 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
<!doctype html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>README</title>
<style>
html,body{margin:0;padding:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial;color:#dbe9f5}
body{background:#0b0f14}
#content{box-sizing:border-box;padding:1rem;max-width:900px;margin:0 auto}
/* Make images fill the page width but keep aspect ratio */
#content img{display:block;width:100%;height:auto;max-width:100%;border:0}
/* Typography */
#content h1,#content h2,#content h3,#content h4{color:#ffffff;margin-top:1.25rem}
#content p, #content li {color:#dbe9f5}
a{color:#58a6ff}
a:hover{text-decoration:underline}
blockquote{color:#9fb3c8;border-left:4px solid rgba(255,255,255,0.06);padding-left:1rem;margin:0.75rem 0}
/* Code and pre */
#content pre, #content code{background:#021019;color:#e6f0f6;border-radius:6px;padding:.25rem;max-width:100%;overflow:auto}
#content pre{padding:1rem}
/* Tables */
#content table{border-collapse:collapse;width:100%;margin:0.5rem 0}
#content th,#content td{border:1px solid rgba(255,255,255,0.06);padding:.4rem .6rem}
</style>
<div id="content"></div>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
const RAW_BASE = 'https://raw.githubusercontent.com/evilC/WearWare/main/';
function makeAbsolute(url){
if(!url) return url;
if (/^(https?:|\/\/|data:|mailto:)/.test(url)) return url;
return RAW_BASE + url.replace(/^\/+/, '');
}
const README_DIR = RAW_BASE + 'qr-faq/';
fetch(README_DIR + 'README.md')
.then(r => r.text())
.then(t => {
const html = marked.parse(t);
const container = document.getElementById('content');
container.innerHTML = html;
container.querySelectorAll('img').forEach(img => {
const src = img.getAttribute('src');
if (src && !/^(https?:|\/\/|data:|mailto:)/.test(src)) {
img.src = README_DIR + src.replace(/^\/+/, '');
}
});
container.querySelectorAll('a').forEach(a => {
const href = a.getAttribute('href');
if (href && !/^(https?:|\/\/|mailto:|#)/.test(href)) {
a.href = README_DIR + href.replace(/^\/+/, '');
}
});
});
</script>