From 6cdb545f1fd0fbe8d86661f43be71bed480a7fb6 Mon Sep 17 00:00:00 2001 From: Jake Walker Date: Sat, 25 Jan 2025 16:11:07 +0000 Subject: [PATCH 1/4] add live map --- _includes/livemap.html | 84 ++++++++++++++++++++++++++++++++++++++++++ _sass/_style.scss | 8 ++++ pages/index.html | 7 ++++ 3 files changed, 99 insertions(+) create mode 100644 _includes/livemap.html diff --git a/_includes/livemap.html b/_includes/livemap.html new file mode 100644 index 0000000..5c006ac --- /dev/null +++ b/_includes/livemap.html @@ -0,0 +1,84 @@ +

+ Loading... +

+
+
+ + diff --git a/_sass/_style.scss b/_sass/_style.scss index f5a72a5..2414e2f 100644 --- a/_sass/_style.scss +++ b/_sass/_style.scss @@ -368,3 +368,11 @@ ol { } } } + +.tooltip { + position: absolute; + background: var(--background-light); + color: var(--foreground); + padding: 5px; + display: none; +} diff --git a/pages/index.html b/pages/index.html index a96ac9d..f5bbb9a 100644 --- a/pages/index.html +++ b/pages/index.html @@ -11,6 +11,13 @@ An online event where you can meet friends and work on something new

+
+
+

Live Map

+ {% include livemap.html %} +
+
+

Next event

From 8b29c6b98cb83e56009a5d1b8d775e23a10eab7a Mon Sep 17 00:00:00 2001 From: Jake Walker Date: Tue, 4 Feb 2025 19:41:40 +0000 Subject: [PATCH 2/4] add live map api to config --- _config.yml | 5 ++--- _includes/livemap.html | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_config.yml b/_config.yml index a00db2a..fb685f7 100644 --- a/_config.yml +++ b/_config.yml @@ -6,14 +6,13 @@ description: >- # this means to ignore newlines until "baseurl:" baseurl: "/" # the subpath of your site, e.g. /blog url: "https://remotehack.space" # the base hostname & protocol for your site, e.g. http://example.com discord_invite_url: https://discord.gg/wNq8uVvQT3 - - +live_map_api: https://remotehack-livemap-api.jakew.workers.dev # Build settings plugins: - jekyll-redirect-from - jekyll-sitemap - + timezone: Europe/London # To ensure that events in the future generate their html pages diff --git a/_includes/livemap.html b/_includes/livemap.html index 5c006ac..ad137ec 100644 --- a/_includes/livemap.html +++ b/_includes/livemap.html @@ -3,6 +3,7 @@

+

Join the Discord to add yourself to the map

From 7a6dc7cc6bd5f3f4fab4bf1a834215f259126785 Mon Sep 17 00:00:00 2001 From: Jake Walker Date: Sat, 28 Feb 2026 14:55:46 +0000 Subject: [PATCH 4/4] list names above live map --- _includes/livemap.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/_includes/livemap.html b/_includes/livemap.html index 7a83455..ef9575a 100644 --- a/_includes/livemap.html +++ b/_includes/livemap.html @@ -14,6 +14,12 @@ const width = 640; const height = 400; + const prettyJoin = (strings) => { + if (strings.length < 1) return strings; + const last = strings.pop(); + return `${strings.join(", ")} and ${last}`; + }; + // create a new svg for d3.js to draw on const svg = d3.create("svg").attr("width", width).attr("height", height); container.append(svg.node()); @@ -41,7 +47,7 @@ .filter((name) => name !== null); // update map text - text.innerText = `${pointData.features.length} hackers online!`; + text.innerText = `${pointData.features.length} hackers online: ${prettyJoin(nameList)}`; // get the bounds of locations (min & max coordinates) const bounds = d3.geoBounds(pointData);