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
zoom button
vielle.dev
1 month ago
acd51d8c
a6a0a359
verified
This commit was signed with the committer's
known signature
.
vielle.dev
SSH Key Fingerprint:
SHA256:EoUuRRBFQKUfYh74C568g83i9g4fVi5OTtOENMSfa+0=
+79
-51
2 changed files
expand all
collapse all
unified
split
src
Base.astro
pages
index.astro
+78
-50
src/Base.astro
···
2
2
type Props =
3
3
| {
4
4
title: string;
5
5
+
zoomable?: true;
5
6
}
6
7
| {
7
8
frontmatter: {
···
11
12
---
12
13
13
14
<html lang="en">
14
14
-
<head>
15
15
-
<meta charset="utf-8" />
16
16
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
17
17
-
<meta name="generator" content={Astro.generator} />
18
18
-
<title>
19
19
-
{
20
20
-
"title" in Astro.props
21
21
-
? Astro.props.title
22
22
-
: Astro.props.frontmatter.title
23
23
-
}
24
24
-
</title>
25
25
-
<style is:inline>
26
26
-
@layer base {
27
27
-
:root {
28
28
-
color-scheme: dark;
29
29
-
font-family: sans-serif;
30
30
-
}
31
31
-
32
32
-
input,
33
33
-
textarea,
34
34
-
button {
35
35
-
font-family: inherit;
36
36
-
}
37
37
-
}
38
38
-
</style>
39
39
-
{"frontmatter" in Astro.props
40
40
-
? <style>
41
41
-
body {
42
42
-
background: canvas;
43
43
-
margin: 0;
44
44
-
padding: .2em 1em;
45
45
-
grid-area: main;
46
46
-
}
47
47
-
15
15
+
<head>
16
16
+
<meta charset="utf-8" />
17
17
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
18
18
+
<meta name="generator" content={Astro.generator} />
19
19
+
<title>
20
20
+
{
21
21
+
"title" in Astro.props
22
22
+
? Astro.props.title
23
23
+
: Astro.props.frontmatter.title
24
24
+
}
25
25
+
</title>
26
26
+
<style is:inline>
27
27
+
@layer base {
48
28
:root {
49
49
-
background: color-mix(in oklab, canvas 100%, currentColor 5%);
50
50
-
min-height: 100vh;
51
51
-
display: grid;
52
52
-
grid-template: ". main ." 1fr / 1fr minmax(auto, 80ch) 1fr;
29
29
+
color-scheme: dark;
30
30
+
font-family: sans-serif;
53
31
}
54
32
55
55
-
blockquote {
56
56
-
border-left: 1px solid currentColor;
57
57
-
margin-left: 1em;
58
58
-
padding-left: 1em;
33
33
+
input,
34
34
+
textarea,
35
35
+
button {
36
36
+
font-family: inherit;
59
37
}
60
60
-
</style>
61
61
-
: null}
62
62
-
<slot name="head" />
63
63
-
</head>
64
64
-
<body>
65
65
-
{"frontmatter" in Astro.props ? <div style="height: 0.01px;"/> : null}
66
66
-
<slot />
67
67
-
</body>
38
38
+
}
39
39
+
</style>
40
40
+
{"frontmatter" in Astro.props
41
41
+
? <style>
42
42
+
body {
43
43
+
background: canvas;
44
44
+
margin: 0;
45
45
+
padding: .2em 1em;
46
46
+
grid-area: main;
47
47
+
}
48
48
+
49
49
+
:root {
50
50
+
background: color-mix(in oklab, canvas 100%, currentColor 5%);
51
51
+
min-height: 100vh;
52
52
+
display: grid;
53
53
+
grid-template: ". main ." 1fr / 1fr minmax(auto, 40rem) 1fr;
54
54
+
}
55
55
+
56
56
+
blockquote {
57
57
+
border-left: 1px solid currentColor;
58
58
+
margin-left: 1em;
59
59
+
padding-left: 1em;
60
60
+
}
61
61
+
62
62
+
code {
63
63
+
overflow-wrap: anywhere;
64
64
+
}
65
65
+
</style>
66
66
+
: null}
67
67
+
<slot name="head" />
68
68
+
</head>
69
69
+
<body>
70
70
+
{"frontmatter" in Astro.props ? <div style="height: 0.01px; margin-bottom: 1em;"/> : null}
71
71
+
{"frontmatter" in Astro.props || Astro.props.zoomable
72
72
+
? <div>
73
73
+
<script>
74
74
+
let size = 16;
75
75
+
const fontSizeEl = document.getElementById("font-size") as HTMLElement;
76
76
+
77
77
+
document.getElementById("dec")?.addEventListener("click", () => {
78
78
+
size -= 2;
79
79
+
document.body.style.fontSize = `${size}px`;
80
80
+
fontSizeEl.innerText = document.body.style.fontSize
81
81
+
})
82
82
+
83
83
+
document.getElementById("inc")?.addEventListener("click", () => {
84
84
+
size += 2;
85
85
+
document.body.style.fontSize = `${size}px`;
86
86
+
fontSizeEl.innerText = document.body.style.fontSize
87
87
+
})
88
88
+
</script>
89
89
+
<button id="dec" style="width: 2em; height: 1.5lh; padding: 0.2em;">-</button>
90
90
+
<span id="font-size">16px</span>
91
91
+
<button id="inc" style="width: 2em; height: 1.5lh; padding: 0.2em;">+</button>
92
92
+
</div>
93
93
+
: null}
94
94
+
<slot />
95
95
+
</body>
68
96
</html>
+1
-1
src/pages/index.astro
···
2
2
import Base from "../Base.astro";
3
3
---
4
4
5
5
-
<Base title="D&D Utils">
5
5
+
<Base title="D&D Utils" zoomable>
6
6
<script>
7
7
import "actor-typeahead";
8
8
import { getAuth } from "../lib/auth";