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 @@