From 7933a9af2ddf78ea35a314deb1c8a89b6f9360a2 Mon Sep 17 00:00:00 2001 From: Daschi <50054971+Daschi1@users.noreply.github.com> Date: Tue, 11 Feb 2025 22:55:51 +0100 Subject: [PATCH 1/4] style: add newline for improved readability --- static/robots.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/static/robots.txt b/static/robots.txt index 36122f3..7cf1390 100644 --- a/static/robots.txt +++ b/static/robots.txt @@ -1,3 +1,4 @@ User-agent: * Disallow: + Sitemap: https://green-hell-maps.daschi.dev/sitemap.xml From 7088516f3d8cca8ca493bac64ad84db2d35daa6f Mon Sep 17 00:00:00 2001 From: Daschi <50054971+Daschi1@users.noreply.github.com> Date: Sun, 7 Sep 2025 00:15:36 +0200 Subject: [PATCH 2/4] feat: add analytics event for coordinate toggle actions --- src/lib/Coordinate.svelte | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/lib/Coordinate.svelte b/src/lib/Coordinate.svelte index 7854011..c307595 100644 --- a/src/lib/Coordinate.svelte +++ b/src/lib/Coordinate.svelte @@ -19,20 +19,42 @@ let opacity = $derived(visible ? $coordinateOverlayOpacity : 0); function toggleClicked() { + let nextClicked: boolean | undefined; + let nextCount: number | undefined; + clickedCoordinates.update((coordinates) => { // assign array if empty if (!coordinates) coordinates = []; - if (!coordinates.includes(coordinate)) { + const exists = coordinates.includes(coordinate); + if (!exists) { // add coordinate if they don't exist coordinates = [...coordinates, coordinate]; } else { // remove coordinate if they exist coordinates = coordinates.filter((c) => c !== coordinate); } + nextClicked = !exists; + nextCount = coordinates.length; // null array if empty if (coordinates.length === 0) coordinates = null; return coordinates; }); + + // Send analytics event (safe for SSR and missing script) + if (typeof window !== "undefined" && (window as any).stonks?.event) { + try { + (window as any).stonks.event("Coordinate Toggle", { + coordinate_id: String(coordinate), + west_deg: String(west), + south_deg: String(south), + selected: String(Boolean(nextClicked)), + action: nextClicked ? "enable" : "disable", + selected_count: String(nextCount ?? 0) + }); + } catch { + // no-op + } + } } From ba91cdaed3754dba4d54e55af9c0d8aaa71d750d Mon Sep 17 00:00:00 2001 From: Daschi <50054971+Daschi1@users.noreply.github.com> Date: Sun, 7 Sep 2025 00:16:18 +0200 Subject: [PATCH 3/4] fix: remove redundant script tag ID attribute --- src/app.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app.html b/src/app.html index 4e802e2..3c0215d 100644 --- a/src/app.html +++ b/src/app.html @@ -5,7 +5,7 @@ - + Date: Sun, 7 Sep 2025 00:20:01 +0200 Subject: [PATCH 4/4] chore: bump version to 1.6.0 --- package.json | 2 +- static/licenses.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 54126f0..07d377c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "green-hell-maps", - "version": "1.5.0", + "version": "1.6.0", "description": "Green Hell interactive maps", "repository": "https://github.com/Daschi1/green-hell-maps", "author": "Daschi", diff --git a/static/licenses.json b/static/licenses.json index 024e62b..42fac01 100644 --- a/static/licenses.json +++ b/static/licenses.json @@ -120,12 +120,12 @@ "description": "Global identifiers from different JavaScript environments", "copyright": "Copyright (c) Sindre Sorhus (https://sindresorhus.com)" }, - "green-hell-maps@1.2.0": { + "green-hell-maps@1.6.0": { "licenses": "Custom: https://green-hell-maps.daschi.dev/", "repository": "https://github.com/Daschi1/green-hell-maps", "publisher": "Daschi", "name": "green-hell-maps", - "version": "1.2.0", + "version": "1.6.0", "description": "Green Hell interactive maps" }, "license-checker@25.0.1": {