[Archived] Archived WIP of vielle.dev

Add star component

Changed files
+34
src
components
blog
+2
src/components/blog/Background.astro
··· 1 --- 2 import Cloud from "./background/Cloud.astro"; 3 import Moon from "./background/Moon.astro"; 4 import Sun from "./background/Sun.astro"; 5 --- 6 ··· 42 <Cloud /> 43 <Sun /> 44 <Moon /> 45 </div>
··· 1 --- 2 import Cloud from "./background/Cloud.astro"; 3 import Moon from "./background/Moon.astro"; 4 + import Star from "./background/Star.astro"; 5 import Sun from "./background/Sun.astro"; 6 --- 7 ··· 43 <Cloud /> 44 <Sun /> 45 <Moon /> 46 + <Star /> 47 </div>
+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
··· 12 clouds: 50, 13 sun: 10, 14 moon: 20, 15 }, 16 clouds: { 17 count: 8, 18 width: [40, 80], 19 height: [15, 30], 20 yGap: [15, 25], 21 }, 22 }, 23 };
··· 12 clouds: 50, 13 sun: 10, 14 moon: 20, 15 + star: 40, 16 }, 17 clouds: { 18 count: 8, 19 width: [40, 80], 20 height: [15, 30], 21 yGap: [15, 25], 22 + }, 23 + 24 + stars: { 25 + count: 40, 26 + size: [2, 5], 27 }, 28 }, 29 };