Added Wall

This commit is contained in:
2025-08-23 01:48:09 +02:00
parent 4ea6836ca8
commit 04a47f4a00
13 changed files with 1169 additions and 967 deletions

View File

@@ -1,16 +1,17 @@
{ {
"useTabs": true, "useTabs": false,
"singleQuote": true, "singleQuote": false,
"trailingComma": "none", "trailingComma": "none",
"printWidth": 100, "printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"], "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [ "overrides": [
{ {
"files": "*.svelte", "files": "*.svelte",
"options": { "options": {
"parser": "svelte" "parser": "svelte"
} }
} }
], ],
"tailwindStylesheet": "./src/app.css" "tailwindStylesheet": "./src/app.css",
"tabWidth": 4
} }

View File

@@ -1,3 +1,4 @@
{ {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
} }

View File

@@ -1 +1,34 @@
@import 'tailwindcss'; @import "tailwindcss";
@layer components {
.btn {
border: 1px solid black;
border-radius: 5px;
padding: 4px;
cursor: pointer;
height: fit-content;
}
.btn:hover {
background-color: rgba(0, 0, 0, 0.1);
}
.inputField {
padding: 8px;
}
.card {
border: 1px solid black;
border-radius: 5px;
display: flex;
align-items: center;
justify-content: center;
font-size: larger;
font-weight: bold;
cursor: pointer;
}
.card:hover {
background-color: rgba(0, 0, 0, 0.1);
}
}

View File

@@ -1,19 +1,21 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en" class="h-full">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta
%sveltekit.head% name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"
/>
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover" class="size-full">
<div style="display: contents">%sveltekit.body%</div>
</head> <script>
<body data-sveltekit-preload-data="hover"> const theme = new URL(window.location).searchParams.get("theme");
<div style="display: contents">%sveltekit.body%</div>
<script> document.documentElement.classList.remove("light", "dark");
const theme = new URL(window.location).searchParams.get('theme'); document.documentElement.classList.add("dark");
</script>
document.documentElement.classList.remove('light', 'dark'); </body>
document.documentElement.classList.add('dark');
</script>
</body>
</html> </html>

973
src/lib/games/games.ts Normal file
View File

@@ -0,0 +1,973 @@
const games: Games = [
{
name: "LAN Party",
walls: [
{
name: "Wall 1",
categories: [
{
name: "Category 1",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 2",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 3",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 4",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 5",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
}
]
},
{
name: "Wall 2",
categories: [
{
name: "Category 1",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 2",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 3",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 4",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 5",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
}
]
}
]
},
{
name: "LAN Party 2",
walls: [
{
name: "Wall 1",
categories: [
{
name: "Category 1",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 2",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 3",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 4",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 5",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
}
]
},
{
name: "Wall 2",
categories: [
{
name: "Category 1",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 2",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 3",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 4",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
},
{
name: "Category 5",
questions: [
{
points: 100,
type: "SIMPLE",
data: {
question: "Question 1?",
answer: "Answer 1"
}
},
{
points: 200,
type: "SIMPLE",
data: {
question: "Question 2?",
answer: "Answer 2"
}
},
{
points: 300,
type: "SIMPLE",
data: {
question: "Question 3?",
answer: "Answer 3"
}
},
{
points: 400,
type: "SIMPLE",
data: {
question: "Question 4?",
answer: "Answer 4"
}
},
{
points: 500,
type: "SIMPLE",
data: {
question: "Question 5?",
answer: "Answer 5"
}
}
]
}
]
}
]
}
];
export type Question = {
points: number;
type: "SIMPLE" | "MULTIPLE_CHOICE";
};
export type SimpleQuestion = Question & {
type: "SIMPLE";
data: {
question: string;
answer: string;
};
};
export type MultipleChoiceQuestion = Question & {
type: "MULTIPLE_CHOICE";
data: {
question: string;
answer: number;
choices: string[];
};
};
export type Category = {
name: string;
questions: (SimpleQuestion | MultipleChoiceQuestion)[];
};
export type Wall = {
name: string;
categories: Category[];
};
export type Game = {
name: string;
walls: Wall[];
};
export type Games = Game[];
export default games;

View File

@@ -1,932 +0,0 @@
export default [
{
name: 'LAN Party',
walls: [
{
name: 'Wall 1',
categories: [
{
name: 'Category 1',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 2',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 3',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 4',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 5',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
}
]
},
{
name: 'Wall 2',
categories: [
{
name: 'Category 1',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 2',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 3',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 4',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 5',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
}
]
}
]
},
{
name: 'LAN Party 2',
walls: [
{
name: 'Wall 1',
categories: [
{
name: 'Category 1',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 2',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 3',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 4',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 5',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
}
]
},
{
name: 'Wall 2',
categories: [
{
name: 'Category 1',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 2',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 3',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 4',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
},
{
name: 'Category 5',
questions: [
{
points: 100,
type: 'SIMPLE',
data: {
question: 'Question 1?',
answer: 'Answer 1'
}
},
{
points: 200,
type: 'SIMPLE',
data: {
question: 'Question 2?',
answer: 'Answer 2'
}
},
{
points: 300,
type: 'SIMPLE',
data: {
question: 'Question 3?',
answer: 'Answer 3'
}
},
{
points: 400,
type: 'SIMPLE',
data: {
question: 'Question 4?',
answer: 'Answer 4'
}
},
{
points: 500,
type: 'SIMPLE',
data: {
question: 'Question 5?',
answer: 'Answer 5'
}
}
]
}
]
}
]
}
];

View File

@@ -0,0 +1,7 @@
import games from '$lib/games/games';
export function load() {
return {
games
};
}

View File

@@ -1,14 +1,14 @@
<script lang="ts"> <script lang="ts">
import games from '$lib/games/lanparty'; let { data } = $props();
</script> </script>
<h1 class="m-4 mb-8 text-7xl font-bold">Jeopardy</h1> <h1 class="m-4 mb-8 text-7xl font-bold">Jeopardy</h1>
<div class="flex flex-col space-y-4"> <div class="flex flex-col space-y-4">
{#each games as game} {#each data.games as game, i}
<a <a
class="ms-4 me-4 rounded-xl border-2 p-4 hover:cursor-pointer hover:bg-emerald-200" class="ms-4 me-4 rounded-xl border-2 p-4 hover:cursor-pointer hover:bg-emerald-200"
href="/{game.name.toLocaleLowerCase().replaceAll(' ', '_')}">{game.name}</a href="/{i}">{game.name}</a
> >
{/each} {/each}
</div> </div>

View File

@@ -0,0 +1,12 @@
import { error } from '@sveltejs/kit';
import games from '$lib/games/games';
export function load({ params }) {
const index = parseInt(params.game);
if (isNaN(index)) {
error(404);
}
const game = games[index];
if (game === undefined) error(404);
else return game;
}

View File

@@ -1 +1,75 @@
<h1>This is Game ...</h1> <script lang="ts">
import Wall from "./Wall.svelte";
import type { Player } from "./Player";
import { GameState } from "./GameState";
import type { Game } from "$lib/games/games";
class GameManager {
public state: GameState = $state(GameState.INIT);
public game: Game;
public players: Player[];
public currentWall = $state(0);
constructor(game: Game, players: Player[]) {
this.game = game;
this.players = players;
}
startGame(): void {
this.state = GameState.RUNNING;
console.log("hello");
}
}
let { data } = $props();
let players: Player[] = $state([
{
name: "Player 1",
points: 0
},
{
name: "Player 2",
points: 0
},
{
name: "Player 3",
points: 0
}
]);
let gameManager = new GameManager(data, players);
function addPlayer() {
players.push({
name: "Player " + (players.length + 1),
points: 0
});
}
function removePlayer(index: number) {
players.splice(index, 1);
}
</script>
<div class="flex h-full flex-col">
<h1 class="ms-4 text-7xl font-bold">{gameManager.game.name}</h1>
{#if gameManager.state === GameState.INIT}
<div class="p-4">
<div class="flex items-center">
<h2 class="grow pb-4 text-5xl">Spieler</h2>
<button class="btn" onclick={() => gameManager.startGame()}>Start</button>
</div>
<div class="flex flex-col space-y-2 pb-4">
{#each gameManager.players as player, i}
<div class="flex items-center">
<input class="inputField grow" type="text" bind:value={player.name} />
<button class="btn" onclick={() => removePlayer(i)}>Löschen</button>
</div>
{/each}
</div>
<button class="btn" onclick={addPlayer}>Spieler hinzufügen</button>
</div>
{:else}
<Wall wall={gameManager.game.walls[gameManager.currentWall]} />
{/if}
</div>

View File

@@ -0,0 +1,4 @@
export enum GameState {
INIT,
RUNNING
}

View File

@@ -0,0 +1,4 @@
export interface Player {
name: string;
points: number;
}

View File

@@ -0,0 +1,23 @@
<script lang="ts">
import type { Wall } from "$lib/games/games";
interface Props {
wall: Wall;
[key: string]: unknown;
}
let { wall }: Props = $props();
</script>
<div class="grid h-full grid-flow-col grid-cols-5 grid-rows-6 gap-4 ps-4 pe-4 pb-4">
{#each wall.categories as category}
<div class="flex items-center justify-center text-3xl font-semibold">
<div>{category.name}</div>
</div>
{#each category.questions as question}
<div class="card">
<div>{question.points}</div>
</div>
{/each}
{/each}
</div>