-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
62 lines (58 loc) · 1.41 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
<!DOCTYPE html><html lang="ja"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><link rel="icon" href="data:">
<title>IchigoJam Q&A</title>
</head><body>
<h1>IchigoJam Q&A</h1>
<input type=text id=inkey placeholder=絞り込み><br>
<main id=main>
</main>
<footer>
<a href=https://github.com/IchigoJam/ichigojam-qa/blob/main/QA.csv>QA.csv</a>
<a href=https://github.com/ichigojam/ichigojam-qa/>src on GitHub</a>
</footr>
<script type="module">
import { CSV } from "https://js.sabae.cc/CSV.js";
const data = await CSV.fetchJSON("QA.csv");
const show = () => {
main.innerHTML = "";
const key = inkey.value;
for (const d of data) {
if (!key || d.Q.indexOf(key) >= 0 || d.A.indexOf(key) >= 0) {
const div = document.createElement("div");
main.appendChild(div);
const divq = document.createElement("div");
divq.textContent = d.Q;
div.appendChild(divq);
const diva = document.createElement("div");
diva.textContent = d.A;
div.appendChild(diva);
}
}
};
show();
inkey.oninput = show;
</script>
<style>
body {
font-family: sans-serif;
}
input {
font-size: 16px;
margin: 0.3em 0;
}
main > div {
border: 1px solid #f88;
border-radius: .5em;
margin: .2em;
padding: .2em 1.2em;
}
main > div > div {
white-space: pre-wrap;
}
main > div > div:first-child {
font-weight: bold;
margin-left: -.5em;
}
a {
color: gray !important;
}
</style>