From 0e2c4bded67f9b119806e94783107bf12e94c40f Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 28 Dec 2023 19:53:18 +0000 Subject: [PATCH] Misc website fixes --- src/asteroids-website/src/error.html | 3 +++ src/asteroids-website/src/routes/+layout.ts | 1 + src/asteroids-website/src/routes/+page.svelte | 6 ++---- src/asteroids-website/src/routes/+page.ts | 3 --- src/asteroids-website/src/routes/controls.ts | 1 - src/asteroids-website/src/routes/status-container.ts | 1 - src/asteroids-website/svelte.config.js | 3 +-- 7 files changed, 7 insertions(+), 11 deletions(-) create mode 100644 src/asteroids-website/src/error.html delete mode 100644 src/asteroids-website/src/routes/+page.ts delete mode 100644 src/asteroids-website/src/routes/controls.ts delete mode 100644 src/asteroids-website/src/routes/status-container.ts diff --git a/src/asteroids-website/src/error.html b/src/asteroids-website/src/error.html new file mode 100644 index 0000000..e98e890 --- /dev/null +++ b/src/asteroids-website/src/error.html @@ -0,0 +1,3 @@ +

Error

+

Code %sveltekit.status%

+

%sveltekit.error.message%

\ No newline at end of file diff --git a/src/asteroids-website/src/routes/+layout.ts b/src/asteroids-website/src/routes/+layout.ts index 950c19a..8b214a4 100644 --- a/src/asteroids-website/src/routes/+layout.ts +++ b/src/asteroids-website/src/routes/+layout.ts @@ -1,6 +1,7 @@ import "../app.postcss"; export const prerender = true; +export const ssr = true; // How to manage the trailing slashes in the URLs // the URL for about page witll be /about with 'ignore' (default) diff --git a/src/asteroids-website/src/routes/+page.svelte b/src/asteroids-website/src/routes/+page.svelte index 7030308..39d4ac5 100644 --- a/src/asteroids-website/src/routes/+page.svelte +++ b/src/asteroids-website/src/routes/+page.svelte @@ -29,15 +29,12 @@ emscripten.canvas.style.width = emscripten.canvas.width + 'px !important'; emscripten.canvas.style.height = emscripten.canvas.height + 'px !important'; } - is_fullscreen = true; }) .catch((err) => { alert(`Error attempting to enable fullscreen mode: ${err.message} (${err.name})`); }); } else { - document.exitFullscreen().then(() => { - is_fullscreen = false; - }); + document.exitFullscreen(); } emscripten?.canvas.focus(); @@ -218,6 +215,7 @@ on:orientationchange={(e) => UpdateSize(e)} on:resize={(e) => UpdateSize(e)} on:blur={(e) => requestPause()} + on:fullscreenchange={(e) => is_fullscreen = !!document.fullscreenElement} /> {#if $isLoading} diff --git a/src/asteroids-website/src/routes/+page.ts b/src/asteroids-website/src/routes/+page.ts deleted file mode 100644 index 49380d7..0000000 --- a/src/asteroids-website/src/routes/+page.ts +++ /dev/null @@ -1,3 +0,0 @@ -// since there's no dynamic data here, we can prerender -// it so that it gets served as a static asset in production -export const prerender = true; \ No newline at end of file diff --git a/src/asteroids-website/src/routes/controls.ts b/src/asteroids-website/src/routes/controls.ts deleted file mode 100644 index c8cacf0..0000000 --- a/src/asteroids-website/src/routes/controls.ts +++ /dev/null @@ -1 +0,0 @@ -export const prerender = true; \ No newline at end of file diff --git a/src/asteroids-website/src/routes/status-container.ts b/src/asteroids-website/src/routes/status-container.ts deleted file mode 100644 index c8cacf0..0000000 --- a/src/asteroids-website/src/routes/status-container.ts +++ /dev/null @@ -1 +0,0 @@ -export const prerender = true; \ No newline at end of file diff --git a/src/asteroids-website/svelte.config.js b/src/asteroids-website/svelte.config.js index efc1b12..18abc06 100644 --- a/src/asteroids-website/svelte.config.js +++ b/src/asteroids-website/svelte.config.js @@ -24,8 +24,7 @@ const config = { assets: 'build', fallback: '404.html', precompress: false, - strict: false, - + strict: true, }), }, };