Api do wyszukiwania dostepności, korekty w powiązanych stronach
This commit is contained in:
@@ -17,10 +17,10 @@ const links = [
|
||||
|
||||
<!-- Logo -->
|
||||
<a href="/" class="flex items-center gap-2 font-semibold">
|
||||
<span class="inline-flex h-8 w-8 items-center justify-center rounded-full text-sm font-bold">
|
||||
<img src="/assets/logo.webp" alt="FUZ Logo" class="h-5 w-5" />
|
||||
<!-- <span class="inline-flex h-8 w-8 items-center justify-center rounded-full text-sm font-bold"> -->
|
||||
<img src="/src/assets/logo.webp" alt="FUZ Logo" class="my-0"/>
|
||||
</span>
|
||||
<span>FUZ</span>
|
||||
<!-- <span>FUZ</span> -->
|
||||
</a>
|
||||
|
||||
<!-- Linki desktop -->
|
||||
|
||||
@@ -11,7 +11,6 @@ const apiKey = import.meta.env.PUBLIC_GOOGLE_MAPS_KEY;
|
||||
const form = data.form;
|
||||
---
|
||||
|
||||
<!-- TODO: Obrobić wysyłanie maila przez api -->
|
||||
<section id="contact" class="fuz-section">
|
||||
<div class="fuz-contact-grid">
|
||||
<!-- Lewa kolumna -->
|
||||
@@ -85,7 +84,10 @@ const form = data.form;
|
||||
/>
|
||||
<span>
|
||||
{form.rodo.label}
|
||||
<a href={form.rodo.policyLink} title={form.rodo.policyTitle}>{form.rodo.policyText}</a
|
||||
<a
|
||||
href={form.rodo.policyLink}
|
||||
title={form.rodo.policyTitle}
|
||||
>{form.rodo.policyText}</a
|
||||
>.
|
||||
</span>
|
||||
</label>
|
||||
@@ -110,10 +112,11 @@ const form = data.form;
|
||||
description={data.markerAddress}
|
||||
showMarker={true}
|
||||
mode="contact"
|
||||
mapStyleId={data.maps.mapId} />
|
||||
mapStyleId={data.maps.mapId}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div id="toast" class="fuz-toast hidden"></div>
|
||||
<div id="toast" class="fuz-toast"></div>
|
||||
</section>
|
||||
|
||||
<!-- ReCaptcha init -->
|
||||
@@ -130,7 +133,13 @@ const form = data.form;
|
||||
</script>
|
||||
|
||||
<!-- Formularz + toast -->
|
||||
<script is:inline>
|
||||
<script
|
||||
is:inline
|
||||
define:vars={{
|
||||
successMsg: JSON.stringify(form.submit.successMessage),
|
||||
errorMsg: JSON.stringify(form.submit.errorMessage),
|
||||
}}
|
||||
>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const form = document.getElementById("contactForm");
|
||||
const toast = document.getElementById("toast");
|
||||
@@ -160,7 +169,7 @@ const form = data.form;
|
||||
|
||||
const json = await resp.json();
|
||||
showToast(
|
||||
json.ok ? "Wiadomość wysłana!" : "Błąd podczas wysyłania.",
|
||||
json.ok ? JSON.parse(successMsg) : JSON.parse(errorMsg),
|
||||
json.ok ? "success" : "error",
|
||||
);
|
||||
|
||||
@@ -169,13 +178,21 @@ const form = data.form;
|
||||
|
||||
function showToast(message, type = "success") {
|
||||
toast.innerHTML = `
|
||||
<div class="fuz-toast-msg ${type}">
|
||||
${message}
|
||||
</div>
|
||||
`;
|
||||
<div class="fuz-toast-msg ${type}">
|
||||
${message}
|
||||
</div>
|
||||
`;
|
||||
// reset animacji
|
||||
toast.classList.remove("visible");
|
||||
void toast.offsetWidth; // magiczny hack forcing reflow
|
||||
|
||||
toast.classList.remove("hidden");
|
||||
setTimeout(() => toast.classList.add("hidden"), 3000);
|
||||
// pokaż
|
||||
toast.classList.add("visible");
|
||||
|
||||
// ukryj po 3s
|
||||
setTimeout(() => {
|
||||
toast.classList.remove("visible");
|
||||
}, 3000);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user