final cleanup
This commit is contained in:
@@ -11,15 +11,24 @@
|
||||
*/
|
||||
let { entry = null, initialCountry = '', onBack } = $props();
|
||||
|
||||
// svelte-ignore state_referenced_locally
|
||||
let isNew = !entry;
|
||||
|
||||
// svelte-ignore state_referenced_locally
|
||||
let cities = $state([...(entry?.location.cities ?? [])]);
|
||||
// svelte-ignore state_referenced_locally
|
||||
let country = $state(entry?.location.country ?? initialCountry);
|
||||
// svelte-ignore state_referenced_locally
|
||||
let date = $state(entry?.date ?? new Date().toISOString().slice(0, 10));
|
||||
// svelte-ignore state_referenced_locally
|
||||
let days = $state(String(entry?.days ?? ''));
|
||||
// svelte-ignore state_referenced_locally
|
||||
let tripType = $state(entry?.tripType ?? '');
|
||||
// svelte-ignore state_referenced_locally
|
||||
let photos = $state([...(entry?.photos ?? [])]);
|
||||
// svelte-ignore state_referenced_locally
|
||||
let memo = $state(entry?.memo ?? '');
|
||||
// svelte-ignore state_referenced_locally
|
||||
let transport = $state(entry?.transport ?? '');
|
||||
|
||||
let step = $state(1);
|
||||
|
||||
@@ -84,9 +84,10 @@
|
||||
<div class="photo-grid">
|
||||
{#each entry.photos as photo, i}
|
||||
<div class="photo-cell" class:cell-wide={i === 0 && entry.photos.length > 1}>
|
||||
<img src={photo} alt=""
|
||||
onclick={() => lightboxSrc = photo}
|
||||
onerror={(e) => e.currentTarget.parentElement.classList.add('cell-broken')} />
|
||||
<button type="button" class="photo-btn" onclick={() => lightboxSrc = photo}>
|
||||
<img src={photo} alt=""
|
||||
onerror={(e) => { e.currentTarget.closest('.photo-cell')?.classList.add('cell-broken'); }} />
|
||||
</button>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -254,21 +255,24 @@
|
||||
grid-column: 1 / -1;
|
||||
grid-row: span 2;
|
||||
}
|
||||
.photo-cell img {
|
||||
.photo-btn {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: zoom-in;
|
||||
}
|
||||
.photo-btn img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
.photo-cell:hover img { transform: scale(1.03); }
|
||||
.photo-cell.cell-broken {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--text-sub);
|
||||
font-size: 12px;
|
||||
}
|
||||
.photo-cell:hover .photo-btn img { transform: scale(1.03); }
|
||||
|
||||
|
||||
.no-photos {
|
||||
display: flex;
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label"><span class="kw">Who</span> did you go <span class="kw">with</span>? <span class="req">*</span></label>
|
||||
<span class="label"><span class="kw">Who</span> did you go <span class="kw">with</span>? <span class="req">*</span></span>
|
||||
<div class="toggle-row">
|
||||
{#each ['solo','friends','family'] as t}
|
||||
<label class="toggle-opt" class:active={tripType === t}>
|
||||
@@ -217,7 +217,7 @@
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">How did you <span class="kw">get</span> there? <span class="req">*</span></label>
|
||||
<span class="label">How did you <span class="kw">get</span> there? <span class="req">*</span></span>
|
||||
<div class="transport-grid">
|
||||
{#each transportOptions as opt}
|
||||
<label class="toggle-opt" class:active={transport === opt.value}>
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
</div>
|
||||
{/each}
|
||||
|
||||
<button type="button" class="add-cell" onclick={() => fileInput.click()} disabled={uploading}>
|
||||
<button type="button" class="add-cell" onclick={() => fileInput.click()} disabled={uploading} aria-label="Add photo">
|
||||
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
|
||||
<path d="M12 5v14M5 12h14"/>
|
||||
</svg>
|
||||
@@ -101,23 +101,6 @@
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
font-family: var(--sans);
|
||||
font-size: 12px;
|
||||
font-weight: 300;
|
||||
color: var(--accent);
|
||||
background: var(--accent-bg);
|
||||
border: 1px solid var(--accent-border);
|
||||
border-radius: 6px;
|
||||
padding: 4px 10px;
|
||||
cursor: pointer;
|
||||
transition: background 0.15s;
|
||||
}
|
||||
.add-btn:hover { background: rgba(124,58,237,0.12); }
|
||||
|
||||
.empty-zone {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label"><span class="kw">Who</span> did you go <span class="kw">with</span>? <span class="req">*</span></label>
|
||||
<span class="label"><span class="kw">Who</span> did you go <span class="kw">with</span>? <span class="req">*</span></span>
|
||||
<div class="toggle-row">
|
||||
{#each ['solo','friends','family'] as t}
|
||||
<label class="toggle-opt" class:active={tripType === t}>
|
||||
@@ -103,7 +103,7 @@
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">How did you <span class="kw">get</span> there? <span class="req">*</span></label>
|
||||
<span class="label">How did you <span class="kw">get</span> there? <span class="req">*</span></span>
|
||||
<div class="transport-grid">
|
||||
{#each transportOptions as opt}
|
||||
<label class="toggle-opt transport-opt" class:active={transport === opt.value}>
|
||||
|
||||
Reference in New Issue
Block a user