Added weather api preparations and entrypoint for dockerfile
This commit is contained in:
+12
-3
@@ -5,7 +5,12 @@ window.htmx = htmx;
|
||||
|
||||
document.addEventListener('click', (event) => {
|
||||
const button = event.target.closest('[data-weather-location]');
|
||||
if (!button || !navigator.geolocation) return;
|
||||
if (!button) return;
|
||||
const status = document.querySelector('[data-weather-location-status]');
|
||||
if (!navigator.geolocation) {
|
||||
if (status) status.textContent = 'Your browser does not support location services.';
|
||||
return;
|
||||
}
|
||||
|
||||
navigator.geolocation.getCurrentPosition(async ({coords}) => {
|
||||
const payload = new URLSearchParams({
|
||||
@@ -18,8 +23,12 @@ document.addEventListener('click', (event) => {
|
||||
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
|
||||
body: payload,
|
||||
});
|
||||
if (response.ok) {
|
||||
window.location.reload();
|
||||
if (!response.ok) {
|
||||
if (status) status.textContent = 'Location could not be saved.';
|
||||
return;
|
||||
}
|
||||
window.location.reload();
|
||||
}, () => {
|
||||
if (status) status.textContent = 'Location permission was not granted.';
|
||||
});
|
||||
});
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.6 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
+19
-1
@@ -15,7 +15,20 @@ body {
|
||||
--container-max: 1280px;
|
||||
--container-gutter: clamp(1rem, 3vw, 2rem);
|
||||
}
|
||||
header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
.logo {
|
||||
height: 60px;
|
||||
width: auto;
|
||||
}
|
||||
.mascots {
|
||||
height: 150px;
|
||||
width: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
.container {
|
||||
width: min(100% - (2 * var(--container-gutter)), var(--container-max));
|
||||
margin-inline: auto;
|
||||
@@ -158,12 +171,17 @@ body {
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
.weather-forecast {
|
||||
font-size: 2em;
|
||||
margin-bottom: 50px;
|
||||
color: #fff;
|
||||
}
|
||||
.task-composer {
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
margin-bottom: 50px;
|
||||
flex-direction: column;
|
||||
|
||||
form.task-composer__form {
|
||||
width: 100%;
|
||||
max-width: unset;
|
||||
|
||||
Reference in New Issue
Block a user