made the filestructure better and migrated the game creation from the old type of db to the newer relational db type!
This commit is contained in:
parent
9ac813c699
commit
736059646d
28 changed files with 343 additions and 736 deletions
30
src/routes/create/components/Questions/question.svelte
Normal file
30
src/routes/create/components/Questions/question.svelte
Normal file
|
@ -0,0 +1,30 @@
|
|||
<script>
|
||||
import DeleteQuestion from '../buttons/DeleteQuestion.svelte';
|
||||
import Answers from './answers.svelte';
|
||||
import { questions } from '../../logic/GameCreateData.svelte.js';
|
||||
|
||||
let props = $props();
|
||||
let index = props.index;
|
||||
</script>
|
||||
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="mb-3 flex flex-col items-center justify-center gap-1 rounded-2xl bg-gray-600 p-2">
|
||||
<div class="flex h-fit items-center gap-3">
|
||||
<h1 class="mt-2 mb-3 text-2xl">Q{index + 1}.</h1>
|
||||
<input
|
||||
type="text"
|
||||
bind:value={questions.v[index].name}
|
||||
placeholder="Question {index + 1}"
|
||||
class="h-fit w-[500px] rounded-xl bg-gray-800 p-1 text-center text-2xl text-white"
|
||||
/>
|
||||
<DeleteQuestion {index} />
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
{#each questions.v[index].answers as answer, answersIndex}
|
||||
<Answers questionsIndex={index} {answersIndex} />
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue