+2
src/components/blog/Background.astro
+2
src/components/blog/Background.astro
+26
src/components/blog/background/Star.astro
+26
src/components/blog/background/Star.astro
···
···
1
+
---
2
+
import { blog } from "@/config";
3
+
---
4
+
5
+
<style>
6
+
img {
7
+
position: absolute;
8
+
width: var(--size);
9
+
height: var(--size);
10
+
top: calc(var(--y) * 120lvh - 10lvh);
11
+
left: calc(var(--x) * 120lvw - 10lvw);
12
+
}
13
+
</style>
14
+
15
+
{
16
+
new Array(blog.background.stars.count).fill(0).map((_) => (
17
+
<img
18
+
src="https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fmedia.istockphoto.com%2Fphotos%2Fgolden-star-picture-id498723198%3Fk%3D6%26m%3D498723198%26s%3D612x612%26w%3D0%26h%3DrIeSl8WZdo6qWBvw_vgWc3vPhrBj39jCyeiZKltHIWk%3D&f=1&nofb=1&ipt=d84206dedd597d64591aa883e18799f72d5863f495a9ce7b22c0e1814215263b"
19
+
alt=""
20
+
style={`--parallax-speed: ${blog.background.parallax.star};
21
+
--size: ${blog.background.stars.size[0] + Math.random() * (blog.background.stars.size[1] - blog.background.stars.size[0])}rem;
22
+
--x: ${Math.random()};
23
+
--y: ${Math.random()}`}
24
+
/>
25
+
))
26
+
}
+6
src/config.ts
+6
src/config.ts