feat: static city suggestions by country, fix city dropdown, coloring animation on save

This commit is contained in:
haerikimmm
2026-06-16 19:21:26 +09:00
parent a7079c1f18
commit c7cf053105
4 changed files with 227 additions and 6 deletions

View File

@@ -3,8 +3,8 @@ import { nameToId } from '../shared/countries.js';
let selected = $state(new Set());
let totalCountries = $state(0);
let flashing = $state(new Set());
// Derive visited countries from journal entries
journals.subscribe((entries) => {
const ids = new Set();
for (const e of entries) {
@@ -25,3 +25,16 @@ export function setTotalCount(n) {
export function getTotalCount() {
return totalCountries;
}
export function getFlashing() {
return flashing;
}
export function flashCountry(countryName) {
const id = nameToId[countryName];
if (!id) return;
flashing = new Set([...flashing, id]);
setTimeout(() => {
flashing = new Set([...flashing].filter(x => x !== id));
}, 1600);
}