forked from nostrdata/kinds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
102 lines (91 loc) · 2.71 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>kinds</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="stylesheet"
type="text/css"
media="screen"
href="css/tailwind.css"
/>
<style>
table tr:nth-child(odd) {
background-color: #f2f2f2;
}
a:link {
color: blue;
}
/* visited link */
a:visited {
color: blue;
}
</style>
<script type="application/json" id="data" src="./kinds.json"></script>
<script type="module">
import { h, html, Component, render } from './js/standalone.module.js'
import Navbar from './components/Navbar.js'
let script_tag = document.getElementById('data')
let src_value = script_tag.getAttribute('src')
console.log('src_value', src_value)
fetch(src_value)
.then(response => response.json())
.then(data => {
console.log('data', data)
var di = {}
di.data = data
render(
html`
<${Navbar} title="nostr" sub="kinds" />
<table style="text-align: center; padding: 10px;" cellpadding="2">
<tr>
<th>kind</th>
<th>description</th>
<th>NIP</th>
</tr>
${di.data.map(
item => html`
<tr>
<td style="color:green"><b>${item.kind}</b></td>
<td>
<a
target="_blank"
href="${item.url || 'https://nips.be/' + item.NIP[0]}"
>${item.description}</a
>
</td>
<td>${item.NIP.join(',')}</td>
</tr>
`
)}
</table>
<br />
|
<a target="_blank" href="https://github.com/nostrdata/kinds"
>Github</a
>
|
<a
target="_blank"
href="https://github.com/nostrdata/kinds/edit/gh-pages/kinds.json"
>Add Kind</a
>
|
<a target="_blank" href="https://nips.be/search">Search NIPs</a>|
`,
document.body
)
})
// console.log(di.data)
// components
var Row = props => {
return html` <div class="flex"></div> `
}
</script>
</head>
<body
style="font-family: monospace; font-size: 12px; padding-left: 10%"
></body>
</html>