tangled
alpha
login
or
join now
vielle.dev
/
dnd-astral-powers
0
fork
atom
this repo has no description
0
fork
atom
overview
issues
pulls
pipelines
add user search to homepage + nicer default font
vielle.dev
1 month ago
1e269352
fbbf1145
verified
This commit was signed with the committer's
known signature
.
vielle.dev
SSH Key Fingerprint:
SHA256:/4bvxqoEh9iMdjAPgcgAgXKZZQTROL3ULiPt6nH9RSs=
+54
-2
3 changed files
expand all
collapse all
unified
split
src
Base.astro
components
astral
Powers.astro
pages
index.astro
+7
src/Base.astro
···
14
14
@layer base {
15
15
:root {
16
16
color-scheme: dark;
17
17
+
font-family: sans-serif;
18
18
+
}
19
19
+
20
20
+
input,
21
21
+
textarea,
22
22
+
button {
23
23
+
font-family: inherit;
17
24
}
18
25
}
19
26
</style>
-1
src/components/astral/Powers.astro
···
203
203
/* dialog popup styles */
204
204
#info {
205
205
width: 40ch;
206
206
-
/* position-anchor: --tree-node; */
207
206
position-area: bottom span-right;
208
207
position-try:
209
208
bottom span-left,
+47
-1
src/pages/index.astro
···
4
4
5
5
<Base title="D&D Utils">
6
6
<script>
7
7
+
import "actor-typeahead";
7
8
import { getAuth } from "../lib/auth";
8
8
-
const [client, agent, did] = await getAuth();
9
9
+
const [_, __, did] = await getAuth();
9
10
const login = document.getElementById("login");
10
11
if (!login) throw "no #login";
11
12
if (did)
12
13
login.outerHTML = `<a id="login" href="/atproto/logout">Logout</a>`;
13
14
else login.outerHTML = `<a id="login" href="/atproto/login">Login</a>`;
15
15
+
16
16
+
const astralUser = document.getElementById(
17
17
+
"astral-user",
18
18
+
) as HTMLFormElement;
19
19
+
astralUser.addEventListener("submit", (ev) => {
20
20
+
if (!astralUser.checkValidity()) return;
21
21
+
ev.preventDefault();
22
22
+
// must exist due to valid state
23
23
+
const handle = astralUser.querySelector("input")?.value;
24
24
+
window.location.assign(`/astral/${handle}`);
25
25
+
});
14
26
</script>
27
27
+
28
28
+
<style>
29
29
+
form {
30
30
+
display: grid;
31
31
+
gap: 5px;
32
32
+
grid-template: auto auto / 1fr auto;
33
33
+
}
34
34
+
35
35
+
label {
36
36
+
grid-column: span 2;
37
37
+
}
38
38
+
39
39
+
actor-typeahead {
40
40
+
--color-background: #2b2b2b;
41
41
+
--color-border: #ffffff22;
42
42
+
--color-shadow: #ffffff;
43
43
+
--color-hover: #ffffff11;
44
44
+
}
45
45
+
46
46
+
input:not([type="submit"]) {
47
47
+
box-sizing: border-box;
48
48
+
width: 100%;
49
49
+
}
50
50
+
</style>
51
51
+
15
52
<h1>D&D Utils</h1>
16
53
<a id="login" href="#" style="display: none;"></a>
17
54
<p>Pages:</p>
18
55
<ul>
19
56
<li><a href="/astral">Astral Powers</a></li>
57
57
+
<li>
58
58
+
<form id="astral-user">
59
59
+
<label for="username"> View Astral Powers for </label>
60
60
+
<actor-typeahead>
61
61
+
<input required autocomplete="off" id="username" />
62
62
+
</actor-typeahead>
63
63
+
<input type="submit" value="Search" />
64
64
+
</form>
65
65
+
</li>
20
66
<!-- <li><a href="/chip">Chip</a></li> -->
21
67
</ul>
22
68
</Base>