this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Reduce SVGs sent to client (sun not needed in night mode etc

+14 -25
+14 -25
src/components/blog/Background.astro
··· 8 8 Astro.cookies.get("timezone")?.value ?? 9 9 Astro.request.headers.get("Date") ?? 10 10 Astro.request.headers.get("date") ?? // idk if it cares about capitals so Both 11 - Date.now(), 11 + Date.now() 12 12 ); 13 13 14 14 const accurateHours = ··· 37 37 /* time styling */ 38 38 #background[data-time="day"] { 39 39 background-color: dodgerblue; 40 - 41 - #sun, 42 - #clouds { 43 - display: block; 44 - } 45 - 46 - #stars, 47 - #moon { 48 - display: none; 49 - } 50 40 } 51 41 52 42 #background[data-time="night"] { 53 43 background-color: black; 54 - 55 - #stars, 56 - #moon { 57 - display: block; 58 - } 59 - 60 - #sun, 61 - #clouds { 62 - display: none; 63 - } 64 44 } 65 45 </style> 66 46 ··· 78 58 </style> 79 59 80 60 <div id="background" data-time={daytime ? "day" : "night"}> 81 - <Clouds /> 82 - <Stars /> 83 - <Sun percent={(accurateHours - 6) / 12} /> 84 - <Moon /> 61 + { 62 + daytime ? ( 63 + <> 64 + <Sun percent={(accurateHours - 6) / 12} /> 65 + <Clouds /> 66 + </> 67 + ) : ( 68 + <> 69 + <Moon /> 70 + <Stars /> 71 + </> 72 + ) 73 + } 85 74 </div>