feat: static city suggestions by country, fix city dropdown, coloring animation on save
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user