Skip to content

Commit 0e7ba37

Browse files
committed
install tailwindcss and daisyui
1 parent c12ef9a commit 0e7ba37

File tree

8 files changed

+133
-26
lines changed

8 files changed

+133
-26
lines changed

bun.lock

Lines changed: 94 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
%sveltekit.head%
99
</head>
1010

11-
<body data-sveltekit-preload-data="hover" style="margin: 0px; overflow: hidden;">
11+
<body data-sveltekit-preload-data="hover" style="margin: 0px; overflow: hidden;" data-theme="light">
1212
<div style="display: contents">%sveltekit.body%</div>
1313
</body>
1414

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
"@sveltejs/adapter-static": "^3.0.8",
2222
"@sveltejs/kit": "^2.20.7",
2323
"@sveltejs/vite-plugin-svelte": "^5.0.3",
24+
"@tailwindcss/vite": "^4.1.6",
25+
"daisyui": "^5.0.35",
2426
"lefthook": "^1.11.12",
2527
"svelte": "^5.28.2",
2628
"svelte-check": "^4.1.6",

routes/+layout.svelte

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<script lang="ts">
2+
import "@/ui-components/app.css";
3+
import type { Snippet } from "svelte";
4+
5+
type Props = {
6+
children: Snippet;
7+
};
8+
const { children }: Props = $props();
9+
</script>
10+
11+
{@render children()}

src/ui-components/Game.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ $effect(() => {
3838
onDestroy(() => bindings.ondestroy());
3939
</script>
4040

41-
<div bind:this={container} class="container">
41+
<div bind:this={container} id="container">
4242
<PauseMenu
4343
paused={uiContext.paused}
4444
onpause={() => bindings.onpause()}
@@ -84,7 +84,7 @@ onDestroy(() => bindings.ondestroy());
8484
</div>
8585

8686
<style>
87-
.container {
87+
#container {
8888
width: 100dvw;
8989
height: 100dvh;
9090
overflow: hidden;

src/ui-components/PauseMenu.svelte

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,26 @@ document.addEventListener("keydown", (ev) => {
2323
});
2424
</script>
2525

26-
<dialog bind:this={el} onclose={onresume}>
27-
<div class="uiBackground menu">
28-
<span style="font-size: 2rem;">Paused</span>
26+
<dialog bind:this={el} onclose={onresume} class="modal">
27+
<div class="uiBackground modal-box flex flex-col gap-1">
28+
<h1 class="text-4xl text-center">Paused</h1>
2929
<!-- todo: ボタンのスタイル -->
30-
<form method="dialog">
31-
<button style="font-size: 1.5rem;" type="submit"> Resume </button>
30+
<form method="dialog" class="w-full">
31+
<button style="font-size: 1.5rem;" class="btn btn-block" type="submit">
32+
Resume
33+
</button>
3234
</form>
3335
<!-- TODO; これもうちょいパフォーマンスいいやつにしたい -->
34-
<button style="font-size: 1.5rem;" onclick={() => window.location.reload()}>
36+
<button
37+
style="font-size: 1.5rem;"
38+
class="btn btn-block"
39+
onclick={() => window.location.reload()}
40+
>
3541
Restart
3642
</button>
37-
<a style="font-size: 1.5rem;" href="/"> Back to Stage Select </a>
43+
<a style="font-size: 1.5rem;" class="btn btn-block" href="/">
44+
Back to Stage Select
45+
</a>
3846
</div>
3947
</dialog>
4048

@@ -44,19 +52,4 @@ document.addEventListener("keydown", (ev) => {
4452
backdrop-filter: blur(2px);
4553
padding: 0.75rem 1rem;
4654
}
47-
.menu {
48-
position: fixed;
49-
left: 0;
50-
top: 0;
51-
right: 0;
52-
bottom: 0;
53-
display: flex;
54-
flex-direction: column;
55-
margin: auto;
56-
align-items: center;
57-
width: max-content;
58-
height: max-content;
59-
gap: 0.5rem;
60-
border-radius: 1rem;
61-
}
6255
</style>

src/ui-components/app.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@import "tailwindcss";
2+
3+
@plugin "daisyui" {
4+
/* biome-ignore lint: daisyui prop */
5+
themes: "light";
6+
}

vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { sveltekit } from "@sveltejs/kit/vite";
2+
import tailwindcss from "@tailwindcss/vite";
23
import { defineConfig } from "vite";
34

45
export default defineConfig({
5-
plugins: [sveltekit()],
6+
plugins: [sveltekit(), tailwindcss()],
67
build: {
78
target: "esnext",
89
},

0 commit comments

Comments
 (0)