Design language tweaks, improvements

This commit is contained in:
2026-05-13 20:44:01 +12:00
parent de8b60b9c3
commit baafafabdb
22 changed files with 1302 additions and 998 deletions
+6 -107
View File
@@ -1,4 +1,6 @@
<script lang="ts">
import ModalShell from '$lib/components/ModalShell.svelte';
export let email = 'info@goodwalk.co.nz';
export let enquiryType: 'booking' | 'general' = 'booking';
export let onClose: () => void;
@@ -11,29 +13,12 @@
`?subject=${encodeURIComponent(isGeneralEnquiry ? 'General enquiry' : 'Booking enquiry')}` +
`&body=${encodeURIComponent(
isGeneralEnquiry
? 'Hi Aless,\n\nI tried to submit the contact form but it didnt go through. Here are my details:\n\nName:\nPhone:\nMessage:\n\nThanks!'
: 'Hi Aless,\n\nI tried to submit the booking form but it didnt go through. Here are my details:\n\nName:\nPhone:\nDogs name:\nLocation:\n\nThanks!'
? "Hi Aless,\n\nI tried to submit the contact form but it didn't go through. Here are my details:\n\nName:\nPhone:\nMessage:\n\nThanks!"
: "Hi Aless,\n\nI tried to submit the booking form but it didn't go through. Here are my details:\n\nName:\nPhone:\nDog's name:\nLocation:\n\nThanks!"
)}`;
function handleKeydown(event: KeyboardEvent) {
if (event.key === 'Escape') onClose();
}
</script>
<div
class="modal-backdrop"
role="dialog"
aria-modal="true"
aria-labelledby="error-modal-heading"
on:click|self={onClose}
on:keydown={handleKeydown}
tabindex="-1"
>
<div class="modal-card">
<button class="modal-close" type="button" aria-label="Close" on:click={onClose}>
&#x2715;
</button>
<ModalShell {onClose} ariaLabelledBy="error-modal-heading">
<div class="modal-icon" aria-hidden="true">
<svg viewBox="0 0 24 24" width="28" height="28" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 9v4" />
@@ -69,61 +54,9 @@
</button>
{/if}
</div>
</div>
</div>
</ModalShell>
<style>
.modal-backdrop {
position: fixed;
inset: 0;
z-index: 1000;
display: flex;
align-items: center;
justify-content: center;
padding: 16px;
background: rgba(10, 20, 10, 0.55);
backdrop-filter: blur(6px);
-webkit-backdrop-filter: blur(6px);
animation: backdrop-in 0.25s ease;
}
.modal-card {
position: relative;
width: 100%;
max-width: 480px;
padding: 52px 48px 40px;
background: #fff;
border-radius: 24px;
box-shadow: 0 24px 80px rgba(10, 20, 10, 0.22);
text-align: center;
animation: card-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-close {
position: absolute;
top: 18px;
right: 20px;
width: 32px;
height: 32px;
border: none;
border-radius: 50%;
background: #f2f2f0;
color: #888;
font-size: 14px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition:
background 0.15s ease,
color 0.15s ease;
}
.modal-close:hover {
background: #e8e8e4;
color: #333;
}
.modal-icon {
width: 64px;
height: 64px;
@@ -246,41 +179,7 @@
border-color: var(--gw-green);
}
@keyframes backdrop-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes card-in {
from {
opacity: 0;
transform: scale(0.88) translateY(16px);
}
to {
opacity: 1;
transform: scale(1) translateY(0);
}
}
@keyframes bounce-in {
from {
opacity: 0;
transform: scale(0.4);
}
to {
opacity: 1;
transform: scale(1);
}
}
@media (max-width: 480px) {
.modal-card {
padding: 44px 28px 32px;
}
.modal-actions {
flex-direction: column;
}