added basic weather gen

This commit is contained in:
2025-07-02 00:28:47 +03:00
parent f9e57bb6e2
commit 4c9667af77
6 changed files with 263 additions and 32 deletions

View File

@@ -8,6 +8,14 @@
let position: GeolocationPosition | undefined = $state(undefined);
let error: GeolocationError | undefined = $state(undefined);
let options = {
enableHighAccuracy: true,
timeout: 5000, // milliseconds
maximumAge: 60 * 60 * 1000, // milliseconds
};
$inspect(error);
function flipGetPosition(): void {
getPosition = true;
}
@@ -36,4 +44,4 @@
{/if}
</div>
<Geolocation {getPosition} bind:position bind:loading bind:error />
<Geolocation {options} {getPosition} bind:position bind:loading bind:error />

View File

@@ -5,6 +5,12 @@
const { data }: PageProps = $props();
const currentWeather = data.current;
$inspect(currentWeather)
</script>
<WeatherGen {currentWeather}></WeatherGen>
<div class="flex min-h-screen flex-col items-center justify-center">
<WeatherGen {...currentWeather}></WeatherGen>
</div>