you can now UPLAD IMAGES AND VIDS!!! in the quetions of kahootlone/quizzlet

This commit is contained in:
RezHackXYZ 2025-05-31 18:13:50 +05:30
parent 5f53e923d0
commit de7e3da139
29 changed files with 158 additions and 96 deletions

View file

@ -1,6 +1,8 @@
<script>
import toast from "svelte-5-french-toast";
import { joinGame } from "./logic/joinGame.js";
import { Checking } from "./logic/JoinGameData.svelte.js";
let pin;
let name;
@ -35,7 +37,7 @@
class="mt-2 cursor-pointer rounded-full bg-green-700 p-2 transition-all hover:scale-110 hover:-rotate-10"
on:click={() => {
if (!pin || !name) {
alert("Please fill in the game pin and your name.");
toast.error("Please fill in the game pin and your name.");
} else {
joinGame(pin, name);
}

View file

@ -1,4 +1,6 @@
import { supabase } from "$lib/supabase";
import toast from "svelte-5-french-toast";
export async function addPlayer(name, gamePin) {
const { data, error } = await supabase
@ -11,7 +13,7 @@ export async function addPlayer(name, gamePin) {
.select("id");
if (error) {
alert("Failed to join game: " + error.message + "\n\nPlease try again.");
toast.error("Failed to join game: " + error.message + "\n\nPlease try again.");
return;
}

View file

@ -1,12 +1,14 @@
import { addPlayer } from "./InsertPlayerInDB.js";
import { validateGamePin } from "./validateGamePin.js";
import { Checking } from "./JoinGameData.svelte.js";
import toast from "svelte-5-french-toast";
export async function joinGame(pin, name) {
Checking.v = true;
if (!(await validateGamePin(pin))) {
alert("Invalid game pin. Please try again.");
toast.error("Invalid game pin. Please try again.");
Checking.v = false;
return;
}