From cb0e5602c871829c46d0181a13b6737f9b924164 Mon Sep 17 00:00:00 2001 From: haerikimmm Date: Fri, 12 Jun 2026 15:34:43 +0900 Subject: [PATCH] added flag, changed the location of the country name --- .claude/launch.json | 12 + src/lib/timeline/TimelineCard.svelte | 323 +++++++++++++++++---------- src/lib/timeline/TimelineView.svelte | 10 +- 3 files changed, 223 insertions(+), 122 deletions(-) create mode 100644 .claude/launch.json diff --git a/.claude/launch.json b/.claude/launch.json new file mode 100644 index 0000000..f3c9817 --- /dev/null +++ b/.claude/launch.json @@ -0,0 +1,12 @@ +{ + "version": "0.0.1", + "configurations": [ + { + "name": "Map-Jurnal", + "runtimeExecutable": "npm", + "runtimeArgs": ["run", "dev"], + "port": 5173, + "autoPort": true + } + ] +} diff --git a/src/lib/timeline/TimelineCard.svelte b/src/lib/timeline/TimelineCard.svelte index 6ac1df9..ad4f8da 100644 --- a/src/lib/timeline/TimelineCard.svelte +++ b/src/lib/timeline/TimelineCard.svelte @@ -2,9 +2,30 @@ /** @type {{ entry: import('../stores/journalStore.js').JournalEntry, onClick: () => void }} */ let { entry, onClick } = $props(); + /** Convert country name to flag emoji via ISO 3166-1 alpha-2 */ + const countryCodeMap = { + 'Japan': 'JP', 'France': 'FR', 'Spain': 'ES', 'USA': 'US', + 'Thailand': 'TH', 'Germany': 'DE', 'Italy': 'IT', 'UK': 'GB', + 'Australia': 'AU', 'Canada': 'CA', 'China': 'CN', 'India': 'IN', + 'Brazil': 'BR', 'Mexico': 'MX', 'Portugal': 'PT', 'Netherlands': 'NL', + 'Greece': 'GR', 'Turkey': 'TR', 'Vietnam': 'VN', 'Indonesia': 'ID', + 'Malaysia': 'MY', 'Singapore': 'SG', 'South Korea': 'KR', 'Taiwan': 'TW', + 'New Zealand': 'NZ', 'Argentina': 'AR', 'Chile': 'CL', 'Peru': 'PE', + 'Morocco': 'MA', 'Egypt': 'EG', 'Kenya': 'KE', 'South Africa': 'ZA', + 'Sweden': 'SE', 'Norway': 'NO', 'Denmark': 'DK', 'Finland': 'FI', + 'Switzerland': 'CH', 'Austria': 'AT', 'Belgium': 'BE', 'Poland': 'PL', + 'Czech Republic': 'CZ', 'Hungary': 'HU', 'Croatia': 'HR', + }; + + function flagEmoji(country) { + const code = countryCodeMap[country]; + if (!code) return ''; + return [...code].map(c => String.fromCodePoint(0x1F1E6 - 65 + c.charCodeAt(0))).join(''); + } + function formatDate(/** @type {string} */ iso) { return new Date(iso).toLocaleDateString('en-US', { - year: 'numeric', month: 'short', day: 'numeric', + month: 'short', day: 'numeric', year: 'numeric', }); } @@ -16,55 +37,96 @@
  • -
    e.key === 'Enter' && onClick()}> +
    + +
    + {flagEmoji(entry.location.country)} + {entry.location.country} +
    -
    0}> -
    - {#if mainPhoto} - - {:else} -
    + +
    e.key === 'Enter' && onClick()}> + + + + {entry.tripType === 'solo' ? 'Solo' : 'Friends'} + + + +
    0}> +
    + {#if mainPhoto} + { + e.currentTarget.style.display = 'none'; + e.currentTarget.nextElementSibling.style.display = 'flex'; + }} /> + + {:else} +
    + + + + + +
    + {/if} +
    + + {#if thumbPhotos.length > 0} +
    + {#each thumbPhotos as photo, i} +
    + { + e.currentTarget.style.display = 'none'; + e.currentTarget.nextElementSibling.style.display = 'flex'; + }} /> + + {#if i === 2 && extraCount > 0} +
    +{extraCount}
    + {/if} +
    + {/each} +
    {/if} +
    -
    -
    - - {entry.tripType === 'solo' ? 'Solo' : 'Friends'} - -
    -
    - {entry.location.city} - {entry.location.country} - {formatDate(entry.date)} · {entry.days} {entry.days === 1 ? 'day' : 'days'} -
    + +
    + {entry.location.city} +
    + {formatDate(entry.date)} + · + {entry.days} {entry.days === 1 ? 'day' : 'days'}
    - {#if thumbPhotos.length > 0} -
    - {#each thumbPhotos as photo, i} -
    - - {#if i === 2 && extraCount > 0} -
    +{extraCount}
    - {/if} -
    - {/each} -
    - {/if}
    -
  • diff --git a/src/lib/timeline/TimelineView.svelte b/src/lib/timeline/TimelineView.svelte index 69daa47..a75b903 100644 --- a/src/lib/timeline/TimelineView.svelte +++ b/src/lib/timeline/TimelineView.svelte @@ -140,14 +140,16 @@ /* Year marker */ .year-marker { - padding: 32px 0 16px; + padding: 32px 0 14px; } .year-label { - font-size: 11px; + font-size: 13px; font-weight: 400; - letter-spacing: 0.12em; + letter-spacing: 0.1em; text-transform: uppercase; - color: var(--text-sub); + color: var(--text); + border-left: 2px solid var(--accent); + padding-left: 10px; } .page-footer {