+2
-6
src/components/blog/Post.astro
+2
-6
src/components/blog/Post.astro
···
12
12
13
13
const { id, data, layer } = Astro.props;
14
14
15
-
// const img = data.image.match(/.*(?=\.png)/gm);
16
-
// if (img === null) return;
17
-
// const { default: image } = await import(`../../posts/assets/${img[0]}.png`);
18
-
19
15
const image = await (async () => {
20
16
if (!data.image) return;
21
17
const img = data.image.match(/.*(?=\.png)/gm);
22
18
if (img === null) return;
23
19
return await import(`../../posts/assets/${img[0]}.png`).then(
24
-
(x) => x.default
20
+
(x) => x.default,
25
21
);
26
22
})();
27
23
···
65
61
.map(
66
62
(x, i) =>
67
63
`--x-offset-${i}: calc((100svw - ${blog.post.width + 2 * blog.post.xPadding}rem) * ${positions[0] + x[0]} + ${blog.post.xPadding}rem);
68
-
--y-offset-${i}: ${blog.post.yLeeway * 2 * (positions[1] + x[1]) - blog.post.yLeeway}rem;`
64
+
--y-offset-${i}: ${blog.post.yLeeway * 2 * (positions[1] + x[1]) - blog.post.yLeeway}rem;`,
69
65
)
70
66
.join("\n")}
71
67
+1
-1
src/components/blog/background/Cloud.astro
+1
-1
src/components/blog/background/Cloud.astro
+3
-3
src/components/blog/background/Clouds.astro
+3
-3
src/components/blog/background/Clouds.astro
···
35
35
top: ${y}rem;
36
36
left: calc(${x} * 200lvw - 100lvw);
37
37
position: absolute;`}
38
-
role="img"
38
+
role="img"
39
39
id={"cloud-" + i}
40
40
data-parallax
41
-
aria-label=""
41
+
aria-label=""
42
42
/>,
43
43
],
44
44
};
···
46
46
{
47
47
y: 0,
48
48
output: [],
49
-
}
49
+
},
50
50
).output
51
51
}
52
52
</div>
+3
-3
src/components/blog/background/Moon.astro
+3
-3
src/components/blog/background/Moon.astro
···
23
23
width="100"
24
24
height="100"
25
25
style={`--parallax-speed: ${blog.background.parallax.moon}`}
26
-
data-parallax role="img"
26
+
data-parallax
27
+
role="img"
27
28
aria-label=""
28
-
29
29
>
30
-
<title></title>
30
+
<title></title>
31
31
<defs>
32
32
<clipPath id="shadow">
33
33
<rect x={phase < 0.5 ? "0" : "100"} y="0" width="100" height="200"></rect>
+2
-2
src/components/blog/background/Stars.astro
+2
-2
src/components/blog/background/Stars.astro
···
39
39
const prongs = Math.round(
40
40
blog.background.stars.prongs[0] +
41
41
Math.random() *
42
-
(blog.background.stars.prongs[1] - blog.background.stars.prongs[0])
42
+
(blog.background.stars.prongs[1] - blog.background.stars.prongs[0]),
43
43
);
44
44
45
45
return (
···
55
55
xmlns="http://www.w3.org/2000/svg"
56
56
viewBox="0 0 100 100"
57
57
role="img"
58
-
aria-label=""
58
+
aria-label=""
59
59
>
60
60
<title />
61
61
{new Array(prongs).fill(0).map((_, i) => (
+5
-2
src/content.config.ts
+5
-2
src/content.config.ts
···
8
8
date: z.date(),
9
9
colour: z.string(),
10
10
// no alt (empty as decorative)
11
-
image: z.string().refine(
11
+
image: z
12
+
.string()
13
+
.refine(
12
14
(value) => value.endsWith(".png"),
13
15
(val) => ({
14
16
message: `${val} must end with .png`,
15
17
}),
16
-
).optional(),
18
+
)
19
+
.optional(),
17
20
hasMdx: z.boolean().default(false),
18
21
}),
19
22
});