Compare commits
3 Commits
b40e5886b5
...
326b52b858
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
326b52b858 | ||
|
|
0848418453 | ||
|
|
6b13522d6d |
496
package-lock.json
generated
496
package-lock.json
generated
@@ -7,6 +7,12 @@
|
|||||||
"": {
|
"": {
|
||||||
"name": "map-journal",
|
"name": "map-journal",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
|
"dependencies": {
|
||||||
|
"d3": "^7.9.0",
|
||||||
|
"flag-icons": "^7.5.0",
|
||||||
|
"topojson-client": "^3.1.0",
|
||||||
|
"world-atlas": "^2.0.2"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
||||||
"svelte": "^5.55.5",
|
"svelte": "^5.55.5",
|
||||||
@@ -488,6 +494,416 @@
|
|||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/commander": {
|
||||||
|
"version": "7.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz",
|
||||||
|
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3": {
|
||||||
|
"version": "7.9.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3/-/d3-7.9.0.tgz",
|
||||||
|
"integrity": "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-array": "3",
|
||||||
|
"d3-axis": "3",
|
||||||
|
"d3-brush": "3",
|
||||||
|
"d3-chord": "3",
|
||||||
|
"d3-color": "3",
|
||||||
|
"d3-contour": "4",
|
||||||
|
"d3-delaunay": "6",
|
||||||
|
"d3-dispatch": "3",
|
||||||
|
"d3-drag": "3",
|
||||||
|
"d3-dsv": "3",
|
||||||
|
"d3-ease": "3",
|
||||||
|
"d3-fetch": "3",
|
||||||
|
"d3-force": "3",
|
||||||
|
"d3-format": "3",
|
||||||
|
"d3-geo": "3",
|
||||||
|
"d3-hierarchy": "3",
|
||||||
|
"d3-interpolate": "3",
|
||||||
|
"d3-path": "3",
|
||||||
|
"d3-polygon": "3",
|
||||||
|
"d3-quadtree": "3",
|
||||||
|
"d3-random": "3",
|
||||||
|
"d3-scale": "4",
|
||||||
|
"d3-scale-chromatic": "3",
|
||||||
|
"d3-selection": "3",
|
||||||
|
"d3-shape": "3",
|
||||||
|
"d3-time": "3",
|
||||||
|
"d3-time-format": "4",
|
||||||
|
"d3-timer": "3",
|
||||||
|
"d3-transition": "3",
|
||||||
|
"d3-zoom": "3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-array": {
|
||||||
|
"version": "3.2.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz",
|
||||||
|
"integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"internmap": "1 - 2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-axis": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-axis/-/d3-axis-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-brush": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-brush/-/d3-brush-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-dispatch": "1 - 3",
|
||||||
|
"d3-drag": "2 - 3",
|
||||||
|
"d3-interpolate": "1 - 3",
|
||||||
|
"d3-selection": "3",
|
||||||
|
"d3-transition": "3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-chord": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-chord/-/d3-chord-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-path": "1 - 3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-color": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-contour": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-contour/-/d3-contour-4.0.2.tgz",
|
||||||
|
"integrity": "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-array": "^3.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-delaunay": {
|
||||||
|
"version": "6.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-delaunay/-/d3-delaunay-6.0.4.tgz",
|
||||||
|
"integrity": "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"delaunator": "5"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-dispatch": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-drag": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-dispatch": "1 - 3",
|
||||||
|
"d3-selection": "3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-dsv": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-dsv/-/d3-dsv-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"commander": "7",
|
||||||
|
"iconv-lite": "0.6",
|
||||||
|
"rw": "1"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"csv2json": "bin/dsv2json.js",
|
||||||
|
"csv2tsv": "bin/dsv2dsv.js",
|
||||||
|
"dsv2dsv": "bin/dsv2dsv.js",
|
||||||
|
"dsv2json": "bin/dsv2json.js",
|
||||||
|
"json2csv": "bin/json2dsv.js",
|
||||||
|
"json2dsv": "bin/json2dsv.js",
|
||||||
|
"json2tsv": "bin/json2dsv.js",
|
||||||
|
"tsv2csv": "bin/dsv2dsv.js",
|
||||||
|
"tsv2json": "bin/dsv2json.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-ease": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==",
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-fetch": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-fetch/-/d3-fetch-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-dsv": "1 - 3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-force": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-force/-/d3-force-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-dispatch": "1 - 3",
|
||||||
|
"d3-quadtree": "1 - 3",
|
||||||
|
"d3-timer": "1 - 3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-format": {
|
||||||
|
"version": "3.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz",
|
||||||
|
"integrity": "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-geo": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-array": "2.5.0 - 3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-hierarchy": {
|
||||||
|
"version": "3.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz",
|
||||||
|
"integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-interpolate": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-color": "1 - 3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-path": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-polygon": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-polygon/-/d3-polygon-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-quadtree": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-random": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-random/-/d3-random-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-scale": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz",
|
||||||
|
"integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-array": "2.10.0 - 3",
|
||||||
|
"d3-format": "1 - 3",
|
||||||
|
"d3-interpolate": "1.2.0 - 3",
|
||||||
|
"d3-time": "2.1.1 - 3",
|
||||||
|
"d3-time-format": "2 - 4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-scale-chromatic": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-scale-chromatic/-/d3-scale-chromatic-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-color": "1 - 3",
|
||||||
|
"d3-interpolate": "1 - 3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-selection": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-shape": {
|
||||||
|
"version": "3.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz",
|
||||||
|
"integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-path": "^3.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-time": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-array": "2 - 3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-time-format": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-time": "1 - 3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-timer": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-transition": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-color": "1 - 3",
|
||||||
|
"d3-dispatch": "1 - 3",
|
||||||
|
"d3-ease": "1 - 3",
|
||||||
|
"d3-interpolate": "1 - 3",
|
||||||
|
"d3-timer": "1 - 3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"d3-selection": "2 - 3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/d3-zoom": {
|
||||||
|
"version": "3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz",
|
||||||
|
"integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"d3-dispatch": "1 - 3",
|
||||||
|
"d3-drag": "2 - 3",
|
||||||
|
"d3-interpolate": "1 - 3",
|
||||||
|
"d3-selection": "2 - 3",
|
||||||
|
"d3-transition": "2 - 3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/deepmerge": {
|
"node_modules/deepmerge": {
|
||||||
"version": "4.3.1",
|
"version": "4.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
|
||||||
@@ -498,6 +914,15 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/delaunator": {
|
||||||
|
"version": "5.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/delaunator/-/delaunator-5.1.0.tgz",
|
||||||
|
"integrity": "sha512-AGrQ4QSgssa1NGmWmLPqN5NY2KajF5MqxetNEO+o0n3ZwZZeTmt7bBnvzHWrmkZFxGgr4HdyFgelzgi06otLuQ==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"robust-predicates": "^3.0.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/detect-libc": {
|
"node_modules/detect-libc": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
|
||||||
@@ -558,6 +983,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/flag-icons": {
|
||||||
|
"version": "7.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/flag-icons/-/flag-icons-7.5.0.tgz",
|
||||||
|
"integrity": "sha512-kd+MNXviFIg5hijH766tt+3x76ele1AXlo4zDdCxIvqWZhKt4T83bOtxUOOMlTx/EcFdUMH5yvQgYlFh1EqqFg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/fsevents": {
|
"node_modules/fsevents": {
|
||||||
"version": "2.3.3",
|
"version": "2.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||||
@@ -573,6 +1004,27 @@
|
|||||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/iconv-lite": {
|
||||||
|
"version": "0.6.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||||
|
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/internmap": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==",
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-reference": {
|
"node_modules/is-reference": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz",
|
||||||
@@ -940,6 +1392,12 @@
|
|||||||
"node": "^10 || ^12 || >=14"
|
"node": "^10 || ^12 || >=14"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/robust-predicates": {
|
||||||
|
"version": "3.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.3.tgz",
|
||||||
|
"integrity": "sha512-NS3levdsRIUOmiJ8FZWCP7LG3QpJyrs/TE0Zpf1yvZu8cAJJ6QMW92H1c7kWpdIHo8RvmLxN/o2JXTKHp74lUA==",
|
||||||
|
"license": "Unlicense"
|
||||||
|
},
|
||||||
"node_modules/rolldown": {
|
"node_modules/rolldown": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.3.tgz",
|
||||||
@@ -974,6 +1432,18 @@
|
|||||||
"@rolldown/binding-win32-x64-msvc": "1.0.3"
|
"@rolldown/binding-win32-x64-msvc": "1.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/rw": {
|
||||||
|
"version": "1.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz",
|
||||||
|
"integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==",
|
||||||
|
"license": "BSD-3-Clause"
|
||||||
|
},
|
||||||
|
"node_modules/safer-buffer": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/source-map-js": {
|
"node_modules/source-map-js": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
|
||||||
@@ -1029,6 +1499,26 @@
|
|||||||
"url": "https://github.com/sponsors/SuperchupuDev"
|
"url": "https://github.com/sponsors/SuperchupuDev"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/topojson-client": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/topojson-client/-/topojson-client-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-605uxS6bcYxGXw9qi62XyrV6Q3xwbndjachmNxu8HWTtVPxZfEJN9fd/SZS1Q54Sn2y0TMyMxFj/cJINqGHrKw==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"commander": "2"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"topo2geo": "bin/topo2geo",
|
||||||
|
"topomerge": "bin/topomerge",
|
||||||
|
"topoquantize": "bin/topoquantize"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/topojson-client/node_modules/commander": {
|
||||||
|
"version": "2.20.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
|
||||||
|
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/tslib": {
|
"node_modules/tslib": {
|
||||||
"version": "2.8.1",
|
"version": "2.8.1",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
||||||
@@ -1135,6 +1625,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/world-atlas": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/world-atlas/-/world-atlas-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-IXfV0qwlKXpckz1FhwXVwKRjiIhOnWttOskm5CtxMsjgE/MXAYRHWJqgXOpM8IkcPBoXnyTU5lFHcYa5ChG0LQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/zimmerframe": {
|
"node_modules/zimmerframe": {
|
||||||
"version": "1.1.4",
|
"version": "1.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz",
|
||||||
|
|||||||
@@ -12,5 +12,11 @@
|
|||||||
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
||||||
"svelte": "^5.55.5",
|
"svelte": "^5.55.5",
|
||||||
"vite": "^8.0.12"
|
"vite": "^8.0.12"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"d3": "^7.9.0",
|
||||||
|
"flag-icons": "^7.5.0",
|
||||||
|
"topojson-client": "^3.1.0",
|
||||||
|
"world-atlas": "^2.0.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,36 @@
|
|||||||
<script>
|
<script>
|
||||||
import TimelineView from './lib/TimelineView.svelte';
|
import Layout from './lib/layout/Layout.svelte';
|
||||||
|
import WorldMap from './lib/world-map/WorldMap.svelte';
|
||||||
|
import StatsPanel from './lib/world-map/StatsPanel.svelte';
|
||||||
|
import TimelineView from './lib/timeline/TimelineView.svelte';
|
||||||
|
|
||||||
|
let screen = $state('worldmap');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main>
|
<Layout {screen} onNavigate={(s) => (screen = s)}>
|
||||||
|
{#if screen === 'worldmap'}
|
||||||
|
<div class="worldmap-page">
|
||||||
|
<div class="map-area">
|
||||||
|
<WorldMap />
|
||||||
|
</div>
|
||||||
|
<StatsPanel />
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
<TimelineView />
|
<TimelineView />
|
||||||
</main>
|
{/if}
|
||||||
|
</Layout>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
main {
|
.worldmap-page {
|
||||||
min-height: 100svh;
|
flex: 1;
|
||||||
background: var(--bg);
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
min-width: 0;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map-area {
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
349
src/app.css
349
src/app.css
@@ -1,296 +1,95 @@
|
|||||||
:root {
|
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200;12..96,300;12..96,400&display=swap');
|
||||||
--text: #6b6375;
|
|
||||||
--text-h: #08060d;
|
|
||||||
--bg: #fff;
|
|
||||||
--border: #e5e4e7;
|
|
||||||
--code-bg: #f4f3ec;
|
|
||||||
--accent: #aa3bff;
|
|
||||||
--accent-bg: rgba(170, 59, 255, 0.1);
|
|
||||||
--accent-border: rgba(170, 59, 255, 0.5);
|
|
||||||
--social-bg: rgba(244, 243, 236, 0.5);
|
|
||||||
--shadow:
|
|
||||||
rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
|
|
||||||
|
|
||||||
--sans: system-ui, 'Segoe UI', Roboto, sans-serif;
|
/* ── Color tokens ─────────────────────────────────────────── */
|
||||||
--heading: system-ui, 'Segoe UI', Roboto, sans-serif;
|
:root {
|
||||||
|
--accent: #7c3aed; /* indigo-600 */
|
||||||
|
--accent-dark: #5b21b6;
|
||||||
|
--accent-light: #a78bfa;
|
||||||
|
--accent-bg: rgba(124, 58, 237, 0.07);
|
||||||
|
--accent-border: rgba(124, 58, 237, 0.2);
|
||||||
|
|
||||||
|
--lavender: #a78bfa;
|
||||||
|
--lavender-bg: rgba(167, 139, 250, 0.1);
|
||||||
|
|
||||||
|
/* Light-first neutrals */
|
||||||
|
--text: #52525b; /* zinc-600 */
|
||||||
|
--text-h: #18181b; /* zinc-900 */
|
||||||
|
--text-sub: #a1a1aa; /* zinc-400 */
|
||||||
|
--bg: #ffffff; /* white */
|
||||||
|
--bg-raised: #fafafa; /* off-white */
|
||||||
|
--bg-subtle: #f4f4f5; /* zinc-100 */
|
||||||
|
--border: #e4e4e7; /* zinc-200 */
|
||||||
|
--border-bright: #d4d4d8; /* zinc-300 */
|
||||||
|
--shadow: 0 4px 24px rgba(0,0,0,0.08);
|
||||||
|
|
||||||
|
/* Typography */
|
||||||
|
--sans: 'Bricolage Grotesque', system-ui, sans-serif;
|
||||||
|
--heading: 'Bricolage Grotesque', system-ui, sans-serif;
|
||||||
--mono: ui-monospace, Consolas, monospace;
|
--mono: ui-monospace, Consolas, monospace;
|
||||||
|
|
||||||
font: 18px/145% var(--sans);
|
/* Type scale */
|
||||||
letter-spacing: 0.18px;
|
--text-xs: 11px;
|
||||||
color-scheme: light dark;
|
--text-sm: 13px;
|
||||||
|
--text-base: 14px;
|
||||||
|
--text-md: 16px;
|
||||||
|
--text-lg: 20px;
|
||||||
|
--text-xl: 28px;
|
||||||
|
--text-2xl: 40px;
|
||||||
|
|
||||||
|
font-family: var(--sans);
|
||||||
|
font-size: var(--text-base);
|
||||||
|
line-height: 1.6;
|
||||||
|
font-weight: 300;
|
||||||
|
letter-spacing: 0.01em;
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
background: var(--bg);
|
background: var(--bg);
|
||||||
font-synthesis: none;
|
font-synthesis: none;
|
||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
|
||||||
@media (max-width: 1024px) {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
/* ── Reset ────────────────────────────────────────────────── */
|
||||||
:root {
|
*, *::before, *::after {
|
||||||
--text: #9ca3af;
|
|
||||||
--text-h: #f3f4f6;
|
|
||||||
--bg: #16171d;
|
|
||||||
--border: #2e303a;
|
|
||||||
--code-bg: #1f2028;
|
|
||||||
--accent: #c084fc;
|
|
||||||
--accent-bg: rgba(192, 132, 252, 0.15);
|
|
||||||
--accent-border: rgba(192, 132, 252, 0.5);
|
|
||||||
--social-bg: rgba(47, 48, 58, 0.5);
|
|
||||||
--shadow:
|
|
||||||
rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#social .button-icon {
|
|
||||||
filter: invert(1) brightness(2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1,
|
|
||||||
h2 {
|
|
||||||
font-family: var(--heading);
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--text-h);
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 56px;
|
|
||||||
letter-spacing: -1.68px;
|
|
||||||
margin: 32px 0;
|
|
||||||
@media (max-width: 1024px) {
|
|
||||||
font-size: 36px;
|
|
||||||
margin: 20px 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
h2 {
|
|
||||||
font-size: 24px;
|
|
||||||
line-height: 118%;
|
|
||||||
letter-spacing: -0.24px;
|
|
||||||
margin: 0 0 8px;
|
|
||||||
@media (max-width: 1024px) {
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
p {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
code,
|
|
||||||
.counter {
|
|
||||||
font-family: var(--mono);
|
|
||||||
display: inline-flex;
|
|
||||||
border-radius: 4px;
|
|
||||||
color: var(--text-h);
|
|
||||||
}
|
|
||||||
|
|
||||||
code {
|
|
||||||
font-size: 15px;
|
|
||||||
line-height: 135%;
|
|
||||||
padding: 4px 8px;
|
|
||||||
background: var(--code-bg);
|
|
||||||
}
|
|
||||||
|
|
||||||
.counter {
|
|
||||||
font-size: 16px;
|
|
||||||
padding: 5px 10px;
|
|
||||||
border-radius: 5px;
|
|
||||||
color: var(--accent);
|
|
||||||
background: var(--accent-bg);
|
|
||||||
border: 2px solid transparent;
|
|
||||||
transition: border-color 0.3s;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
border-color: var(--accent-border);
|
|
||||||
}
|
|
||||||
&:focus-visible {
|
|
||||||
outline: 2px solid var(--accent);
|
|
||||||
outline-offset: 2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.hero {
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.base,
|
|
||||||
.framework,
|
|
||||||
.vite {
|
|
||||||
inset-inline: 0;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.base {
|
|
||||||
width: 170px;
|
|
||||||
position: relative;
|
|
||||||
z-index: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.framework,
|
|
||||||
.vite {
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
.framework {
|
|
||||||
z-index: 1;
|
|
||||||
top: 34px;
|
|
||||||
height: 28px;
|
|
||||||
transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg)
|
|
||||||
scale(1.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.vite {
|
|
||||||
z-index: 0;
|
|
||||||
top: 107px;
|
|
||||||
height: 26px;
|
|
||||||
width: auto;
|
|
||||||
transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg)
|
|
||||||
scale(0.8);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#app {
|
|
||||||
width: 1126px;
|
|
||||||
max-width: 100%;
|
|
||||||
margin: 0 auto;
|
|
||||||
text-align: center;
|
|
||||||
border-inline: 1px solid var(--border);
|
|
||||||
min-height: 100svh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
margin: 0;
|
||||||
|
|
||||||
#center {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 25px;
|
|
||||||
place-content: center;
|
|
||||||
place-items: center;
|
|
||||||
flex-grow: 1;
|
|
||||||
|
|
||||||
@media (max-width: 1024px) {
|
|
||||||
padding: 32px 20px 24px;
|
|
||||||
gap: 18px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#next-steps {
|
|
||||||
display: flex;
|
|
||||||
border-top: 1px solid var(--border);
|
|
||||||
text-align: left;
|
|
||||||
|
|
||||||
& > div {
|
|
||||||
flex: 1 1 0;
|
|
||||||
padding: 32px;
|
|
||||||
@media (max-width: 1024px) {
|
|
||||||
padding: 24px 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
margin-bottom: 16px;
|
|
||||||
width: 22px;
|
|
||||||
height: 22px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 1024px) {
|
|
||||||
flex-direction: column;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#docs {
|
|
||||||
border-right: 1px solid var(--border);
|
|
||||||
|
|
||||||
@media (max-width: 1024px) {
|
|
||||||
border-right: none;
|
|
||||||
border-bottom: 1px solid var(--border);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#next-steps ul {
|
|
||||||
list-style: none;
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
display: flex;
|
}
|
||||||
gap: 8px;
|
|
||||||
margin: 32px 0 0;
|
|
||||||
|
|
||||||
.logo {
|
html, body, #app {
|
||||||
height: 18px;
|
width: 100%;
|
||||||
}
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
a {
|
/* ── Text hierarchy ───────────────────────────────────────── */
|
||||||
|
h1 {
|
||||||
|
font-size: var(--text-2xl);
|
||||||
|
font-weight: 400;
|
||||||
|
line-height: 1.1;
|
||||||
|
letter-spacing: -1px;
|
||||||
color: var(--text-h);
|
color: var(--text-h);
|
||||||
font-size: 16px;
|
|
||||||
border-radius: 6px;
|
|
||||||
background: var(--social-bg);
|
|
||||||
display: flex;
|
|
||||||
padding: 6px 12px;
|
|
||||||
align-items: center;
|
|
||||||
gap: 8px;
|
|
||||||
text-decoration: none;
|
|
||||||
transition: box-shadow 0.3s;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
box-shadow: var(--shadow);
|
|
||||||
}
|
|
||||||
.button-icon {
|
|
||||||
height: 18px;
|
|
||||||
width: 18px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 1024px) {
|
|
||||||
margin-top: 20px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
li {
|
|
||||||
flex: 1 1 calc(50% - 8px);
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
width: 100%;
|
|
||||||
justify-content: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#spacer {
|
h2 {
|
||||||
height: 88px;
|
font-size: var(--text-xl);
|
||||||
border-top: 1px solid var(--border);
|
font-weight: 400;
|
||||||
@media (max-width: 1024px) {
|
line-height: 1.15;
|
||||||
height: 48px;
|
letter-spacing: -0.5px;
|
||||||
}
|
color: var(--text-h);
|
||||||
}
|
}
|
||||||
|
|
||||||
.ticks {
|
h3 {
|
||||||
position: relative;
|
font-size: var(--text-lg);
|
||||||
width: 100%;
|
font-weight: 300;
|
||||||
|
line-height: 1.3;
|
||||||
&::before,
|
color: var(--text-h);
|
||||||
&::after {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
top: -4.5px;
|
|
||||||
border: 5px solid transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
left: 0;
|
|
||||||
border-left-color: var(--border);
|
|
||||||
}
|
|
||||||
&::after {
|
|
||||||
right: 0;
|
|
||||||
border-right-color: var(--border);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h4, h5, h6 {
|
||||||
|
font-size: var(--text-md);
|
||||||
|
font-weight: 300;
|
||||||
|
color: var(--text-h);
|
||||||
|
}
|
||||||
|
|
||||||
|
p { margin: 0; color: var(--text); }
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
<script>
|
|
||||||
let count = $state(0)
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<button type="button" class="counter" onclick={() => count++}>Count is {count}</button>
|
|
||||||
@@ -1,313 +0,0 @@
|
|||||||
<script>
|
|
||||||
/** @type {{ entry: import('./stores/journalStore.js').JournalEntry, onBack: () => void }} */
|
|
||||||
let { entry, onBack } = $props();
|
|
||||||
|
|
||||||
let photoIdx = $state(0);
|
|
||||||
|
|
||||||
function formatDate(/** @type {string} */ iso) {
|
|
||||||
return new Date(iso).toLocaleDateString('en-US', {
|
|
||||||
year: 'numeric', month: 'long', day: 'numeric',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function prev() {
|
|
||||||
photoIdx = (photoIdx - 1 + entry.photos.length) % entry.photos.length;
|
|
||||||
}
|
|
||||||
function next() {
|
|
||||||
photoIdx = (photoIdx + 1) % entry.photos.length;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<article class="detail-page">
|
|
||||||
|
|
||||||
<button class="back-btn" onclick={onBack} aria-label="Back to timeline">
|
|
||||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
|
||||||
<path d="M10 3L5 8l5 5" stroke="currentColor" stroke-width="1.8"
|
|
||||||
stroke-linecap="round" stroke-linejoin="round"/>
|
|
||||||
</svg>
|
|
||||||
Back
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{#if entry.photos.length > 0}
|
|
||||||
<div class="hero-gallery">
|
|
||||||
<img
|
|
||||||
class="hero-img"
|
|
||||||
src={entry.photos[photoIdx]}
|
|
||||||
alt="{entry.title} — photo {photoIdx + 1}"
|
|
||||||
loading="lazy"
|
|
||||||
/>
|
|
||||||
{#if entry.photos.length > 1}
|
|
||||||
<button class="arr left" onclick={prev} aria-label="Previous photo">‹</button>
|
|
||||||
<button class="arr right" onclick={next} aria-label="Next photo">›</button>
|
|
||||||
<div class="thumb-strip">
|
|
||||||
{#each entry.photos as photo, i}
|
|
||||||
<button
|
|
||||||
class="thumb"
|
|
||||||
class:active={i === photoIdx}
|
|
||||||
onclick={() => (photoIdx = i)}
|
|
||||||
aria-label="Photo {i + 1}"
|
|
||||||
>
|
|
||||||
<img src={photo} alt="" />
|
|
||||||
</button>
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
<span class="photo-counter">{photoIdx + 1} / {entry.photos.length}</span>
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<div class="detail-content">
|
|
||||||
<div class="meta-row">
|
|
||||||
<span class="badge loc-badge">📍 {entry.location.city}, {entry.location.country}</span>
|
|
||||||
<span class="badge trip-badge trip-badge--{entry.tripType}">
|
|
||||||
{entry.tripType === 'solo' ? '🧍 Solo' : '👥 With Friends'}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<h1 class="detail-title">{entry.title}</h1>
|
|
||||||
|
|
||||||
<div class="stats-row">
|
|
||||||
<div class="stat">
|
|
||||||
<span class="stat-label">Date</span>
|
|
||||||
<time class="stat-value" datetime={entry.date}>{formatDate(entry.date)}</time>
|
|
||||||
</div>
|
|
||||||
<div class="stat-divider"></div>
|
|
||||||
<div class="stat">
|
|
||||||
<span class="stat-label">Duration</span>
|
|
||||||
<span class="stat-value">{entry.days} {entry.days === 1 ? 'day' : 'days'}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr class="section-divider" />
|
|
||||||
<p class="detail-memo">{entry.memo}</p>
|
|
||||||
<hr class="section-divider" />
|
|
||||||
|
|
||||||
<div class="song-row">
|
|
||||||
<div class="song-icon-wrap" aria-hidden="true">
|
|
||||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
|
||||||
<path d="M9 18V5l12-2v13" stroke="currentColor" stroke-width="2"
|
|
||||||
stroke-linecap="round" stroke-linejoin="round"/>
|
|
||||||
<circle cx="6" cy="18" r="3" stroke="currentColor" stroke-width="2"/>
|
|
||||||
<circle cx="18" cy="16" r="3" stroke="currentColor" stroke-width="2"/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
<div class="song-text">
|
|
||||||
<span class="song-label">Soundtrack</span>
|
|
||||||
<span class="song-name">{entry.song.title}</span>
|
|
||||||
<span class="song-artist">{entry.song.artist}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.detail-page {
|
|
||||||
max-width: 680px;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 32px 24px 80px;
|
|
||||||
font-family: var(--sans, system-ui, sans-serif);
|
|
||||||
}
|
|
||||||
|
|
||||||
.back-btn {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: var(--text, #6b6375);
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
cursor: pointer;
|
|
||||||
padding: 6px 0;
|
|
||||||
margin-bottom: 28px;
|
|
||||||
transition: color 0.15s;
|
|
||||||
}
|
|
||||||
.back-btn:hover { color: var(--accent, #aa3bff); }
|
|
||||||
|
|
||||||
.hero-gallery {
|
|
||||||
position: relative;
|
|
||||||
border-radius: 16px;
|
|
||||||
overflow: hidden;
|
|
||||||
background: #000;
|
|
||||||
margin-bottom: 28px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hero-img {
|
|
||||||
width: 100%;
|
|
||||||
height: 380px;
|
|
||||||
object-fit: cover;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.arr {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
background: rgba(0,0,0,0.45);
|
|
||||||
color: #fff;
|
|
||||||
border: none;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
border-radius: 50%;
|
|
||||||
font-size: 24px;
|
|
||||||
cursor: pointer;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
transition: background 0.15s;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
.arr:hover { background: rgba(0,0,0,0.7); }
|
|
||||||
.arr.left { left: 14px; }
|
|
||||||
.arr.right { right: 14px; }
|
|
||||||
|
|
||||||
.photo-counter {
|
|
||||||
position: absolute;
|
|
||||||
top: 14px;
|
|
||||||
right: 14px;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #fff;
|
|
||||||
background: rgba(0,0,0,0.45);
|
|
||||||
padding: 3px 10px;
|
|
||||||
border-radius: 20px;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thumb-strip {
|
|
||||||
position: absolute;
|
|
||||||
bottom: 12px;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
display: flex;
|
|
||||||
gap: 8px;
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thumb {
|
|
||||||
width: 52px;
|
|
||||||
height: 36px;
|
|
||||||
border-radius: 6px;
|
|
||||||
overflow: hidden;
|
|
||||||
border: 2px solid transparent;
|
|
||||||
padding: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
opacity: 0.65;
|
|
||||||
background: none;
|
|
||||||
transition: border-color 0.15s, opacity 0.15s;
|
|
||||||
}
|
|
||||||
.thumb.active { border-color: #fff; opacity: 1; }
|
|
||||||
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|
||||||
|
|
||||||
.detail-content { text-align: left; }
|
|
||||||
|
|
||||||
.meta-row {
|
|
||||||
display: flex;
|
|
||||||
gap: 8px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
margin-bottom: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.badge {
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 500;
|
|
||||||
padding: 4px 10px;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loc-badge {
|
|
||||||
background: var(--accent-bg, rgba(170,59,255,0.08));
|
|
||||||
color: var(--accent, #aa3bff);
|
|
||||||
}
|
|
||||||
|
|
||||||
.trip-badge--solo { background: rgba(245,158,11,0.12); color: #b45309; }
|
|
||||||
.trip-badge--friends { background: rgba(59,130,246,0.12); color: #1d4ed8; }
|
|
||||||
|
|
||||||
.detail-title {
|
|
||||||
font-size: 28px;
|
|
||||||
font-weight: 700;
|
|
||||||
color: var(--text-h, #08060d);
|
|
||||||
margin: 0 0 20px;
|
|
||||||
letter-spacing: -0.6px;
|
|
||||||
line-height: 1.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stats-row {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 20px;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat { display: flex; flex-direction: column; gap: 2px; }
|
|
||||||
|
|
||||||
.stat-label {
|
|
||||||
font-size: 11px;
|
|
||||||
letter-spacing: 1.5px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
color: var(--text, #6b6375);
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-value {
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--text-h, #08060d);
|
|
||||||
}
|
|
||||||
|
|
||||||
.stat-divider {
|
|
||||||
width: 1px;
|
|
||||||
height: 32px;
|
|
||||||
background: var(--border, #e5e4e7);
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-divider {
|
|
||||||
border: none;
|
|
||||||
border-top: 1px solid var(--border, #e5e4e7);
|
|
||||||
margin: 24px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.detail-memo {
|
|
||||||
font-size: 16px;
|
|
||||||
line-height: 1.75;
|
|
||||||
color: var(--text, #6b6375);
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.song-row { display: flex; align-items: center; gap: 14px; }
|
|
||||||
|
|
||||||
.song-icon-wrap {
|
|
||||||
width: 44px;
|
|
||||||
height: 44px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: var(--accent-bg, rgba(170,59,255,0.08));
|
|
||||||
color: var(--accent, #aa3bff);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.song-text { display: flex; flex-direction: column; gap: 2px; }
|
|
||||||
|
|
||||||
.song-label {
|
|
||||||
font-size: 11px;
|
|
||||||
letter-spacing: 1.5px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
color: var(--text, #6b6375);
|
|
||||||
}
|
|
||||||
|
|
||||||
.song-name {
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--text-h, #08060d);
|
|
||||||
}
|
|
||||||
|
|
||||||
.song-artist { font-size: 13px; color: var(--text, #6b6375); }
|
|
||||||
|
|
||||||
@media (max-width: 600px) {
|
|
||||||
.detail-page { padding: 24px 16px 60px; }
|
|
||||||
.hero-img { height: 260px; }
|
|
||||||
.detail-title { font-size: 22px; }
|
|
||||||
.thumb { width: 40px; height: 28px; }
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,349 +0,0 @@
|
|||||||
<script>
|
|
||||||
import { get } from 'svelte/store';
|
|
||||||
import { journals } from './stores/journalStore.js';
|
|
||||||
import JournalDetail from './JournalDetail.svelte';
|
|
||||||
|
|
||||||
/** @type {import('./stores/journalStore.js').JournalEntry|null} */
|
|
||||||
let selected = $state(null);
|
|
||||||
|
|
||||||
/** @type {Record<string, number>} */
|
|
||||||
let photoIdx = $state({});
|
|
||||||
|
|
||||||
// Store subscription
|
|
||||||
let entries = $state(get(journals));
|
|
||||||
$effect(() => {
|
|
||||||
const unsub = journals.subscribe((v) => { entries = v; });
|
|
||||||
return unsub;
|
|
||||||
});
|
|
||||||
|
|
||||||
const sortOptions = [
|
|
||||||
{ value: 'date-desc', label: 'Newest First' },
|
|
||||||
{ value: 'date-asc', label: 'Oldest First' },
|
|
||||||
{ value: 'country-asc', label: 'Country A → Z' },
|
|
||||||
{ value: 'country-desc', label: 'Country Z → A' },
|
|
||||||
];
|
|
||||||
|
|
||||||
let sortKey = $state('date-desc');
|
|
||||||
|
|
||||||
// Explicit $effect so sortKey changes always trigger a re-sort
|
|
||||||
let sortedEntries = $state(/** @type {typeof entries} */([]));
|
|
||||||
$effect(() => {
|
|
||||||
const key = sortKey;
|
|
||||||
sortedEntries = [...entries].sort((a, b) => {
|
|
||||||
if (key === 'date-asc') return a.date.localeCompare(b.date);
|
|
||||||
if (key === 'date-desc') return b.date.localeCompare(a.date);
|
|
||||||
if (key === 'country-asc') return a.location.country.localeCompare(b.location.country) || b.date.localeCompare(a.date);
|
|
||||||
if (key === 'country-desc') return b.location.country.localeCompare(a.location.country) || b.date.localeCompare(a.date);
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
function formatDate(/** @type {string} */ iso) {
|
|
||||||
return new Date(iso).toLocaleDateString('en-US', {
|
|
||||||
year: 'numeric', month: 'short', day: 'numeric',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function stepPhoto(/** @type {string} */ id, /** @type {number} */ total, /** @type {1|-1} */ dir, /** @type {Event} */ e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
const cur = photoIdx[id] ?? 0;
|
|
||||||
photoIdx = { ...photoIdx, [id]: (cur + dir + total) % total };
|
|
||||||
}
|
|
||||||
|
|
||||||
function setPhoto(/** @type {string} */ id, /** @type {number} */ i, /** @type {Event} */ e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
photoIdx = { ...photoIdx, [id]: i };
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{#if selected}
|
|
||||||
<JournalDetail entry={selected} onBack={() => (selected = null)} />
|
|
||||||
{:else}
|
|
||||||
<section class="timeline-view">
|
|
||||||
|
|
||||||
<header class="toolbar">
|
|
||||||
<div class="title-block">
|
|
||||||
<p class="eyebrow">Travel Journal</p>
|
|
||||||
<h1 class="page-title">My Journey</h1>
|
|
||||||
</div>
|
|
||||||
<div class="sort-control">
|
|
||||||
<label for="sort-select">Sort</label>
|
|
||||||
<select id="sort-select" onchange={(e) => (sortKey = e.currentTarget.value)}>
|
|
||||||
{#each sortOptions as opt}
|
|
||||||
<option value={opt.value} selected={opt.value === sortKey}>{opt.label}</option>
|
|
||||||
{/each}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
{#if sortedEntries.length === 0}
|
|
||||||
<p class="empty">No journal entries yet.</p>
|
|
||||||
{:else}
|
|
||||||
<ol class="v-list">
|
|
||||||
{#each sortedEntries as entry (entry.id)}
|
|
||||||
{@const idx = photoIdx[entry.id] ?? 0}
|
|
||||||
<li class="v-item">
|
|
||||||
<div class="v-dot" aria-hidden="true"></div>
|
|
||||||
<div class="v-entry-wrap">
|
|
||||||
<div class="above-card">
|
|
||||||
<time class="above-date" datetime={entry.date}>{formatDate(entry.date)}</time>
|
|
||||||
<span class="above-sep">·</span>
|
|
||||||
<span class="above-loc">{entry.location.city}, {entry.location.country}</span>
|
|
||||||
<span class="above-sep">·</span>
|
|
||||||
<span class="above-days">{entry.days} {entry.days === 1 ? 'day' : 'days'}</span>
|
|
||||||
</div>
|
|
||||||
<div class="entry-card" role="button" tabindex="0"
|
|
||||||
onclick={() => (selected = entry)}
|
|
||||||
onkeydown={(e) => e.key === 'Enter' && (selected = entry)}>
|
|
||||||
|
|
||||||
{#if entry.photos.length > 0}
|
|
||||||
<div class="gallery">
|
|
||||||
<img class="gallery-main" src={entry.photos[idx]}
|
|
||||||
alt="{entry.title} photo {idx + 1}" loading="lazy" />
|
|
||||||
{#if entry.photos.length > 1}
|
|
||||||
<button class="gallery-arrow left"
|
|
||||||
onclick={(e) => stepPhoto(entry.id, entry.photos.length, -1, e)}
|
|
||||||
aria-label="Previous photo">‹</button>
|
|
||||||
<button class="gallery-arrow right"
|
|
||||||
onclick={(e) => stepPhoto(entry.id, entry.photos.length, 1, e)}
|
|
||||||
aria-label="Next photo">›</button>
|
|
||||||
<div class="gallery-dots">
|
|
||||||
{#each entry.photos as _, i}
|
|
||||||
<button class="gallery-pip" class:active={i === idx}
|
|
||||||
onclick={(e) => setPhoto(entry.id, i, e)}
|
|
||||||
aria-label="Photo {i + 1}"></button>
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<div class="entry-body">
|
|
||||||
<h2 class="entry-title">{entry.title}</h2>
|
|
||||||
{#if entry.memo}
|
|
||||||
<p class="entry-memo">{entry.memo}</p>
|
|
||||||
{/if}
|
|
||||||
<div class="entry-song">
|
|
||||||
<svg class="song-icon" width="13" height="13" viewBox="0 0 24 24" fill="none">
|
|
||||||
<path d="M9 18V5l12-2v13" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
||||||
<circle cx="6" cy="18" r="3" stroke="currentColor" stroke-width="2"/>
|
|
||||||
<circle cx="18" cy="16" r="3" stroke="currentColor" stroke-width="2"/>
|
|
||||||
</svg>
|
|
||||||
<span class="song-title">{entry.song.title}</span>
|
|
||||||
<span class="song-sep">·</span>
|
|
||||||
<span class="song-artist">{entry.song.artist}</span>
|
|
||||||
<span class="trip-badge trip-badge--{entry.tripType}">
|
|
||||||
{entry.tripType === 'solo' ? 'Solo' : 'With Friends'}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
{/each}
|
|
||||||
</ol>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<footer class="page-footer">
|
|
||||||
{sortedEntries.length} {sortedEntries.length === 1 ? 'entry' : 'entries'}
|
|
||||||
</footer>
|
|
||||||
</section>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.timeline-view {
|
|
||||||
max-width: 600px;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 48px 24px 64px;
|
|
||||||
font-family: var(--sans, system-ui, sans-serif);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Toolbar */
|
|
||||||
.toolbar {
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
justify-content: space-between;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 20px;
|
|
||||||
margin-bottom: 48px;
|
|
||||||
padding-bottom: 24px;
|
|
||||||
border-bottom: 1px solid var(--border, #e5e4e7);
|
|
||||||
}
|
|
||||||
|
|
||||||
.eyebrow {
|
|
||||||
font-size: 11px;
|
|
||||||
letter-spacing: 3px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
color: var(--accent, #aa3bff);
|
|
||||||
margin: 0 0 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.page-title {
|
|
||||||
font-size: 32px;
|
|
||||||
font-weight: 700;
|
|
||||||
color: var(--text-h, #08060d);
|
|
||||||
margin: 0;
|
|
||||||
letter-spacing: -0.8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sort-control { display: flex; align-items: center; gap: 8px; }
|
|
||||||
.sort-control label { font-size: 13px; color: var(--text, #6b6375); }
|
|
||||||
|
|
||||||
select {
|
|
||||||
font-size: 13px;
|
|
||||||
padding: 7px 28px 7px 10px;
|
|
||||||
border: 1px solid var(--border, #e5e4e7);
|
|
||||||
border-radius: 8px;
|
|
||||||
background: var(--bg, #fff);
|
|
||||||
color: var(--text-h, #08060d);
|
|
||||||
cursor: pointer;
|
|
||||||
appearance: none;
|
|
||||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b6375' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-position: right 10px center;
|
|
||||||
}
|
|
||||||
select:focus { outline: 2px solid var(--accent, #aa3bff); outline-offset: 2px; }
|
|
||||||
|
|
||||||
/* Above-card */
|
|
||||||
.above-card {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 6px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
.above-date { font-size: 12px; font-weight: 500; color: var(--text-h, #08060d); }
|
|
||||||
.above-loc, .above-days { font-size: 12px; color: var(--text, #6b6375); }
|
|
||||||
.above-sep { font-size: 11px; color: var(--border, #c8c6cc); user-select: none; }
|
|
||||||
|
|
||||||
/* Card */
|
|
||||||
.entry-card {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border: 1px solid var(--border, #e5e4e7);
|
|
||||||
border-radius: 14px;
|
|
||||||
overflow: hidden;
|
|
||||||
background: var(--bg, #fff);
|
|
||||||
cursor: pointer;
|
|
||||||
transition: box-shadow 0.2s, transform 0.15s;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
.entry-card:hover {
|
|
||||||
box-shadow: 0 6px 24px rgba(0,0,0,0.1);
|
|
||||||
transform: translateY(-2px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.entry-body { padding: 14px 18px 18px; }
|
|
||||||
|
|
||||||
.entry-song .trip-badge { margin-left: auto; flex-shrink: 0; }
|
|
||||||
|
|
||||||
.trip-badge {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 11px;
|
|
||||||
font-weight: 500;
|
|
||||||
padding: 2px 8px;
|
|
||||||
border-radius: 20px;
|
|
||||||
}
|
|
||||||
.trip-badge--solo { background: rgba(245,158,11,0.12); color: #b45309; }
|
|
||||||
.trip-badge--friends { background: rgba(59,130,246,0.12); color: #1d4ed8; }
|
|
||||||
|
|
||||||
.entry-title {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: var(--text-h, #08060d);
|
|
||||||
margin: 0 0 6px;
|
|
||||||
letter-spacing: -0.2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.entry-memo {
|
|
||||||
font-size: 13px;
|
|
||||||
line-height: 1.6;
|
|
||||||
color: var(--text, #6b6375);
|
|
||||||
margin: 0 0 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.entry-song {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 5px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--text, #6b6375);
|
|
||||||
padding-top: 10px;
|
|
||||||
border-top: 1px solid var(--border, #e5e4e7);
|
|
||||||
}
|
|
||||||
.song-icon { flex-shrink: 0; color: var(--accent, #aa3bff); }
|
|
||||||
.song-title { font-weight: 500; color: var(--text-h, #08060d); }
|
|
||||||
.song-sep { opacity: 0.35; }
|
|
||||||
|
|
||||||
/* Gallery */
|
|
||||||
.gallery { position: relative; overflow: hidden; background: #000; }
|
|
||||||
.gallery-main { width: 100%; height: 220px; object-fit: cover; display: block; }
|
|
||||||
|
|
||||||
.gallery-arrow {
|
|
||||||
position: absolute; top: 50%; transform: translateY(-50%);
|
|
||||||
background: rgba(0,0,0,0.45); color: #fff;
|
|
||||||
border: none; width: 32px; height: 32px; border-radius: 50%;
|
|
||||||
font-size: 20px; cursor: pointer;
|
|
||||||
display: flex; align-items: center; justify-content: center;
|
|
||||||
transition: background 0.15s; z-index: 2;
|
|
||||||
}
|
|
||||||
.gallery-arrow:hover { background: rgba(0,0,0,0.7); }
|
|
||||||
.gallery-arrow.left { left: 10px; }
|
|
||||||
.gallery-arrow.right { right: 10px; }
|
|
||||||
|
|
||||||
.gallery-dots {
|
|
||||||
position: absolute; bottom: 8px; left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
display: flex; gap: 5px; z-index: 2;
|
|
||||||
}
|
|
||||||
.gallery-pip {
|
|
||||||
width: 6px; height: 6px; border-radius: 50%;
|
|
||||||
border: none; background: rgba(255,255,255,0.5);
|
|
||||||
cursor: pointer; padding: 0;
|
|
||||||
transition: background 0.15s, transform 0.15s;
|
|
||||||
}
|
|
||||||
.gallery-pip.active { background: #fff; transform: scale(1.3); }
|
|
||||||
|
|
||||||
/* Vertical timeline */
|
|
||||||
.v-list { list-style: none; padding: 0; margin: 0; position: relative; }
|
|
||||||
.v-list::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute; left: 10px; top: 6px; bottom: 6px;
|
|
||||||
width: 2px; background: var(--border, #e5e4e7); border-radius: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.v-item { display: flex; gap: 24px; align-items: flex-start; padding-bottom: 36px; }
|
|
||||||
.v-item:last-child { padding-bottom: 0; }
|
|
||||||
|
|
||||||
.v-dot {
|
|
||||||
flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
|
|
||||||
background: var(--accent, #aa3bff);
|
|
||||||
border: 3px solid var(--bg, #fff);
|
|
||||||
box-shadow: 0 0 0 2px var(--accent, #aa3bff);
|
|
||||||
margin-top: 28px; z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.v-entry-wrap { flex: 1; display: flex; flex-direction: column; }
|
|
||||||
|
|
||||||
/* Footer */
|
|
||||||
.page-footer {
|
|
||||||
margin-top: 40px;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 13px;
|
|
||||||
color: var(--text, #6b6375);
|
|
||||||
padding-top: 24px;
|
|
||||||
border-top: 1px solid var(--border, #e5e4e7);
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty { text-align: center; color: var(--text, #6b6375); padding: 80px 0; }
|
|
||||||
|
|
||||||
@media (max-width: 600px) {
|
|
||||||
.timeline-view { padding: 32px 16px 48px; }
|
|
||||||
.page-title { font-size: 26px; }
|
|
||||||
.v-list::before { left: 8px; }
|
|
||||||
.v-dot { width: 18px; height: 18px; }
|
|
||||||
.v-item { gap: 16px; }
|
|
||||||
.gallery-main { height: 180px; }
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
25
src/lib/layout/Footer.svelte
Normal file
25
src/lib/layout/Footer.svelte
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<script>
|
||||||
|
import { getSelected, getTotalCount } from './selection.svelte.js';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<footer class="footer">
|
||||||
|
<span>{getSelected().size} / {getTotalCount()} countries visited</span>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.footer {
|
||||||
|
height: 40px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-family: var(--sans);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 300;
|
||||||
|
color: var(--text-sub);
|
||||||
|
border-top: 1px solid var(--border);
|
||||||
|
background: var(--bg);
|
||||||
|
flex-shrink: 0;
|
||||||
|
letter-spacing: 0.06em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
33
src/lib/layout/Layout.svelte
Normal file
33
src/lib/layout/Layout.svelte
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<script>
|
||||||
|
import TopBar from './TopBar.svelte';
|
||||||
|
import Footer from './Footer.svelte';
|
||||||
|
|
||||||
|
let { screen, onNavigate, children } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="layout">
|
||||||
|
<TopBar {screen} {onNavigate} />
|
||||||
|
<main class="main">
|
||||||
|
{@render children()}
|
||||||
|
</main>
|
||||||
|
<Footer />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.layout {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
display: grid;
|
||||||
|
grid-template-rows: auto 1fr auto;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main {
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
65
src/lib/layout/TopBar.svelte
Normal file
65
src/lib/layout/TopBar.svelte
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<script>
|
||||||
|
let { screen, onNavigate } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<nav class="topbar">
|
||||||
|
<span class="logo">Map Journal</span>
|
||||||
|
<div class="nav-links">
|
||||||
|
<button class="nav-btn" class:active={screen === 'worldmap'} onclick={() => onNavigate('worldmap')}>Map</button>
|
||||||
|
<button class="nav-btn" class:active={screen === 'timeline'} onclick={() => onNavigate('timeline')}>Journal</button>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.topbar {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0 32px;
|
||||||
|
height: 52px;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
background: var(--bg);
|
||||||
|
flex-shrink: 0;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo {
|
||||||
|
font-family: var(--heading);
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--text-h);
|
||||||
|
letter-spacing: 0.01em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-links {
|
||||||
|
display: flex;
|
||||||
|
gap: 2px;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
background: var(--bg-subtle);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-btn {
|
||||||
|
font-family: var(--sans);
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 300;
|
||||||
|
padding: 4px 18px;
|
||||||
|
border-radius: 6px;
|
||||||
|
border: none;
|
||||||
|
background: none;
|
||||||
|
color: var(--text);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.15s, color 0.15s;
|
||||||
|
letter-spacing: 0.01em;
|
||||||
|
}
|
||||||
|
.nav-btn:hover { color: var(--text-h); }
|
||||||
|
.nav-btn.active {
|
||||||
|
background: var(--bg);
|
||||||
|
color: var(--text-h);
|
||||||
|
box-shadow: 0 1px 4px rgba(0,0,0,0.08);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
28
src/lib/layout/selection.svelte.js
Normal file
28
src/lib/layout/selection.svelte.js
Normal 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;
|
||||||
|
}
|
||||||
167
src/lib/shared/PhotoGallery.svelte
Normal file
167
src/lib/shared/PhotoGallery.svelte
Normal file
@@ -0,0 +1,167 @@
|
|||||||
|
<script>
|
||||||
|
/**
|
||||||
|
* Reusable photo gallery with prev/next arrows and indicator.
|
||||||
|
* @type {{
|
||||||
|
* photos: string[],
|
||||||
|
* height?: string,
|
||||||
|
* thumbs?: boolean,
|
||||||
|
* counter?: boolean,
|
||||||
|
* onStep?: (e: Event) => void,
|
||||||
|
* }}
|
||||||
|
*/
|
||||||
|
let { photos, height = '220px', thumbs = false, counter = false } = $props();
|
||||||
|
|
||||||
|
let idx = $state(0);
|
||||||
|
|
||||||
|
function prev(e) {
|
||||||
|
e?.stopPropagation();
|
||||||
|
idx = (idx - 1 + photos.length) % photos.length;
|
||||||
|
}
|
||||||
|
function next(e) {
|
||||||
|
e?.stopPropagation();
|
||||||
|
idx = (idx + 1) % photos.length;
|
||||||
|
}
|
||||||
|
function go(i, e) {
|
||||||
|
e?.stopPropagation();
|
||||||
|
idx = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset when photos change (e.g. navigating to a different entry)
|
||||||
|
$effect(() => {
|
||||||
|
photos;
|
||||||
|
idx = 0;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if photos.length > 0}
|
||||||
|
<div class="gallery" style="--gallery-height: {height}">
|
||||||
|
<img class="gallery-img" src={photos[idx]} alt="photo {idx + 1}" loading="lazy" />
|
||||||
|
|
||||||
|
{#if photos.length > 1}
|
||||||
|
<button class="arr left" onclick={prev} aria-label="Previous photo">‹</button>
|
||||||
|
<button class="arr right" onclick={next} aria-label="Next photo">›</button>
|
||||||
|
|
||||||
|
{#if thumbs}
|
||||||
|
<div class="thumb-strip">
|
||||||
|
{#each photos as photo, i}
|
||||||
|
<button class="thumb" class:active={i === idx} onclick={(e) => go(i, e)} aria-label="Photo {i + 1}">
|
||||||
|
<img src={photo} alt="" />
|
||||||
|
</button>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="dots">
|
||||||
|
{#each photos as _, i}
|
||||||
|
<button class="pip" class:active={i === idx} onclick={(e) => go(i, e)} aria-label="Photo {i + 1}"></button>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{#if counter}
|
||||||
|
<span class="counter">{idx + 1} / {photos.length}</span>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.gallery {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gallery-img {
|
||||||
|
width: 100%;
|
||||||
|
height: var(--gallery-height);
|
||||||
|
object-fit: cover;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.arr {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
background: rgba(0,0,0,0.45);
|
||||||
|
color: #fff;
|
||||||
|
border: none;
|
||||||
|
border-radius: 50%;
|
||||||
|
font-size: 22px;
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
transition: background 0.15s;
|
||||||
|
z-index: 2;
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
}
|
||||||
|
.arr:hover { background: rgba(0,0,0,0.7); }
|
||||||
|
.arr.left { left: 10px; }
|
||||||
|
.arr.right { right: 10px; }
|
||||||
|
|
||||||
|
/* Dot indicators (timeline cards) */
|
||||||
|
.dots {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 8px;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
display: flex;
|
||||||
|
gap: 5px;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
.pip {
|
||||||
|
width: 6px;
|
||||||
|
height: 6px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: none;
|
||||||
|
background: rgba(255,255,255,0.5);
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 0;
|
||||||
|
transition: background 0.15s, transform 0.15s;
|
||||||
|
}
|
||||||
|
.pip.active { background: #fff; transform: scale(1.3); }
|
||||||
|
|
||||||
|
/* Thumbnail strip (detail page) */
|
||||||
|
.thumb-strip {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 12px;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
.thumb {
|
||||||
|
width: 52px;
|
||||||
|
height: 36px;
|
||||||
|
border-radius: 6px;
|
||||||
|
overflow: hidden;
|
||||||
|
border: 2px solid transparent;
|
||||||
|
padding: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0.65;
|
||||||
|
background: none;
|
||||||
|
transition: border-color 0.15s, opacity 0.15s;
|
||||||
|
}
|
||||||
|
.thumb.active { border-color: #fff; opacity: 1; }
|
||||||
|
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
||||||
|
|
||||||
|
/* Photo counter badge */
|
||||||
|
.counter {
|
||||||
|
position: absolute;
|
||||||
|
top: 14px;
|
||||||
|
right: 14px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 300;
|
||||||
|
color: #fff;
|
||||||
|
background: rgba(0,0,0,0.45);
|
||||||
|
padding: 3px 10px;
|
||||||
|
border-radius: 20px;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
.thumb { width: 40px; height: 28px; }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
156
src/lib/timeline/JournalDetail.svelte
Normal file
156
src/lib/timeline/JournalDetail.svelte
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
<script>
|
||||||
|
import PhotoGallery from '../shared/PhotoGallery.svelte';
|
||||||
|
|
||||||
|
/** @type {{ entry: import('../stores/journalStore.js').JournalEntry, onBack: () => void }} */
|
||||||
|
let { entry, onBack } = $props();
|
||||||
|
|
||||||
|
function formatDate(/** @type {string} */ iso) {
|
||||||
|
return new Date(iso).toLocaleDateString('en-US', {
|
||||||
|
year: 'numeric', month: 'long', day: 'numeric',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<article class="detail-page">
|
||||||
|
|
||||||
|
<button class="back-btn" onclick={onBack} aria-label="Back to timeline">
|
||||||
|
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
|
||||||
|
<path d="M10 3L5 8l5 5" stroke="currentColor" stroke-width="1.8"
|
||||||
|
stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
Back
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="hero-gallery-wrap">
|
||||||
|
<PhotoGallery photos={entry.photos} height="380px" thumbs counter />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="detail-content">
|
||||||
|
<div class="meta-row">
|
||||||
|
<span class="badge loc-badge">📍 {entry.location.city}, {entry.location.country}</span>
|
||||||
|
<span class="badge trip-badge trip-badge--{entry.tripType}">
|
||||||
|
{entry.tripType === 'solo' ? '🧍 Solo' : '👥 With Friends'}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h1 class="detail-title">{entry.title}</h1>
|
||||||
|
|
||||||
|
<div class="stats-row">
|
||||||
|
<div class="stat">
|
||||||
|
<span class="stat-label">Date</span>
|
||||||
|
<time class="stat-value" datetime={entry.date}>{formatDate(entry.date)}</time>
|
||||||
|
</div>
|
||||||
|
<div class="stat-divider"></div>
|
||||||
|
<div class="stat">
|
||||||
|
<span class="stat-label">Duration</span>
|
||||||
|
<span class="stat-value">{entry.days} {entry.days === 1 ? 'day' : 'days'}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr class="section-divider" />
|
||||||
|
<p class="detail-memo">{entry.memo}</p>
|
||||||
|
<hr class="section-divider" />
|
||||||
|
|
||||||
|
<div class="song-row">
|
||||||
|
<div class="song-icon-wrap" aria-hidden="true">
|
||||||
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none">
|
||||||
|
<path d="M9 18V5l12-2v13" stroke="currentColor" stroke-width="2"
|
||||||
|
stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<circle cx="6" cy="18" r="3" stroke="currentColor" stroke-width="2"/>
|
||||||
|
<circle cx="18" cy="16" r="3" stroke="currentColor" stroke-width="2"/>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div class="song-text">
|
||||||
|
<span class="song-label">Soundtrack</span>
|
||||||
|
<span class="song-name">{entry.song.title}</span>
|
||||||
|
<span class="song-artist">{entry.song.artist}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.detail-page {
|
||||||
|
max-width: 720px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 48px 40px 100px;
|
||||||
|
font-family: var(--sans, system-ui, sans-serif);
|
||||||
|
}
|
||||||
|
|
||||||
|
.back-btn {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 300;
|
||||||
|
color: var(--text, #6b6375);
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 6px 0;
|
||||||
|
margin-bottom: 28px;
|
||||||
|
transition: color 0.15s;
|
||||||
|
}
|
||||||
|
.back-btn:hover { color: var(--accent); }
|
||||||
|
|
||||||
|
.hero-gallery-wrap {
|
||||||
|
border-radius: 16px;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-bottom: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-content { text-align: left; }
|
||||||
|
|
||||||
|
.meta-row {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 300;
|
||||||
|
padding: 4px 10px;
|
||||||
|
border-radius: 20px;
|
||||||
|
}
|
||||||
|
.loc-badge { background: var(--accent-bg); color: var(--accent); }
|
||||||
|
.trip-badge--solo { background: rgba(245,158,11,0.1); color: #92400e; }
|
||||||
|
.trip-badge--friends { background: var(--accent-bg); color: var(--accent); }
|
||||||
|
|
||||||
|
.detail-title {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--text-h, #08060d);
|
||||||
|
margin: 0 0 20px;
|
||||||
|
letter-spacing: -0.6px;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stats-row { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
|
||||||
|
.stat { display: flex; flex-direction: column; gap: 2px; }
|
||||||
|
.stat-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text, #6b6375); }
|
||||||
|
.stat-value { font-size: 15px; font-weight: 300; color: var(--text-h, #08060d); }
|
||||||
|
.stat-divider { width: 1px; height: 32px; background: var(--border, #e5e4e7); }
|
||||||
|
|
||||||
|
.section-divider { border: none; border-top: 1px solid var(--border, #e5e4e7); margin: 24px 0; }
|
||||||
|
|
||||||
|
.detail-memo { font-size: 16px; line-height: 1.75; color: var(--text, #6b6375); margin: 0; }
|
||||||
|
|
||||||
|
.song-row { display: flex; align-items: center; gap: 14px; }
|
||||||
|
.song-icon-wrap {
|
||||||
|
width: 44px; height: 44px; border-radius: 50%;
|
||||||
|
background: var(--accent-bg);
|
||||||
|
color: var(--accent);
|
||||||
|
display: flex; align-items: center; justify-content: center; flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.song-text { display: flex; flex-direction: column; gap: 2px; }
|
||||||
|
.song-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text, #6b6375); }
|
||||||
|
.song-name { font-size: 15px; font-weight: 300; color: var(--text-h, #08060d); }
|
||||||
|
.song-artist { font-size: 13px; color: var(--text, #6b6375); }
|
||||||
|
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
.detail-page { padding: 24px 16px 60px; }
|
||||||
|
.detail-title { font-size: 22px; }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
215
src/lib/timeline/JournalSummary.svelte
Normal file
215
src/lib/timeline/JournalSummary.svelte
Normal file
@@ -0,0 +1,215 @@
|
|||||||
|
<script>
|
||||||
|
/** @type {{ entries: import('../stores/journalStore.js').JournalEntry[] }} */
|
||||||
|
let { entries } = $props();
|
||||||
|
|
||||||
|
let stats = $derived.by(() => {
|
||||||
|
if (entries.length === 0) return null;
|
||||||
|
|
||||||
|
const totalDays = entries.reduce((s, e) => s + e.days, 0);
|
||||||
|
const countries = [...new Set(entries.map(e => e.location.country))];
|
||||||
|
const cities = [...new Set(entries.map(e => e.location.city))];
|
||||||
|
|
||||||
|
const countryCounts = {};
|
||||||
|
for (const e of entries) countryCounts[e.location.country] = (countryCounts[e.location.country] ?? 0) + 1;
|
||||||
|
const topCountry = Object.entries(countryCounts).sort((a, b) => b[1] - a[1])[0];
|
||||||
|
|
||||||
|
const soloCount = entries.filter(e => e.tripType === 'solo').length;
|
||||||
|
const soloPct = Math.round(soloCount / entries.length * 100);
|
||||||
|
|
||||||
|
const years = entries.map(e => new Date(e.date).getFullYear());
|
||||||
|
const minYear = Math.min(...years);
|
||||||
|
const maxYear = Math.max(...years);
|
||||||
|
const yearRange = minYear === maxYear ? `${minYear}` : `${minYear} – ${maxYear}`;
|
||||||
|
|
||||||
|
const latest = [...entries].sort((a, b) => b.date.localeCompare(a.date))[0];
|
||||||
|
|
||||||
|
return { totalDays, countries, cities, topCountry, soloCount, soloPct, yearRange, latest, tripCount: entries.length };
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
{#if stats}
|
||||||
|
<div class="summary">
|
||||||
|
|
||||||
|
<p class="eyebrow">My Journey</p>
|
||||||
|
<p class="year-range">{stats.yearRange}</p>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
|
||||||
|
<!-- Big stats -->
|
||||||
|
<div class="stat-stack">
|
||||||
|
<div class="stat-row">
|
||||||
|
<span class="stat-num">{stats.countries.length}</span>
|
||||||
|
<span class="stat-lbl">Countries</span>
|
||||||
|
</div>
|
||||||
|
<div class="stat-row">
|
||||||
|
<span class="stat-num">{stats.cities.length}</span>
|
||||||
|
<span class="stat-lbl">Cities</span>
|
||||||
|
</div>
|
||||||
|
<div class="stat-row">
|
||||||
|
<span class="stat-num">{stats.totalDays}</span>
|
||||||
|
<span class="stat-lbl">Days abroad</span>
|
||||||
|
</div>
|
||||||
|
<div class="stat-row">
|
||||||
|
<span class="stat-num">{stats.tripCount}</span>
|
||||||
|
<span class="stat-lbl">Trips</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
|
||||||
|
<!-- Most visited -->
|
||||||
|
<div class="insight">
|
||||||
|
<span class="insight-label">Most visited</span>
|
||||||
|
<span class="insight-value">{stats.topCountry[0]}</span>
|
||||||
|
<span class="insight-sub">{stats.topCountry[1]} {stats.topCountry[1] === 1 ? 'trip' : 'trips'}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Latest trip -->
|
||||||
|
<div class="insight">
|
||||||
|
<span class="insight-label">Latest trip</span>
|
||||||
|
<span class="insight-value">{stats.latest.location.city}</span>
|
||||||
|
<span class="insight-sub">{stats.latest.location.country}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
|
||||||
|
<!-- Trip style bar -->
|
||||||
|
<div class="style-section">
|
||||||
|
<span class="insight-label">Trip style</span>
|
||||||
|
<div class="style-bar">
|
||||||
|
<div class="style-fill" style="width: {stats.soloPct}%"></div>
|
||||||
|
</div>
|
||||||
|
<div class="style-legend">
|
||||||
|
<span><span class="dot solo-dot"></span> {stats.soloPct}% Solo</span>
|
||||||
|
<span><span class="dot friends-dot"></span> {100 - stats.soloPct}% Friends</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.summary {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eyebrow {
|
||||||
|
font-size: var(--text-xs);
|
||||||
|
font-weight: 400;
|
||||||
|
letter-spacing: 0.12em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: var(--accent);
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.year-range {
|
||||||
|
font-size: var(--text-lg);
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--text-h);
|
||||||
|
letter-spacing: -0.3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divider {
|
||||||
|
height: 1px;
|
||||||
|
background: var(--border);
|
||||||
|
margin: 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Stat stack */
|
||||||
|
.stat-stack {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-num {
|
||||||
|
font-size: var(--text-2xl);
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--text-h);
|
||||||
|
letter-spacing: -1px;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-lbl {
|
||||||
|
font-size: var(--text-xs);
|
||||||
|
font-weight: 300;
|
||||||
|
color: var(--text-sub);
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.06em;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Insights */
|
||||||
|
.insight {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
.insight:last-of-type { margin-bottom: 0; }
|
||||||
|
|
||||||
|
.insight-label {
|
||||||
|
font-size: var(--text-xs);
|
||||||
|
font-weight: 400;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.08em;
|
||||||
|
color: var(--accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.insight-value {
|
||||||
|
font-size: var(--text-md);
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--text-h);
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.insight-sub {
|
||||||
|
font-size: var(--text-sm);
|
||||||
|
font-weight: 300;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Trip style */
|
||||||
|
.style-section { display: flex; flex-direction: column; gap: 8px; }
|
||||||
|
|
||||||
|
.style-bar {
|
||||||
|
height: 6px;
|
||||||
|
border-radius: 99px;
|
||||||
|
background: var(--lavender-bg);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.style-fill {
|
||||||
|
height: 100%;
|
||||||
|
background: linear-gradient(90deg, var(--accent-dark), var(--lavender));
|
||||||
|
border-radius: 99px;
|
||||||
|
transition: width 0.4s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.style-legend {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: var(--text-xs);
|
||||||
|
font-weight: 300;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
display: inline-block;
|
||||||
|
width: 7px;
|
||||||
|
height: 7px;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 4px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
.solo-dot { background: var(--accent-dark); }
|
||||||
|
.friends-dot { background: var(--lavender); }
|
||||||
|
</style>
|
||||||
233
src/lib/timeline/TimelineCard.svelte
Normal file
233
src/lib/timeline/TimelineCard.svelte
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
<script>
|
||||||
|
/** @type {{ entry: import('../stores/journalStore.js').JournalEntry, onClick: () => void }} */
|
||||||
|
let { entry, onClick } = $props();
|
||||||
|
|
||||||
|
function formatDate(/** @type {string} */ iso) {
|
||||||
|
return new Date(iso).toLocaleDateString('en-US', {
|
||||||
|
year: 'numeric', month: 'short', day: 'numeric',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let mainPhoto = $derived(entry.photos[0] ?? null);
|
||||||
|
let thumbPhotos = $derived(entry.photos.slice(1, 4));
|
||||||
|
let extraCount = $derived(entry.photos.length > 4 ? entry.photos.length - 4 : 0);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<li class="v-item">
|
||||||
|
<div class="v-dot" aria-hidden="true"></div>
|
||||||
|
|
||||||
|
<div class="entry-card" role="button" tabindex="0"
|
||||||
|
onclick={onClick}
|
||||||
|
onkeydown={(e) => e.key === 'Enter' && onClick()}>
|
||||||
|
|
||||||
|
<div class="photo-grid" class:has-thumbs={thumbPhotos.length > 0}>
|
||||||
|
<div class="photo-main">
|
||||||
|
{#if mainPhoto}
|
||||||
|
<img src={mainPhoto} alt="" loading="lazy" />
|
||||||
|
{:else}
|
||||||
|
<div class="photo-placeholder"></div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<div class="overlay">
|
||||||
|
<div class="overlay-top">
|
||||||
|
<span class="trip-badge trip-badge--{entry.tripType}">
|
||||||
|
{entry.tripType === 'solo' ? 'Solo' : 'Friends'}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="overlay-bottom">
|
||||||
|
<span class="city">{entry.location.city}</span>
|
||||||
|
<span class="country">{entry.location.country}</span>
|
||||||
|
<span class="meta">{formatDate(entry.date)} · {entry.days} {entry.days === 1 ? 'day' : 'days'}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{#if thumbPhotos.length > 0}
|
||||||
|
<div class="photo-thumbs">
|
||||||
|
{#each thumbPhotos as photo, i}
|
||||||
|
<div class="photo-thumb">
|
||||||
|
<img src={photo} alt="" loading="lazy" />
|
||||||
|
{#if i === 2 && extraCount > 0}
|
||||||
|
<div class="extra-overlay">+{extraCount}</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.v-item {
|
||||||
|
display: flex;
|
||||||
|
gap: 14px;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding-bottom: 24px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.v-item:last-child { padding-bottom: 0; }
|
||||||
|
.v-item:not(:last-child)::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 4px;
|
||||||
|
top: 30px;
|
||||||
|
bottom: 0;
|
||||||
|
width: 1px;
|
||||||
|
background: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-dot {
|
||||||
|
flex-shrink: 0;
|
||||||
|
width: 9px;
|
||||||
|
height: 9px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: var(--bg);
|
||||||
|
border: 1.5px solid var(--accent);
|
||||||
|
margin-top: 20px;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Card ── */
|
||||||
|
.entry-card {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
border-radius: 14px;
|
||||||
|
overflow: hidden;
|
||||||
|
cursor: pointer;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
box-shadow: var(--shadow);
|
||||||
|
background: var(--bg-raised);
|
||||||
|
transition: box-shadow 0.2s, transform 0.15s;
|
||||||
|
}
|
||||||
|
.entry-card:hover {
|
||||||
|
box-shadow: 0 8px 32px rgba(0,0,0,0.12);
|
||||||
|
transform: translateY(-2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Photo grid — fluid, breakpoint via container width ── */
|
||||||
|
.photo-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
/* height adapts: taller when single photo */
|
||||||
|
height: 200px;
|
||||||
|
background: var(--bg-subtle);
|
||||||
|
}
|
||||||
|
.photo-grid.has-thumbs {
|
||||||
|
grid-template-columns: 2fr 1fr;
|
||||||
|
gap: 2px;
|
||||||
|
height: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Collapse to single column on narrow cards (< 340px) */
|
||||||
|
@container card (max-width: 340px) {
|
||||||
|
.photo-grid.has-thumbs {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
height: 180px;
|
||||||
|
}
|
||||||
|
.photo-thumbs { display: none; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.entry-card { container-type: inline-size; container-name: card; }
|
||||||
|
|
||||||
|
/* ── Main photo ── */
|
||||||
|
.photo-main {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.photo-main img,
|
||||||
|
.photo-placeholder {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.photo-placeholder { background: var(--accent-bg); }
|
||||||
|
|
||||||
|
/* ── Overlay gradient ── */
|
||||||
|
.overlay {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 12px;
|
||||||
|
background: linear-gradient(
|
||||||
|
to bottom,
|
||||||
|
rgba(0,0,0,0.22) 0%,
|
||||||
|
transparent 35%,
|
||||||
|
transparent 50%,
|
||||||
|
rgba(0,0,0,0.6) 100%
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
.overlay-top { display: flex; justify-content: flex-end; }
|
||||||
|
.overlay-bottom { display: flex; flex-direction: column; gap: 2px; }
|
||||||
|
|
||||||
|
.city {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 300;
|
||||||
|
color: rgba(255,255,255,0.8);
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
}
|
||||||
|
.country {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #fff;
|
||||||
|
letter-spacing: -0.3px;
|
||||||
|
line-height: 1.1;
|
||||||
|
text-shadow: 0 1px 6px rgba(0,0,0,0.35);
|
||||||
|
}
|
||||||
|
.meta {
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 300;
|
||||||
|
color: rgba(255,255,255,0.7);
|
||||||
|
margin-top: 3px;
|
||||||
|
letter-spacing: 0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Trip badge ── */
|
||||||
|
.trip-badge {
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 300;
|
||||||
|
padding: 2px 9px;
|
||||||
|
border-radius: 20px;
|
||||||
|
backdrop-filter: blur(8px);
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
}
|
||||||
|
.trip-badge--solo { background: rgba(245,158,11,0.7); color: #fff; }
|
||||||
|
.trip-badge--friends { background: rgba(124,58,237,0.7); color: #fff; }
|
||||||
|
|
||||||
|
/* ── Thumbs ── */
|
||||||
|
.photo-thumbs {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2px;
|
||||||
|
}
|
||||||
|
.photo-thumb {
|
||||||
|
position: relative;
|
||||||
|
flex: 1;
|
||||||
|
overflow: hidden;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
.photo-thumb img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.extra-overlay {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
background: rgba(0,0,0,0.45);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
62
src/lib/timeline/TimelineToolbar.svelte
Normal file
62
src/lib/timeline/TimelineToolbar.svelte
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<script>
|
||||||
|
const sortOptions = [
|
||||||
|
{ value: 'date-desc', label: 'Newest first' },
|
||||||
|
{ value: 'date-asc', label: 'Oldest first' },
|
||||||
|
{ value: 'country-asc', label: 'Country A → Z' },
|
||||||
|
{ value: 'country-desc', label: 'Country Z → A' },
|
||||||
|
];
|
||||||
|
|
||||||
|
let { sortKey, onSort } = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<header class="toolbar">
|
||||||
|
<h1 class="page-title">My Journey</h1>
|
||||||
|
<div class="sort-control">
|
||||||
|
<select id="sort-select" onchange={(e) => onSort(e.currentTarget.value)}>
|
||||||
|
{#each sortOptions as opt}
|
||||||
|
<option value={opt.value} selected={opt.value === sortKey}>{opt.label}</option>
|
||||||
|
{/each}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.toolbar {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 16px;
|
||||||
|
margin-bottom: 32px;
|
||||||
|
padding-bottom: 24px;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-title {
|
||||||
|
font-size: var(--text-xl);
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--text-h);
|
||||||
|
letter-spacing: -0.5px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
font-family: var(--sans);
|
||||||
|
font-size: var(--text-xs);
|
||||||
|
font-weight: 300;
|
||||||
|
letter-spacing: 0.06em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
padding: 6px 28px 6px 12px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 6px;
|
||||||
|
background: var(--bg-subtle);
|
||||||
|
color: var(--text);
|
||||||
|
cursor: pointer;
|
||||||
|
appearance: none;
|
||||||
|
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2352525b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: right 10px center;
|
||||||
|
transition: border-color 0.15s, color 0.15s;
|
||||||
|
}
|
||||||
|
select:hover { border-color: var(--border-bright); color: var(--text-h); }
|
||||||
|
select:focus { outline: 1px solid var(--accent-border); outline-offset: 2px; }
|
||||||
|
</style>
|
||||||
166
src/lib/timeline/TimelineView.svelte
Normal file
166
src/lib/timeline/TimelineView.svelte
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
<script>
|
||||||
|
import { get } from 'svelte/store';
|
||||||
|
import { journals } from '../stores/journalStore.js';
|
||||||
|
import TimelineToolbar from './TimelineToolbar.svelte';
|
||||||
|
import TimelineCard from './TimelineCard.svelte';
|
||||||
|
import JournalDetail from './JournalDetail.svelte';
|
||||||
|
import JournalSummary from './JournalSummary.svelte';
|
||||||
|
|
||||||
|
/** @type {import('../stores/journalStore.js').JournalEntry|null} */
|
||||||
|
let selected = $state(null);
|
||||||
|
|
||||||
|
let entries = $state(get(journals));
|
||||||
|
$effect(() => {
|
||||||
|
const unsub = journals.subscribe((v) => { entries = v; });
|
||||||
|
return unsub;
|
||||||
|
});
|
||||||
|
|
||||||
|
let sortKey = $state('date-desc');
|
||||||
|
|
||||||
|
let sortedEntries = $state(/** @type {typeof entries} */([]));
|
||||||
|
$effect(() => {
|
||||||
|
const key = sortKey;
|
||||||
|
sortedEntries = [...entries].sort((a, b) => {
|
||||||
|
if (key === 'date-asc') return a.date.localeCompare(b.date);
|
||||||
|
if (key === 'date-desc') return b.date.localeCompare(a.date);
|
||||||
|
if (key === 'country-asc') return a.location.country.localeCompare(b.location.country) || b.date.localeCompare(a.date);
|
||||||
|
if (key === 'country-desc') return b.location.country.localeCompare(a.location.country) || b.date.localeCompare(a.date);
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function getYear(iso) {
|
||||||
|
return new Date(iso).getFullYear();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="journal-page">
|
||||||
|
|
||||||
|
{#if selected}
|
||||||
|
<div class="detail-scroll">
|
||||||
|
<JournalDetail entry={selected} onBack={() => (selected = null)} />
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<aside class="left-panel">
|
||||||
|
<JournalSummary entries={sortedEntries} />
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<div class="right-panel">
|
||||||
|
<div class="right-inner">
|
||||||
|
<TimelineToolbar {sortKey} onSort={(k) => (sortKey = k)} />
|
||||||
|
|
||||||
|
{#if sortedEntries.length === 0}
|
||||||
|
<p class="empty">No journal entries yet.</p>
|
||||||
|
{:else}
|
||||||
|
<ol class="v-list">
|
||||||
|
{#each sortedEntries as entry, i (entry.id)}
|
||||||
|
{#if i === 0 || getYear(entry.date) !== getYear(sortedEntries[i - 1].date)}
|
||||||
|
<li class="year-marker" aria-hidden="true">
|
||||||
|
<span class="year-label">{getYear(entry.date)}</span>
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
<TimelineCard {entry} onClick={() => (selected = entry)} />
|
||||||
|
{/each}
|
||||||
|
</ol>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
<footer class="page-footer">
|
||||||
|
{sortedEntries.length} {sortedEntries.length === 1 ? 'entry' : 'entries'}
|
||||||
|
</footer>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.journal-page {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
min-width: 0;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Left panel ── */
|
||||||
|
.left-panel {
|
||||||
|
width: 260px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
border-right: 1px solid var(--border);
|
||||||
|
background: var(--bg-raised);
|
||||||
|
padding: 40px 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Right panel ── */
|
||||||
|
.right-panel {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
background: var(--bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inner container with max-width + generous side padding */
|
||||||
|
.right-inner {
|
||||||
|
max-width: 640px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 40px 48px 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Responsive: narrow viewport ── */
|
||||||
|
@media (max-width: 700px) {
|
||||||
|
.journal-page { flex-direction: column; overflow-y: auto; overflow-x: hidden; }
|
||||||
|
.left-panel {
|
||||||
|
width: 100%;
|
||||||
|
border-right: none;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
padding: 24px 20px;
|
||||||
|
}
|
||||||
|
.right-panel { overflow-y: unset; }
|
||||||
|
.right-inner { padding: 24px 20px 60px; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Detail view ── */
|
||||||
|
.detail-scroll {
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
background: var(--bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Timeline list ── */
|
||||||
|
.v-list {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Year marker */
|
||||||
|
.year-marker {
|
||||||
|
padding: 32px 0 16px;
|
||||||
|
}
|
||||||
|
.year-label {
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 400;
|
||||||
|
letter-spacing: 0.12em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: var(--text-sub);
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-footer {
|
||||||
|
margin-top: 56px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 300;
|
||||||
|
letter-spacing: 0.1em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: var(--text-sub);
|
||||||
|
padding-top: 24px;
|
||||||
|
border-top: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty { text-align: center; color: var(--text-sub); padding: 80px 0; }
|
||||||
|
</style>
|
||||||
307
src/lib/world-map/StatsPanel.svelte
Normal file
307
src/lib/world-map/StatsPanel.svelte
Normal file
@@ -0,0 +1,307 @@
|
|||||||
|
<script>
|
||||||
|
import { CONTINENTS, getContinent, continentTotals } from './continents.js';
|
||||||
|
import { getSelected, getTotalCount } from '../layout/selection.svelte.js';
|
||||||
|
|
||||||
|
let collapsed = $state(false);
|
||||||
|
|
||||||
|
const continentColors = {
|
||||||
|
'Europe': '#3b82f6',
|
||||||
|
'Asia': '#ef4444',
|
||||||
|
'Africa': '#f97316',
|
||||||
|
'N. America': '#22c55e',
|
||||||
|
'S. America': '#eab308',
|
||||||
|
'Oceania': '#a855f7'
|
||||||
|
};
|
||||||
|
|
||||||
|
let counts = $derived.by(() => {
|
||||||
|
const c = {};
|
||||||
|
for (const cont of CONTINENTS) c[cont] = 0;
|
||||||
|
for (const id of getSelected()) {
|
||||||
|
const cont = getContinent(id);
|
||||||
|
if (cont) c[cont]++;
|
||||||
|
}
|
||||||
|
return c;
|
||||||
|
});
|
||||||
|
|
||||||
|
let total = $derived(getSelected().size);
|
||||||
|
let grandTotal = $derived(Object.values(continentTotals).reduce((a, b) => a + b, 0));
|
||||||
|
let pct = $derived(grandTotal > 0 ? Math.round(total / grandTotal * 100) : 0);
|
||||||
|
|
||||||
|
let segments = $derived.by(() => {
|
||||||
|
if (total === 0) return [];
|
||||||
|
const segs = [];
|
||||||
|
let deg = 0;
|
||||||
|
for (const cont of CONTINENTS) {
|
||||||
|
const angle = Math.min(counts[cont] / total * 360, 359.99);
|
||||||
|
if (angle > 0) {
|
||||||
|
const startDeg = deg;
|
||||||
|
const endDeg = deg + angle;
|
||||||
|
const midDeg = (startDeg + endDeg) / 2;
|
||||||
|
const rad = (midDeg - 90) * Math.PI / 180;
|
||||||
|
const sr = (startDeg - 90) * Math.PI / 180;
|
||||||
|
const er = (endDeg - 90) * Math.PI / 180;
|
||||||
|
const cx = 90, cy = 90, outerR = 65, innerR = 30;
|
||||||
|
const x1 = cx + outerR * Math.cos(sr);
|
||||||
|
const y1 = cy + outerR * Math.sin(sr);
|
||||||
|
const x2 = cx + outerR * Math.cos(er);
|
||||||
|
const y2 = cy + outerR * Math.sin(er);
|
||||||
|
const x3 = cx + innerR * Math.cos(er);
|
||||||
|
const y3 = cy + innerR * Math.sin(er);
|
||||||
|
const x4 = cx + innerR * Math.cos(sr);
|
||||||
|
const y4 = cy + innerR * Math.sin(sr);
|
||||||
|
const largeArc = angle > 180 ? 1 : 0;
|
||||||
|
const path = `M ${x1} ${y1} A ${outerR} ${outerR} 0 ${largeArc} 1 ${x2} ${y2} L ${x3} ${y3} A ${innerR} ${innerR} 0 ${largeArc} 0 ${x4} ${y4} Z`;
|
||||||
|
const lx = cx + 82 * Math.cos(rad);
|
||||||
|
const ly = cy + 82 * Math.sin(rad);
|
||||||
|
segs.push({ cont, color: continentColors[cont], path, lx, ly, angle });
|
||||||
|
deg += angle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return segs;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="panel" class:collapsed>
|
||||||
|
<button class="collapse-btn" onclick={() => collapsed = !collapsed} data-tip={collapsed ? 'see statistics' : 'close statistics'}>
|
||||||
|
{collapsed ? '◀' : '▶'}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{#if !collapsed}
|
||||||
|
<div class="panel-content">
|
||||||
|
<h2 class="headline">your statistics</h2>
|
||||||
|
|
||||||
|
<span class="bar-label">visited countries</span>
|
||||||
|
<div class="total-bar-wrap">
|
||||||
|
<div class="total-bar-bg">
|
||||||
|
<div class="total-bar-fill" style="width: {pct}%"></div>
|
||||||
|
</div>
|
||||||
|
<span class="total-bar-text">{total} / {grandTotal}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
|
||||||
|
<span class="bar-label">by continent</span>
|
||||||
|
{#each CONTINENTS as continent}
|
||||||
|
{@const contTotal = continentTotals[continent]}
|
||||||
|
<div class="row">
|
||||||
|
<span class="dot" style="background: {continentColors[continent]}"></span>
|
||||||
|
<span class="label">{continent}</span>
|
||||||
|
<span class="value">{counts[continent]}<span class="total">/{contTotal}</span></span>
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
|
||||||
|
<div class="donut-wrap">
|
||||||
|
{#if segments.length > 0}
|
||||||
|
<svg viewBox="0 0 180 180" class="donut-svg">
|
||||||
|
{#each segments as seg}
|
||||||
|
<g class="seg-group">
|
||||||
|
<path d={seg.path} fill={seg.color} />
|
||||||
|
<text x={seg.lx} y={seg.ly} text-anchor="middle" dominant-baseline="middle" class="donut-label" style="font-size: {seg.angle < 20 ? 12 : 15}px">{seg.cont}</text>
|
||||||
|
</g>
|
||||||
|
{/each}
|
||||||
|
<circle cx="90" cy="90" r="30" fill="var(--bg-raised)" />
|
||||||
|
</svg>
|
||||||
|
{:else}
|
||||||
|
<svg viewBox="0 0 180 180" class="donut-svg">
|
||||||
|
<circle cx="90" cy="90" r="65" fill="var(--border)" />
|
||||||
|
<circle cx="90" cy="90" r="30" fill="var(--bg-raised)" />
|
||||||
|
</svg>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
|
||||||
|
<div class="disclaimer">Contains all UN countries, Kosovo, Hong Kong and Taiwan</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.panel {
|
||||||
|
flex: 0 0 min(360px, 25vw);
|
||||||
|
background: var(--bg-raised);
|
||||||
|
border-left: 1px solid var(--border);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
font-family: var(--sans);
|
||||||
|
transition: flex-basis 0.25s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel.collapsed {
|
||||||
|
flex: 0 0 28px;
|
||||||
|
border-left: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel-content {
|
||||||
|
flex: 1;
|
||||||
|
padding: 24px 28px;
|
||||||
|
overflow-y: auto;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse-btn {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
align-self: flex-start;
|
||||||
|
background: var(--accent-bg);
|
||||||
|
border: none;
|
||||||
|
border-radius: 0 8px 8px 0;
|
||||||
|
padding: 14px 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1;
|
||||||
|
color: var(--accent);
|
||||||
|
transition: background 0.15s ease, padding 0.15s ease;
|
||||||
|
margin-top: 24px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse-btn:hover {
|
||||||
|
background: var(--lavender-bg);
|
||||||
|
padding-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse-btn::after {
|
||||||
|
content: attr(data-tip);
|
||||||
|
position: absolute;
|
||||||
|
right: calc(100% + 8px);
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
background: var(--text-h);
|
||||||
|
color: var(--bg-raised);
|
||||||
|
font-family: var(--sans);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 300;
|
||||||
|
padding: 6px 12px;
|
||||||
|
border-radius: 6px;
|
||||||
|
white-space: nowrap;
|
||||||
|
pointer-events: none;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapse-btn:hover::after {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headline {
|
||||||
|
font-family: var(--heading);
|
||||||
|
font-size: var(--text-sm);
|
||||||
|
font-weight: 400;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.1em;
|
||||||
|
color: var(--accent);
|
||||||
|
margin: 0 0 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bar-label {
|
||||||
|
font-family: var(--sans);
|
||||||
|
font-size: var(--text-xs);
|
||||||
|
font-weight: 400;
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.08em;
|
||||||
|
color: var(--text-sub);
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-bar-wrap {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-bar-bg {
|
||||||
|
flex: 1;
|
||||||
|
height: 18px;
|
||||||
|
background: var(--accent-bg);
|
||||||
|
border-radius: 10px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-bar-fill {
|
||||||
|
height: 100%;
|
||||||
|
background: linear-gradient(90deg, var(--accent-dark), var(--lavender));
|
||||||
|
border-radius: 10px;
|
||||||
|
transition: width 0.3s ease;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-bar-text {
|
||||||
|
font-size: var(--text-sm);
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--text-h);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divider {
|
||||||
|
height: 1px;
|
||||||
|
background: var(--border);
|
||||||
|
margin: 16px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 6px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
border-radius: 50%;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
flex: 1;
|
||||||
|
font-size: var(--text-sm);
|
||||||
|
font-weight: 300;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.value {
|
||||||
|
font-size: var(--text-sm);
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--text-h);
|
||||||
|
}
|
||||||
|
|
||||||
|
.total {
|
||||||
|
font-weight: 400;
|
||||||
|
color: var(--text-sub);
|
||||||
|
font-size: var(--text-xs);
|
||||||
|
}
|
||||||
|
|
||||||
|
.donut-wrap {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.donut-svg {
|
||||||
|
width: 160px;
|
||||||
|
height: 160px;
|
||||||
|
filter: drop-shadow(0 2px 8px rgba(99,102,241,0.15));
|
||||||
|
}
|
||||||
|
|
||||||
|
.donut-label {
|
||||||
|
fill: var(--text-h);
|
||||||
|
font-family: var(--sans);
|
||||||
|
font-weight: 300;
|
||||||
|
pointer-events: none;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.seg-group:hover .donut-label {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.disclaimer {
|
||||||
|
font-size: var(--text-xs);
|
||||||
|
color: var(--text-sub);
|
||||||
|
line-height: 1.5;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
159
src/lib/world-map/WorldMap.svelte
Normal file
159
src/lib/world-map/WorldMap.svelte
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
<script>
|
||||||
|
import { onMount } from 'svelte';
|
||||||
|
import * as d3 from 'd3';
|
||||||
|
import { feature } from 'topojson-client';
|
||||||
|
import worldData from 'world-atlas/countries-50m.json';
|
||||||
|
import { getSelected, toggle, setTotalCount } from '../layout/selection.svelte.js';
|
||||||
|
|
||||||
|
const TERRITORY_PARENT = {
|
||||||
|
'016': '840', '060': '826', '086': '826', '092': '826', '136': '826',
|
||||||
|
'184': '554', '234': '208', '238': '826', '239': '826', '248': '246',
|
||||||
|
'258': '250', '260': '250', '304': '208', '316': '840', '334': '036',
|
||||||
|
'446': '156', '500': '826', '531': '528', '533': '528', '534': '528',
|
||||||
|
'540': '250', '570': '554', '574': '036', '580': '840', '612': '826',
|
||||||
|
'630': '840', '652': '250', '654': '826', '660': '826', '663': '250',
|
||||||
|
'666': '250', '796': '826', '831': '826', '832': '826', '833': '826',
|
||||||
|
'850': '840', '876': '250',
|
||||||
|
};
|
||||||
|
|
||||||
|
function effId(d) {
|
||||||
|
return TERRITORY_PARENT[d.id] || d.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
let frameEl;
|
||||||
|
|
||||||
|
function fitProjection(proj, w, h) {
|
||||||
|
proj.fitSize([w, h], { type: 'Sphere' });
|
||||||
|
const s = proj.scale() * 1.5;
|
||||||
|
proj.scale(s).translate([w / 2, h * 0.70]);
|
||||||
|
}
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
const width = frameEl.clientWidth;
|
||||||
|
const height = frameEl.clientHeight;
|
||||||
|
|
||||||
|
const projection = d3.geoMercator();
|
||||||
|
fitProjection(projection, width, height);
|
||||||
|
|
||||||
|
const path = d3.geoPath().projection(projection);
|
||||||
|
|
||||||
|
const countries = feature(worldData, worldData.objects.countries)
|
||||||
|
.features.filter(f => (f.id || f.properties.name === 'Kosovo') && f.id !== '010');
|
||||||
|
|
||||||
|
countries.forEach(f => { if (!f.id) f.id = 'XK'; });
|
||||||
|
|
||||||
|
const sovereignIds = new Set(countries.map(f => effId(f)));
|
||||||
|
setTotalCount(sovereignIds.size);
|
||||||
|
|
||||||
|
const svg = d3.select(frameEl).append('svg').attr('width', width).attr('height', height);
|
||||||
|
const g = svg.append('g');
|
||||||
|
|
||||||
|
const tooltip = d3.select(frameEl).append('div').attr('class', 'tooltip').style('display', 'none');
|
||||||
|
|
||||||
|
function updateFill(sel) {
|
||||||
|
sel.attr('fill', d => getSelected().has(effId(d)) ? '#22c55e' : '#ffffff');
|
||||||
|
g.selectAll('.micro-state').attr('fill', d => getSelected().has(effId(d)) ? '#22c55e' : '#ffffff');
|
||||||
|
}
|
||||||
|
|
||||||
|
function attachEvents(sel) {
|
||||||
|
sel
|
||||||
|
.on('click', (event, d) => {
|
||||||
|
toggle(effId(d));
|
||||||
|
updateFill(d3.select(event.currentTarget));
|
||||||
|
})
|
||||||
|
.on('mouseenter', (event, d) => {
|
||||||
|
d3.select(event.currentTarget).attr('fill', getSelected().has(effId(d)) ? '#16a34a' : '#f0f6fa');
|
||||||
|
tooltip.style('display', 'block').text(d.properties.name);
|
||||||
|
})
|
||||||
|
.on('mousemove', (event) => {
|
||||||
|
const [x, y] = d3.pointer(event, frameEl);
|
||||||
|
tooltip.style('left', (x + 10) + 'px').style('top', (y - 28) + 'px');
|
||||||
|
})
|
||||||
|
.on('mouseleave', (event, d) => {
|
||||||
|
d3.select(event.currentTarget).attr('fill', getSelected().has(effId(d)) ? '#22c55e' : '#ffffff');
|
||||||
|
tooltip.style('display', 'none');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const paths = g.selectAll('path').data(countries).join('path')
|
||||||
|
.attr('d', path).attr('fill', '#ffffff').attr('stroke', '#d4d4d4').attr('stroke-width', 0.5);
|
||||||
|
attachEvents(paths);
|
||||||
|
|
||||||
|
function renderMicrostates() {
|
||||||
|
g.selectAll('.micro-state').remove();
|
||||||
|
const threshold = Math.max(4, 16 / d3.zoomTransform(svg.node()).k);
|
||||||
|
paths.each(function (d) {
|
||||||
|
if (effId(d) !== d.id) return;
|
||||||
|
const { width, height } = this.getBBox();
|
||||||
|
if (width < threshold && height < threshold) {
|
||||||
|
const [cx, cy] = path.centroid(d);
|
||||||
|
const c = g.append('circle').attr('class', 'micro-state').datum(d)
|
||||||
|
.attr('cx', cx).attr('cy', cy).attr('r', 2)
|
||||||
|
.attr('fill', getSelected().has(effId(d)) ? '#22c55e' : '#ffffff')
|
||||||
|
.attr('stroke', '#94a3b8').attr('stroke-width', 0.5);
|
||||||
|
attachEvents(c);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
renderMicrostates();
|
||||||
|
|
||||||
|
const zoom = d3.zoom().scaleExtent([1, 32]).on('zoom', (event) => {
|
||||||
|
g.attr('transform', event.transform);
|
||||||
|
renderMicrostates();
|
||||||
|
});
|
||||||
|
|
||||||
|
svg.call(zoom);
|
||||||
|
svg.on('dblclick.zoom', null);
|
||||||
|
svg.on('dblclick', (event) => {
|
||||||
|
const [x, y] = d3.pointer(event);
|
||||||
|
svg.transition().duration(300).call(zoom.scaleBy, 2, [x, y]);
|
||||||
|
});
|
||||||
|
|
||||||
|
const observer = new ResizeObserver((entries) => {
|
||||||
|
for (const entry of entries) {
|
||||||
|
const { width, height } = entry.contentRect;
|
||||||
|
svg.attr('width', width).attr('height', height);
|
||||||
|
fitProjection(projection, width, height);
|
||||||
|
const countryPaths = g.selectAll('path');
|
||||||
|
countryPaths.attr('d', path);
|
||||||
|
updateFill(countryPaths);
|
||||||
|
renderMicrostates();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
observer.observe(frameEl);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
observer.disconnect();
|
||||||
|
svg.remove();
|
||||||
|
};
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div bind:this={frameEl} class="map-frame"></div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.map-frame {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
background: #a4c8e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map-frame :global(svg) { display: block; cursor: grab; }
|
||||||
|
.map-frame :global(svg:active) { cursor: grabbing; }
|
||||||
|
.map-frame :global(svg path) { cursor: pointer; }
|
||||||
|
|
||||||
|
.map-frame :global(.tooltip) {
|
||||||
|
position: absolute;
|
||||||
|
padding: 4px 10px;
|
||||||
|
background: #1f2937;
|
||||||
|
color: #fff;
|
||||||
|
font: 14px/1.4 sans-serif;
|
||||||
|
border-radius: 4px;
|
||||||
|
pointer-events: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
212
src/lib/world-map/continents.js
Normal file
212
src/lib/world-map/continents.js
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
export const CONTINENTS = ['Europe', 'Asia', 'Africa', 'N. America', 'S. America', 'Oceania'];
|
||||||
|
|
||||||
|
const map = {
|
||||||
|
'004': 'Asia', // Afghanistan
|
||||||
|
'008': 'Europe', // Albania
|
||||||
|
'012': 'Africa', // Algeria
|
||||||
|
'020': 'Europe', // Andorra
|
||||||
|
'024': 'Africa', // Angola
|
||||||
|
'028': 'N. America', // Antigua and Barb.
|
||||||
|
'031': 'Asia', // Azerbaijan
|
||||||
|
'032': 'S. America', // Argentina
|
||||||
|
'036': 'Oceania', // Australia
|
||||||
|
'040': 'Europe', // Austria
|
||||||
|
'044': 'N. America', // Bahamas
|
||||||
|
'048': 'Asia', // Bahrain
|
||||||
|
'050': 'Asia', // Bangladesh
|
||||||
|
'051': 'Asia', // Armenia
|
||||||
|
'052': 'N. America', // Barbados
|
||||||
|
'056': 'Europe', // Belgium
|
||||||
|
'064': 'Asia', // Bhutan
|
||||||
|
'068': 'S. America', // Bolivia
|
||||||
|
'070': 'Europe', // Bosnia and Herz.
|
||||||
|
'072': 'Africa', // Botswana
|
||||||
|
'076': 'S. America', // Brazil
|
||||||
|
'084': 'N. America', // Belize
|
||||||
|
'090': 'Oceania', // Solomon Is.
|
||||||
|
'096': 'Asia', // Brunei
|
||||||
|
'100': 'Europe', // Bulgaria
|
||||||
|
'104': 'Asia', // Myanmar
|
||||||
|
'108': 'Africa', // Burundi
|
||||||
|
'112': 'Europe', // Belarus
|
||||||
|
'116': 'Asia', // Cambodia
|
||||||
|
'120': 'Africa', // Cameroon
|
||||||
|
'124': 'N. America', // Canada
|
||||||
|
'132': 'Africa', // Cabo Verde
|
||||||
|
'140': 'Africa', // Central African Rep.
|
||||||
|
'144': 'Asia', // Sri Lanka
|
||||||
|
'148': 'Africa', // Chad
|
||||||
|
'152': 'S. America', // Chile
|
||||||
|
'156': 'Asia', // China
|
||||||
|
'158': 'Asia', // Taiwan
|
||||||
|
'170': 'S. America', // Colombia
|
||||||
|
'174': 'Africa', // Comoros
|
||||||
|
'178': 'Africa', // Congo
|
||||||
|
'180': 'Africa', // Dem. Rep. Congo
|
||||||
|
'188': 'N. America', // Costa Rica
|
||||||
|
'191': 'Europe', // Croatia
|
||||||
|
'192': 'N. America', // Cuba
|
||||||
|
'196': 'Asia', // Cyprus
|
||||||
|
'203': 'Europe', // Czechia
|
||||||
|
'204': 'Africa', // Benin
|
||||||
|
'208': 'Europe', // Denmark
|
||||||
|
'212': 'N. America', // Dominica
|
||||||
|
'214': 'N. America', // Dominican Rep.
|
||||||
|
'218': 'S. America', // Ecuador
|
||||||
|
'222': 'N. America', // El Salvador
|
||||||
|
'226': 'Africa', // Eq. Guinea
|
||||||
|
'231': 'Africa', // Ethiopia
|
||||||
|
'232': 'Africa', // Eritrea
|
||||||
|
'233': 'Europe', // Estonia
|
||||||
|
'242': 'Oceania', // Fiji
|
||||||
|
'246': 'Europe', // Finland
|
||||||
|
'250': 'Europe', // France
|
||||||
|
'262': 'Africa', // Djibouti
|
||||||
|
'266': 'Africa', // Gabon
|
||||||
|
'268': 'Asia', // Georgia
|
||||||
|
'270': 'Africa', // Gambia
|
||||||
|
'275': 'Asia', // Palestine
|
||||||
|
'276': 'Europe', // Germany
|
||||||
|
'288': 'Africa', // Ghana
|
||||||
|
'296': 'Oceania', // Kiribati
|
||||||
|
'300': 'Europe', // Greece
|
||||||
|
'308': 'N. America', // Grenada
|
||||||
|
'320': 'N. America', // Guatemala
|
||||||
|
'324': 'Africa', // Guinea
|
||||||
|
'328': 'S. America', // Guyana
|
||||||
|
'332': 'N. America', // Haiti
|
||||||
|
'336': 'Europe', // Vatican
|
||||||
|
'340': 'N. America', // Honduras
|
||||||
|
'344': 'Asia', // Hong Kong
|
||||||
|
'348': 'Europe', // Hungary
|
||||||
|
'352': 'Europe', // Iceland
|
||||||
|
'356': 'Asia', // India
|
||||||
|
'360': 'Asia', // Indonesia
|
||||||
|
'364': 'Asia', // Iran
|
||||||
|
'368': 'Asia', // Iraq
|
||||||
|
'372': 'Europe', // Ireland
|
||||||
|
'376': 'Asia', // Israel
|
||||||
|
'380': 'Europe', // Italy
|
||||||
|
'384': 'Africa', // Cote d'Ivoire
|
||||||
|
'388': 'N. America', // Jamaica
|
||||||
|
'392': 'Asia', // Japan
|
||||||
|
'398': 'Asia', // Kazakhstan
|
||||||
|
'400': 'Asia', // Jordan
|
||||||
|
'404': 'Africa', // Kenya
|
||||||
|
'408': 'Asia', // North Korea
|
||||||
|
'410': 'Asia', // South Korea
|
||||||
|
'414': 'Asia', // Kuwait
|
||||||
|
'417': 'Asia', // Kyrgyzstan
|
||||||
|
'418': 'Asia', // Laos
|
||||||
|
'422': 'Asia', // Lebanon
|
||||||
|
'426': 'Africa', // Lesotho
|
||||||
|
'428': 'Europe', // Latvia
|
||||||
|
'430': 'Africa', // Liberia
|
||||||
|
'434': 'Africa', // Libya
|
||||||
|
'438': 'Europe', // Liechtenstein
|
||||||
|
'440': 'Europe', // Lithuania
|
||||||
|
'442': 'Europe', // Luxembourg
|
||||||
|
'450': 'Africa', // Madagascar
|
||||||
|
'454': 'Africa', // Malawi
|
||||||
|
'458': 'Asia', // Malaysia
|
||||||
|
'462': 'Asia', // Maldives
|
||||||
|
'466': 'Africa', // Mali
|
||||||
|
'470': 'Europe', // Malta
|
||||||
|
'478': 'Africa', // Mauritania
|
||||||
|
'480': 'Africa', // Mauritius
|
||||||
|
'484': 'N. America', // Mexico
|
||||||
|
'492': 'Europe', // Monaco
|
||||||
|
'496': 'Asia', // Mongolia
|
||||||
|
'498': 'Europe', // Moldova
|
||||||
|
'499': 'Europe', // Montenegro
|
||||||
|
'504': 'Africa', // Morocco
|
||||||
|
'508': 'Africa', // Mozambique
|
||||||
|
'512': 'Asia', // Oman
|
||||||
|
'516': 'Africa', // Namibia
|
||||||
|
'520': 'Oceania', // Nauru
|
||||||
|
'524': 'Asia', // Nepal
|
||||||
|
'528': 'Europe', // Netherlands
|
||||||
|
'548': 'Oceania', // Vanuatu
|
||||||
|
'554': 'Oceania', // New Zealand
|
||||||
|
'558': 'N. America', // Nicaragua
|
||||||
|
'562': 'Africa', // Niger
|
||||||
|
'566': 'Africa', // Nigeria
|
||||||
|
'578': 'Europe', // Norway
|
||||||
|
'583': 'Oceania', // Micronesia
|
||||||
|
'584': 'Oceania', // Marshall Is.
|
||||||
|
'585': 'Oceania', // Palau
|
||||||
|
'586': 'Asia', // Pakistan
|
||||||
|
'591': 'N. America', // Panama
|
||||||
|
'598': 'Oceania', // Papua New Guinea
|
||||||
|
'600': 'S. America', // Paraguay
|
||||||
|
'604': 'S. America', // Peru
|
||||||
|
'608': 'Asia', // Philippines
|
||||||
|
'616': 'Europe', // Poland
|
||||||
|
'620': 'Europe', // Portugal
|
||||||
|
'624': 'Africa', // Guinea-Bissau
|
||||||
|
'626': 'Asia', // Timor-Leste
|
||||||
|
'634': 'Asia', // Qatar
|
||||||
|
'642': 'Europe', // Romania
|
||||||
|
'643': 'Europe', // Russia
|
||||||
|
'646': 'Africa', // Rwanda
|
||||||
|
'659': 'N. America', // St. Kitts and Nevis
|
||||||
|
'662': 'N. America', // Saint Lucia
|
||||||
|
'670': 'N. America', // St. Vin. and Gren.
|
||||||
|
'674': 'Europe', // San Marino
|
||||||
|
'678': 'Africa', // Sao Tome and Principe
|
||||||
|
'682': 'Asia', // Saudi Arabia
|
||||||
|
'686': 'Africa', // Senegal
|
||||||
|
'688': 'Europe', // Serbia
|
||||||
|
'690': 'Africa', // Seychelles
|
||||||
|
'694': 'Africa', // Sierra Leone
|
||||||
|
'702': 'Asia', // Singapore
|
||||||
|
'703': 'Europe', // Slovakia
|
||||||
|
'704': 'Asia', // Vietnam
|
||||||
|
'705': 'Europe', // Slovenia
|
||||||
|
'706': 'Africa', // Somalia
|
||||||
|
'710': 'Africa', // South Africa
|
||||||
|
'716': 'Africa', // Zimbabwe
|
||||||
|
'724': 'Europe', // Spain
|
||||||
|
'728': 'Africa', // S. Sudan
|
||||||
|
'729': 'Africa', // Sudan
|
||||||
|
'732': 'Africa', // W. Sahara
|
||||||
|
'740': 'S. America', // Suriname
|
||||||
|
'748': 'Africa', // eSwatini
|
||||||
|
'752': 'Europe', // Sweden
|
||||||
|
'756': 'Europe', // Switzerland
|
||||||
|
'760': 'Asia', // Syria
|
||||||
|
'762': 'Asia', // Tajikistan
|
||||||
|
'764': 'Asia', // Thailand
|
||||||
|
'768': 'Africa', // Togo
|
||||||
|
'776': 'Oceania', // Tonga
|
||||||
|
'780': 'N. America', // Trinidad and Tobago
|
||||||
|
'784': 'Asia', // United Arab Emirates
|
||||||
|
'788': 'Africa', // Tunisia
|
||||||
|
'792': 'Asia', // Turkey
|
||||||
|
'795': 'Asia', // Turkmenistan
|
||||||
|
'800': 'Africa', // Uganda
|
||||||
|
'804': 'Europe', // Ukraine
|
||||||
|
'807': 'Europe', // Macedonia
|
||||||
|
'818': 'Africa', // Egypt
|
||||||
|
'826': 'Europe', // United Kingdom
|
||||||
|
'834': 'Africa', // Tanzania
|
||||||
|
'840': 'N. America', // United States of America
|
||||||
|
'854': 'Africa', // Burkina Faso
|
||||||
|
'858': 'S. America', // Uruguay
|
||||||
|
'860': 'Asia', // Uzbekistan
|
||||||
|
'862': 'S. America', // Venezuela
|
||||||
|
'882': 'Oceania', // Samoa
|
||||||
|
'887': 'Asia', // Yemen
|
||||||
|
'894': 'Africa', // Zambia
|
||||||
|
'XK': 'Europe', // Kosovo
|
||||||
|
};
|
||||||
|
|
||||||
|
export const continentTotals = CONTINENTS.reduce((acc, c) => (acc[c] = 0, acc), {});
|
||||||
|
for (const id of Object.keys(map)) {
|
||||||
|
const cont = map[id];
|
||||||
|
if (cont) continentTotals[cont]++;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getContinent(id) {
|
||||||
|
return map[id] ?? null;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user