diff --git a/src/lib/scripts/featureDetect.ts b/src/lib/scripts/featureDetect.ts index b2dd840..e1ee74b 100644 --- a/src/lib/scripts/featureDetect.ts +++ b/src/lib/scripts/featureDetect.ts @@ -46,19 +46,4 @@ export function featureDetect(): FeatureDetectionResult { } return result; -} - -/*// Example usage - const featureSupport = featureDetect(); - console.log(featureSupport); - - if (!featureSupport.critical) { - alert('Some critical features required for this application are not supported by your browser.'); - // Handle lack of critical features appropriately - } else if (!featureSupport.nice) { - console.warn('Some nice-to-have features are not supported by your browser. The app will still function, but some features may be unavailable.'); - // Optionally handle lack of nice-to-have features - } else { - // Proceed with the normal functionality of your app - } - */ +} \ No newline at end of file diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index cce3785..63a7929 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -31,9 +31,9 @@ console.log(featureSupport); if (!featureSupport.critical) { - toast.error("Your browser is missing critical features, OwlBoard might not work properly. Consider updating your browser."); + toast.error("Your browser is missing critical features, OwlBoard might not work properly. See `Menu > Statistics` for more information."); } else if (!featureSupport.nice) { - toast.error("Your browser is missing some features, OwlBoard may run slower or be missing some features."); + toast.error("Your browser is missing some features, see `Menu > Statistics` for more information."); } }); diff --git a/src/routes/more/statistics/+page.svelte b/src/routes/more/statistics/+page.svelte index 6d9e9f8..b8c3b61 100644 --- a/src/routes/more/statistics/+page.svelte +++ b/src/routes/more/statistics/+page.svelte @@ -4,6 +4,7 @@ import Loading from "$lib/navigation/loading.svelte"; import Nav from "$lib/navigation/nav.svelte"; import { getApiUrl } from "$lib/scripts/upstream"; + import { featureDetect } from "$lib/scripts/featureDetect"; const title = "Statistics"; async function getData() { @@ -61,6 +62,73 @@ {/await} +

Browser Features

+{#await featureDetect()} + Checking browser features + {:then features} +

Critical Features

+ {#if !features.critical} +

OwlBoard will not function properly without these browser features. If you see any crosses here + you may need to update your browser or choose another browser. Chrome, Edge, Firefox, Brave & Samsung Browser + have been tested. +

+ {/if} + + +

Nice-to-have Features

+ {#if !features.nice} +

OwlBoard may run slowly or be missing some functions without these browser features. If you see any crosses here + you may want to update your browser or choose another browser for improved performance. Chrome, Edge, Firefox, + Brave & Samsung Browser have been tested. +

+ {/if} + + {:catch error} + Failed to detect browser features: {error.message} + {/await} +