Small changes

This commit is contained in:
Mawoka
2023-06-30 16:46:45 +02:00
parent f8a81fe490
commit a2cd034176
3 changed files with 21 additions and 37 deletions
-36
View File
@@ -9,39 +9,3 @@ export const signedIn = writable(false);
export const pathname = writable('/');
export const alertModal = writable({ open: false, title: '', body: '' });
import { goto } from '$app/navigation';
import { page } from '$app/stores';
const URLSearchParamsToObject = (params: URLSearchParams) => {
const obj = {};
params.forEach((v: string, k: string) => {
obj[k] = v;
});
return obj;
};
export const createQueryParamsStore = (key: string) => {
let params;
page.subscribe((v) => {
params = URLSearchParamsToObject(v.url.searchParams);
});
return {
// eslint-disable-next-line @typescript-eslint/ban-types
subscribe: (cb: Function) => {
return page.subscribe((p) => {
cb(p.url.searchParams.get(key));
});
},
set: (value: string) => {
params[key] = value;
const urlSearchParams = new URLSearchParams(params);
goto(`?${urlSearchParams.toString()}`, {
keepfocus: true,
replaceState: true,
noscroll: true
});
}
};
};
@@ -129,7 +129,7 @@ SPDX-License-Identifier: MPL-2.0
</span>
<a
href="/account/login"
href="/controller"
class="mx-2 text-sm font-bold text-blue-500 dark:text-blue-400 hover:underline"
>Read more here.</a
>
@@ -0,0 +1,20 @@
<!--
SPDX-FileCopyrightText: 2023 Marlon W (Mawoka)
SPDX-License-Identifier: MPL-2.0
-->
# ClassQuizController
## Setup
At first, you plug it into power, and after some seconds a WLAN-hotspot should be available, called
**ClassQuizController** with no password, which you can connect to. You're getting asked to sign in, and on this page,
you can enter your Wi-Fi SSID and your Wi-Fi password.
After that, wait two minutes and [add the controller](/account/controllers/add). Give it a name and a player name. The
player name is used in-game and the name is jus used for knowing which controller is which.
You're getting presented with a code. The code consists of upper- and lowercase letters and colored bars under these. A
long bar (or uppercase letter) stands for along press and a lowercase letter (short bar) stands, respectively, for a
short press. If everything worked, the controller should be connected.