- {room.players.length} / {room.maxPlayers} | {#if room.players.length > 4}
- {#each room.players.slice(0, 4) as player}
- {player.nickname}{#if player !== room.players[3]},{" "}
- {/if}
- {/each}
- and {room.players.length - 4}
- {room.players.length - 4 === 1 ? "other" : "others"}
- {:else}
- {#each room.players as player}
- {player.nickname}{#if player !== room.players[room.players.length - 1]},{" "}
- {/if}
- {/each}
- {/if} | {room.hasPassword ? "Private" : "Public"}
-
- {room.address}:{room.port}
+
+ {#if icon}
+

+ {/if}
+
+
+ {room.name}
+ ({room.preferredGameName || "No preferred game"})
+
+
{room.description}
+
+ {room.players.length} / {room.maxPlayers} | {#if room.players.length > 4}
+ {#each room.players.slice(0, 4) as player}
+ {player.nickname}{#if player !== room.players[3]},{" "}
+ {/if}
+ {/each}
+ and {room.players.length - 4}
+ {room.players.length - 4 === 1 ? "other" : "others"}
+ {:else}
+ {#each room.players as player}
+ {player.nickname}{#if player !== room.players[room.players.length - 1]},{" "}
+ {/if}
+ {/each}
+ {/if} | {room.hasPassword ? "Private" : "Public"} | {room.address}:{room.port}
+
-
-
diff --git a/src/lib/data/strings.json b/src/lib/data/strings.json
deleted file mode 100644
index f799165..0000000
--- a/src/lib/data/strings.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "landingHeader": "suyu",
- "landingOne": "Suyu is an open-source, Switch compatible emulator with almost full coverage of the game library.",
- "landingCardHeader": "We care about preservation"
-}
diff --git a/src/lib/server/other/index.ts b/src/lib/server/other/index.ts
new file mode 100644
index 0000000..f961d4b
--- /dev/null
+++ b/src/lib/server/other/index.ts
@@ -0,0 +1,28 @@
+interface SwitchGame {
+ bannerUrl: string;
+ category: string[];
+ description: string;
+ developer: null;
+ frontBoxArt: null;
+ iconUrl: string;
+ id: string;
+ intro: null | string;
+ isDemo: boolean;
+ key: null;
+ languages: string[];
+ name: string;
+ nsuId: number;
+ numberOfPlayers: number;
+ publisher: string;
+ rating: number;
+ ratingContent: string[];
+ region: null;
+ releaseDate: number;
+ rightsId: string;
+ screenshots: string[];
+ size: number;
+ version: null;
+}
+export const globalData: {
+ games: SwitchGame[];
+} = { games: [] };
diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts
new file mode 100644
index 0000000..37a4758
--- /dev/null
+++ b/src/routes/+layout.server.ts
@@ -0,0 +1,7 @@
+export function load({ cookies, url }) {
+ const token = cookies.get("token");
+ return {
+ tokenCookie: token,
+ url: url.pathname,
+ };
+}
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index bc3108f..ed84007 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -21,7 +21,7 @@
href: string;
}
- const token = writable("");
+ const token = writable(data.tokenCookie || "");
function transitionIn(node: HTMLElement, { duration = 360 }: TransitionConfig) {
if ($reducedMotion)
@@ -29,7 +29,7 @@
duration: 0,
};
node = node.querySelector(".content") || node;
- const intensity = node.dataset.intensity || "160";
+ const intensity = node.dataset.intensityIn || "160";
const UA = navigator.userAgent;
const ff = UA.indexOf("Firefox") > -1;
if (!dropdownCloseFinished) {
@@ -86,7 +86,7 @@
duration: 0,
};
node = node.querySelector(".content") || node;
- const intensity = node.dataset.intensity || "160";
+ const intensity = node.dataset.intensityOut || "240";
if (!dropdownCloseFinished)
return {
duration: 0,
@@ -149,8 +149,8 @@
href: "https://gitlab.com/suyu-emu/",
},
{
- name: $token ? "Account" : "Sign up",
- href: $token ? "/account" : "/signup",
+ name: $token || data.tokenCookie ? "Account" : "Sign up",
+ href: $token || data.tokenCookie ? "/account" : "/signup",
},
] as NavItem[];
@@ -216,10 +216,11 @@
});
+
{#if navigator.userAgent.indexOf("Firefox") === -1}
@@ -318,7 +319,7 @@
-1 ? "bg-[#0e0d10]" : "bg-[rgba(0,0,0,0.25)] backdrop-blur-xl"} fixed left-0 z-[99999] h-screen w-full p-9 pt-[120px] ${dropdownOpen ? "pointer-events-auto visible opacity-100" : "pointer-events-none opacity-0"} ${!dropdownOpen && dropdownCloseFinished ? "invisible" : ""}`}
+ class={`fixed left-0 z-[99999] h-screen w-full bg-[#0e0d10] p-9 pt-[120px] ${dropdownOpen ? "pointer-events-auto visible opacity-100" : "pointer-events-none opacity-0"} ${!dropdownOpen && dropdownCloseFinished ? "invisible" : ""}`}
>