updates server list

This commit is contained in:
Christian Beutel
2025-07-10 18:52:21 +02:00
parent d21df88be2
commit 7cfca84ee3
5 changed files with 57 additions and 29 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View File

@@ -4,26 +4,44 @@
"url": "https://demo.wanderer.to", "url": "https://demo.wanderer.to",
"description": "A public demo instance of wanderer. Everyone can log in and try out all features—upload trails, create lists, explore the interface, and test federation. Data is reset periodically, so feel free to experiment.", "description": "A public demo instance of wanderer. Everyone can log in and try out all features—upload trails, create lists, explore the interface, and test federation. Data is reset periodically, so feel free to experiment.",
"image": "/server/imgs/wanderer.to.png", "image": "/server/imgs/wanderer.to.png",
"region": "World", "region": ["World"],
"language": "English", "language": ["English"],
"category": "General" "category": ["General"]
}, },
{ {
"name": "..:: tchncs :: wanderer ::..", "name": "..:: tchncs :: wanderer ::..",
"url": "https://trails.tchncs.de", "url": "https://trails.tchncs.de",
"description": "General purpose instance by tchncs.de, not bound to a specific area. It is supported by voluntary donations from users of tchncs.", "description": "General purpose instance by tchncs.de, not bound to a specific area. It is supported by voluntary donations from users of tchncs.",
"image": "/server/imgs/tchncs.de.png", "image": "/server/imgs/tchncs.de.png",
"region": "Germany", "region": ["Germany"],
"language": "German, English", "language":[ "German", "English"],
"category": "General Outdoor" "category": ["General"]
}, },
{ {
"name": "Trails by Softwerke Magdeburg", "name": "Trails by Softwerke Magdeburg",
"url": "https://trails.magdeburg.jetzt", "url": "https://trails.magdeburg.jetzt",
"description": "Find and share cool places & tours near Magdeburg & Saxony-Anhalt on this public instance. It is run by Softwerke Magdeburg, a non-profit association that's locally providing various free & open services to the public.", "description": "Find and share cool places & tours near Magdeburg & Saxony-Anhalt on this public instance. It is run by Softwerke Magdeburg, a non-profit association that's locally providing various free & open services to the public.",
"image": "/server/imgs/magdeburg.jetzt.png", "image": "/server/imgs/magdeburg.jetzt.png",
"region": "Magdeburg & Saxony-Anhalt", "region": ["Germany", "Magdeburg", "Saxony-Anhalt"],
"language": "German", "language": ["German"],
"category": "General Outdoor" "category": ["General"]
},
{
"name": "Further Heights",
"url": "https://furtherheights.com",
"description": "An instance for those wanting to map trails and joining a community in the Pacific Northwest of North America.",
"image": "/server/imgs/furtherheights.com.png",
"region": ["North America"],
"language": ["English"],
"category": ["Hiking", "Biking", "4x4"]
},
{
"name": "Giretti",
"url": "https://giretti.gatti.ninja",
"description": "An instance for Italy, with motorcycle category added.",
"image": "/server/imgs/gatti.ninja.jpg",
"region": ["Italy"],
"language": ["Itlian"],
"category": ["Biking", "Motorcycling", "General"]
} }
] ]

View File

@@ -15,33 +15,37 @@
let language = $state(""); let language = $state("");
let category = $state(""); let category = $state("");
const uniqueValues = (key: keyof Server) => [ function uniqueValues(key: "region" | "language" | "category") {
...new Set(servers.map((s) => s[key])), const allValues = servers.flatMap((s) => s[key]);
]; const uniqueValues = [...new Set(allValues)];
return uniqueValues;
}
const regionItems: SelectItem[] = [ const regionItems: SelectItem[] = [
{ text: "All regions", value: "" }, { text: "All regions", value: "" },
...uniqueValues("region").map((v) => ({ text: v, value: v })), ...uniqueValues("region").map((v) => ({ text: v, value: v })),
]; ].toSorted((a, b) => a.text.localeCompare(b.text));
const languageItems: SelectItem[] = [ const languageItems: SelectItem[] = [
{ text: "All languages", value: "" }, { text: "All languages", value: "" },
...uniqueValues("language").map((v) => ({ text: v, value: v })), ...uniqueValues("language").map((v) => ({ text: v, value: v })),
]; ].toSorted((a, b) => a.text.localeCompare(b.text));
const categoryItems: SelectItem[] = [ const categoryItems: SelectItem[] = [
{ text: "All categories", value: "" }, { text: "All categories", value: "" },
...uniqueValues("category").map((v) => ({ text: v, value: v })), ...uniqueValues("category").map((v) => ({ text: v, value: v })),
]; ].toSorted((a, b) => a.text.localeCompare(b.text));
const filteredServers = $derived( const filteredServers = $derived(
servers.filter( servers.filter(
(server) => (server) =>
(server.name.toLowerCase().includes(search.toLowerCase()) || (server.name.toLowerCase().includes(search.toLowerCase()) ||
server.description.toLowerCase().includes(search.toLowerCase())) && server.description
(!region || server.region === region) && .toLowerCase()
(!language || server.language === language) && .includes(search.toLowerCase())) &&
(!category || server.category === category), (!region || server.region.includes(region)) &&
(!language || server.language.includes(language)) &&
(!category || server.category.includes(category)),
), ),
); );
</script> </script>
@@ -58,7 +62,11 @@
discover publicly listed wanderer servers you might want to explore or discover publicly listed wanderer servers you might want to explore or
become part of. become part of.
</p> </p>
<p class="mb-12">Learn how to add your server to the list <a href="https://github.com/Flomp/wanderer/discussions/361">here</a>.</p> <p class="mb-12">
Learn how to add your server to the list <a
href="https://github.com/Flomp/wanderer/discussions/361">here</a
>.
</p>
<div <div
class="grid grid-cols-1 md:grid-cols-[1fr_auto_auto_auto] justify-end gap-4 mb-8" class="grid grid-cols-1 md:grid-cols-[1fr_auto_auto_auto] justify-end gap-4 mb-8"
> >
@@ -96,13 +104,15 @@
class="w-full h-40 object-cover" class="w-full h-40 object-cover"
/> />
<div class="flex items-center gap-1 flex-wrap px-4"> <div class="flex items-center gap-1 flex-wrap px-4">
{#each ["category", "region", "language"] as key} {#each ["region", "language", "category"] as key}
{#each (server as any)[key] as item}
<div <div
class="mt-0 flex-shrink-0 text-xs border border-input-border bg-menu-item-background-hover' px-2 py-1 rounded-full flex items-center gap-1" class="mt-0 flex-shrink-0 text-xs border border-input-border bg-menu-item-background-hover' px-2 py-1 rounded-full flex items-center gap-1"
> >
{(server as any)[key]} {item}
</div> </div>
{/each} {/each}
{/each}
</div> </div>
<div class="p-4 -mt-2 flex-grow"> <div class="p-4 -mt-2 flex-grow">
<h4 class="mb-1">{server.name}</h4> <h4 class="mb-1">{server.name}</h4>

View File

@@ -3,7 +3,7 @@ export interface Server {
url: string; url: string;
description: string; description: string;
image: string; image: string;
region: string; region: string[];
language: string; language: string[];
category: string; category: string[];
} }