+
{#if countryScale}
@@ -196,8 +417,20 @@
.country-map-section {
background: var(--color-card);
border-radius: 12px;
- padding: 1rem;
+ /* allow the section to fill parent's height so the svg can scale */
+ padding: 0.5rem;
box-shadow: 0 2px 8px 2px rgba(0, 0, 0, 0.08);
+ height: 100%;
+ display: flex;
+ align-items: stretch;
+ }
+
+ /* inner wrapper that holds the InlineSvg should fill available space */
+ .svg-wrapper-inner {
+ width: 100%;
+ height: 100%;
+ position: relative;
+ cursor: grab;
}
.map-controls-on-map {
diff --git a/src/components/Header.svelte b/src/components/Header.svelte
index b2968f6..b53707d 100644
--- a/src/components/Header.svelte
+++ b/src/components/Header.svelte
@@ -49,7 +49,12 @@
// Check if we're in game mode
$: isGameMode = $location && $location.startsWith('/game');
- $: isQuizPage = $location && ($location.startsWith('/game/flags') || $location.startsWith('/game/capitals'));
+ // Treat known quiz routes as quiz pages so the header shows quiz stats/achievements
+ $: isQuizPage = $location && (
+ $location.startsWith('/game/flags') ||
+ $location.startsWith('/game/capitals') ||
+ $location.startsWith('/game/geography')
+ );
// Determine default stats view based on quiz state
$: {
diff --git a/src/components/InlineSvg.svelte b/src/components/InlineSvg.svelte
index 5a41162..ba15abf 100644
--- a/src/components/InlineSvg.svelte
+++ b/src/components/InlineSvg.svelte
@@ -27,24 +27,24 @@
const svg = doc.documentElement;
// Fix SVG dimensions here too
- const viewBox = svg.getAttribute('viewBox');
+ const viewBox = svg.getAttribute("viewBox");
if (viewBox) {
// Remove any existing style and dimension attributes
- svg.removeAttribute('style');
- svg.removeAttribute('width');
- svg.removeAttribute('height');
+ svg.removeAttribute("style");
+ svg.removeAttribute("width");
+ svg.removeAttribute("height");
// Set percentage dimensions to allow scaling
- svg.setAttribute('width', '100%');
- svg.setAttribute('height', '100%');
+ svg.setAttribute("width", "100%");
+ svg.setAttribute("height", "100%");
// svg.setAttribute('preserveAspectRatio', 'none');
// Ensure viewBox is preserved for proper clipping
- svg.setAttribute('viewBox', viewBox);
+ svg.setAttribute("viewBox", viewBox);
} else {
- svg.removeAttribute('style');
- svg.setAttribute('width', '100%');
- svg.setAttribute('height', '100%');
+ svg.removeAttribute("style");
+ svg.setAttribute("width", "100%");
+ svg.setAttribute("height", "100%");
}
// Set currentColor on SVG element if no fill is specified
@@ -64,33 +64,33 @@
const svg = doc.documentElement;
// Fix SVG dimensions based on viewBox
- const viewBox = svg.getAttribute('viewBox');
+ const viewBox = svg.getAttribute("viewBox");
if (viewBox) {
// Remove any existing style attribute and fixed dimensions
- svg.removeAttribute('style');
- svg.removeAttribute('width');
- svg.removeAttribute('height');
+ svg.removeAttribute("style");
+ svg.removeAttribute("width");
+ svg.removeAttribute("height");
// Set percentage dimensions to allow scaling
- svg.setAttribute('width', '100%');
- svg.setAttribute('height', '100%');
+ svg.setAttribute("width", "100%");
+ svg.setAttribute("height", "100%");
// Ensure viewBox is preserved for proper clipping
- svg.setAttribute('viewBox', viewBox);
+ svg.setAttribute("viewBox", viewBox);
// Add preserveAspectRatio to ensure proper scaling
- if (!svg.hasAttribute('preserveAspectRatio')) {
- svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
+ if (!svg.hasAttribute("preserveAspectRatio")) {
+ svg.setAttribute("preserveAspectRatio", "xMidYMid meet");
}
} else {
// If no viewBox, remove style and set percentage dimensions
- svg.removeAttribute('style');
- svg.setAttribute('width', '100%');
- svg.setAttribute('height', '100%');
+ svg.removeAttribute("style");
+ svg.setAttribute("width", "100%");
+ svg.setAttribute("height", "100%");
}
// Ensure proper overflow handling
- svg.setAttribute('overflow', 'visible'); // Let CSS handle the clipping
+ svg.setAttribute("overflow", "visible"); // Let CSS handle the clipping
// Now process color changes
// 1. Parse