generated from ipfs-examples/example-fork-go-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
216 lines (202 loc) · 5.39 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>JS IPFS API name example</title>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/css/tachyons.min.css"
crossorigin
/>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/ipfs.css"
crossorigin
/>
<link rel="shortcut icon" href="favicon.ico" />
<script type="module" src="./src/index.js" defer></script>
<style>
form {
margin: 1.25rem 0;
}
textarea {
resize: vertical;
}
.hidden {
display: none;
}
button:disabled {
background-color: rgba(0, 0, 0, 0.2);
}
button:hover:disabled {
background-color: rgba(0, 0, 0, 0.2);
cursor: not-allowed;
}
</style>
</head>
<body class="montserrat f5">
<header class="flex items-center pa3 bg-navy bb bw3 b--aqua">
<a href="https://ipfs.io" title="home">
<img
alt="IPFS logo"
src="./public/ipfs-logo.svg"
style="height: 50px"
class="v-top"
/>
</a>
</header>
<main class="pa4-l bg-snow mw7 mv5 center pa4">
<h1 class="pa0 f2 ma0 mb4 aqua tc">IPFS HTTP Client</h1>
<h2><code>name.publish()</code> and <code>name.resolve()</code></h2>
<p id="status" class="bg-navy pa3 white-80 mb4">Ready to connect</p>
<form id="connect-to-http-api">
<label for="connect-input" class="f5 ma0 pb2 aqua fw4 db"
>Enter the multiaddr of a IPFS HTTP API</label
>
<input
class="input-reset bn black-80 bg-white pa3 w-100 w-80-l mb3 mb0-l ft"
type="text"
name="connect-input"
id="connect-input"
/>
<input
class="
button-reset
pv3
tc
bn
bg-animate bg-black-80
hover-bg-aqua
white
pointer
w-100 w-20-l
fr
"
id="connect-submit"
type="submit"
value="Connect"
/>
</form>
<hr class="mv3" />
<form id="publish-text" class="flex flex-column">
<label for="add-file-input" class="f5 ma0 pb2 aqua fw4 db"
>Add a new file to IPFS and publish it</label
>
<textarea
id="add-file-input"
name="add-file-input"
placeholder="hello, world"
required
class="border-box hover-black w-100 ba b--light-gray pa2 mb2"
rows="6"
></textarea>
<button
disabled
class="
button-reset
pv3
tc
bn
bg-animate bg-black-80
hover-bg-aqua
white
pointer
w-100 w-20-l
self-end
"
id="add-file-submit"
type="submit"
>
Publish
</button>
</form>
<form id="publish-path">
<label for="publish-cid-input" class="f5 ma0 pb2 aqua fw4 db"
>Publish an existing file or directory from IPFS.</label
>
<input
class="input-reset bn black-80 bg-white pa3 w-100 w-80-l mb3 mb0-l ft"
id="publish-cid-input"
name="publish-cid-input"
type="text"
placeholder="IPFS path"
required
/>
<button
class="
button-reset
pv3
tc
bn
bg-animate bg-black-80
hover-bg-aqua
white
pointer
w-100 w-20-l
fr
"
id="publish-cid-submit"
type="submit"
disabled
>
Publish
</button>
</form>
<div class="results--publish hidden">
<p>Published at <code id="publish-result"></code></p>
<p>
<a id="publish-gateway-link" target="_blank"
>Open with HTTP gateway</a
>
</p>
</div>
<hr class="mv3" />
<form id="resolve-name">
<label for="resolve-name-input" class="f5 ma0 pb2 aqua fw4 db"
>Resolve an IPNS name</label
>
<input
id="resolve-name-input"
name="resolve-name-input"
type="text"
placeholder="IPNS name"
required
class="input-reset bn black-80 bg-white pa3 w-100 w-80-l mb3 mb0-l ft"
/>
<button
class="
button-reset
pv3
tc
bn
bg-animate bg-black-80
hover-bg-aqua
white
pointer
w-100 w-20-l
fr
"
id="resolve-name-submit"
type="submit"
disabled
>
Resolve
</button>
</form>
<div class="results--resolve hidden">
<p>IPNS: <code id="resolve-ipns"></code></p>
<p>Resolves to <code id="resolve-result"></code></p>
<p>
<a id="resolve-gateway-link-ipfs" target="_blank" class="db"
>Open IPFS with HTTP gateway</a
>
<a id="resolve-gateway-link-ipns" target="_blank" class="db"
>Open IPNS with HTTP gateway</a
>
</p>
</div>
</main>
</body>
</html>