add side stats panel

This commit is contained in:
2026-06-09 15:56:01 +09:00
parent 8976b94c41
commit 65e16f3502
10 changed files with 701 additions and 155 deletions

View File

@@ -0,0 +1,28 @@
let selected = $state(new Set());
let totalCountries = $state(0);
export function toggle(id) {
const next = new Set(selected);
if (next.has(id)) {
next.delete(id);
} else {
next.add(id);
}
selected = next;
}
export function clearAll() {
selected = new Set();
}
export function getSelected() {
return selected;
}
export function setTotalCount(n) {
totalCountries = n;
}
export function getTotalCount() {
return totalCountries;
}