[Archived] Archived WIP of vielle.dev
0
fork

Configure Feed

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

Get timezone from user

TODO: actually respect the timezone

+21 -9
+4 -2
src/Base.astro
··· 28 28 <meta name="generator" content={Astro.generator} /> 29 29 <link rel="sitemap" href="/sitemap-index.xml" /> 30 30 <title>{title} | vielle.dev</title> 31 - <!-- per page info --> 32 - <slot name="head" /> 31 + <script> 32 + // sets the timezone offset 33 + document.cookie = `timezone=${new Date().toString()}` 34 + </script> 33 35 <!-- default styles (rem, *) --> 34 36 <style is:global> 35 37 @layer reset {
+9 -1
src/components/blog/Background.astro
··· 4 4 import Moon from "./background/Moon.astro"; 5 5 import Sun from "./background/Sun.astro"; 6 6 7 - const date = new Date(Astro.request.headers.get("Date") ?? Date.now()); 7 + const date = new Date( 8 + Astro.cookies.get("timezone")?.value ?? 9 + Astro.request.headers.get("Date") ?? 10 + Astro.request.headers.get("date") ?? // idk if it cares about capitals so Both 11 + Date.now() 12 + ); 13 + 14 + console.log(date); 15 + 8 16 const accurateHours = 9 17 date.getHours() + date.getMinutes() / 60 + date.getSeconds() / 60 ** 2; 10 18 const daytime = accurateHours > 6 && accurateHours < 18;
+8 -6
src/components/blog/background/Stars.astro
··· 19 19 top: calc(var(--y) * (120lvh + var(--parallax-speed) * 1lvh) - 10lvh); 20 20 left: calc(var(--x) * 120lvw - 10lvw); 21 21 z-index: -1; 22 - animation-name: spin var(--rotate-speed) forwards infinite; 22 + @media (prefers-reduced-motion: no-preference) { 23 + animation-name: spin var(--rotate-speed) forwards infinite; 23 24 24 - &[data-parallax] { 25 - animation: 26 - 1ms alternate scroll, 27 - var(--rotate-dir) var(--rotate-speed) infinite linear spin !important; 28 - animation-timeline: scroll(), auto !important; 25 + &[data-parallax] { 26 + animation: 27 + 1ms alternate scroll, 28 + var(--rotate-dir) var(--rotate-speed) infinite linear spin !important; 29 + animation-timeline: scroll(), auto !important; 30 + } 29 31 } 30 32 } 31 33 </style>