brought both code in 1 repo, working on merging them!

This commit is contained in:
RezHackXYZ 2025-05-26 08:37:44 +05:30
parent d1c8ae269b
commit 9f927cf2e9
No known key found for this signature in database
82 changed files with 3220 additions and 20 deletions

View file

@ -0,0 +1,36 @@
<script>
import { questions, Selected } from "../../logic/HostsData.svelte.js";
import { AnswersSymbolAndColorScheme } from "$lib/config.js";
</script>
<div class="mt-5 grid grid-cols-2 gap-5 gap-x-3">
{#each questions.v.answers as answer, index}
<div class="flex">
<input
type="radio"
id="O{index}"
name="question"
class="peer sr-only"
value={index}
bind:group={Selected.v}
/>
<label
for="O{index}"
style="
--border-color: {AnswersSymbolAndColorScheme[index].Color};
--bg-color: {AnswersSymbolAndColorScheme[index].Color};
--border-color-checked: {AnswersSymbolAndColorScheme[index].SelectedColor};
--bg-color-checked: {AnswersSymbolAndColorScheme[index].SelectedColor};
--border-color-hover: {AnswersSymbolAndColorScheme[index].HoverBorderColor};
--border-color-checked: {AnswersSymbolAndColorScheme[index].SelectedBorderColor};
--border-color-hover: {AnswersSymbolAndColorScheme[index].HoverBorderColor};
"
class="w-full cursor-pointer rounded-lg border-[5px] border-[var(--border-color)] bg-[var(--bg-color)] pt-1 pr-2 pb-1 pl-2 text-center text-3xl transition-all peer-checked:border-[var(--border-color-checked)] peer-checked:border-[var(--border-color-checked)] peer-checked:bg-[var(--bg-color-checked)] hover:border-[var(--border-color-hover)]"
>
<i class="nf {AnswersSymbolAndColorScheme[index].Symbol}"></i>
{answer}
</label>
</div>
{/each}
</div>

View file

@ -0,0 +1,13 @@
<script>
import { CurrentQuestion, TotalQuestions } from "../../logic/HostsData.svelte.js";
</script>
<div class="mb-5 flex w-full items-center justify-center gap-3">
<h3>Question {CurrentQuestion.v + 1} of {TotalQuestions.v}</h3>
<div class="flex-1 rounded-full border-2 border-gray-600">
<div
class="h-4 rounded-full bg-green-600 transition-all duration-700"
style="width: {(CurrentQuestion.v / TotalQuestions.v) * 100}%;"
></div>
</div>
</div>

View file

@ -0,0 +1,13 @@
<div class="group relative">
<button
class="mt-4 cursor-not-allowed gap-0 rounded-lg bg-gray-500 p-2 text-3xl text-gray-300 transition-all"
disabled
>
Submit
</button>
<div
class="invisible absolute bottom-full left-1/2 mb-2 w-40 -translate-x-1/2 rounded-md bg-black px-3 py-1 text-center text-sm text-white opacity-0 transition-all group-hover:visible group-hover:opacity-100"
>
Select an option to submit
</div>
</div>

View file

@ -0,0 +1,9 @@
<script>
import { SubmitAnswer } from "../../../logic/SubmitAnswer.js";
</script>
<button
class="mt-4 cursor-pointer gap-0 rounded-lg bg-green-700 p-2 text-3xl transition-all hover:scale-110 hover:-rotate-10"
onclick={SubmitAnswer}
>Submit
</button>

View file

@ -0,0 +1,28 @@
<script>
import Question from "./text/Quetion.svelte";
import Awnsers from "./Awnsers.svelte";
import ProgressBar from "./ProgressBar.svelte";
import SelectFirst from "./buttons/SelectFirst.svelte";
import Wait from "./text/wait.svelte";
import SubmitAwnser from "./buttons/submitAwnser.svelte";
import { CurrentQuestion, Selected } from "../../logic/HostsData.svelte.js";
</script>
<div class="bg-grey-900 flex h-full items-center justify-center">
<div
class="flex max-w-[700px] flex-col items-center justify-center gap-1 rounded-lg bg-gray-900 p-8 shadow-lg"
>
<ProgressBar />
{#if CurrentQuestion.v != null}
<Question />
<Awnsers />
{#if Selected.v != null}
<SubmitAwnser />
{:else}
<SelectFirst />
{/if}
{:else}
<Wait />
{/if}
</div>
</div>

View file

@ -0,0 +1,7 @@
<script>
import { CurrentQuestion, questions } from "../../../logic/HostsData.svelte.js";
</script>
<h1 class="m-[0] text-center text-5xl">
Q{CurrentQuestion.v + 1}. {questions.v.question}
</h1>

View file

@ -0,0 +1 @@
<h1 class="m-[0] text-center text-5xl">Please wait for everyone else to answer the question.</h1>