@tsparticles/template-tictactoe 4.1.3 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +3 -0
  3. package/package.json +4 -3
  4. package/template/angular/package.json +34 -0
  5. package/template/angular/src/app/app.component.css +97 -0
  6. package/template/angular/src/app/app.component.html +21 -0
  7. package/template/angular/src/app/app.component.ts +94 -0
  8. package/template/angular-confetti/package.json +34 -0
  9. package/template/angular-confetti/src/app/app.component.css +97 -0
  10. package/template/angular-confetti/src/app/app.component.html +21 -0
  11. package/template/angular-confetti/src/app/app.component.ts +94 -0
  12. package/template/angular-fireworks/package.json +34 -0
  13. package/template/angular-fireworks/src/app/app.component.css +97 -0
  14. package/template/angular-fireworks/src/app/app.component.html +21 -0
  15. package/template/angular-fireworks/src/app/app.component.ts +94 -0
  16. package/template/astro/package.json +15 -0
  17. package/template/astro/src/pages/index.astro +158 -0
  18. package/template/ember/app/controllers/application.js +94 -0
  19. package/template/ember/app/templates/application.hbs +39 -0
  20. package/template/ember/package.json +17 -0
  21. package/template/inferno/package.json +20 -0
  22. package/template/inferno/src/App.css +97 -0
  23. package/template/inferno/src/App.tsx +149 -0
  24. package/template/jquery/package.json +20 -0
  25. package/template/jquery/src/main.ts +126 -0
  26. package/template/jquery/src/style.css +97 -0
  27. package/template/lit/package.json +19 -0
  28. package/template/lit/src/my-app.ts +133 -0
  29. package/template/nextjs/package.json +20 -0
  30. package/template/nextjs/src/app/page.tsx +173 -0
  31. package/template/nextjs/src/app/providers.tsx +13 -0
  32. package/template/nuxt2/package.json +14 -0
  33. package/template/nuxt2/pages/index.vue +203 -0
  34. package/template/nuxt3/app.vue +204 -0
  35. package/template/nuxt3/package.json +16 -0
  36. package/template/nuxt4/app.vue +202 -0
  37. package/template/nuxt4/package.json +16 -0
  38. package/template/preact/package.json +20 -0
  39. package/template/preact/src/App.css +97 -0
  40. package/template/preact/src/App.tsx +141 -0
  41. package/template/qwik/package.json +19 -0
  42. package/template/qwik/src/App.tsx +132 -0
  43. package/template/react/package.json +19 -0
  44. package/template/react/src/App.css +97 -0
  45. package/template/react/src/App.tsx +141 -0
  46. package/template/riot/package.json +20 -0
  47. package/template/riot/src/app.riot +139 -0
  48. package/template/solid/package.json +18 -0
  49. package/template/solid/src/App.tsx +151 -0
  50. package/template/solid/src/index.css +97 -0
  51. package/template/solid/src/main.tsx +9 -0
  52. package/template/stencil/package.json +14 -0
  53. package/template/stencil/src/components/app-home/app-home.css +97 -0
  54. package/template/stencil/src/components/app-home/app-home.tsx +122 -0
  55. package/template/svelte/package.json +20 -0
  56. package/template/svelte/src/App.svelte +256 -0
  57. package/template/svelte/src/main.ts +12 -0
  58. package/template/vanilla/LICENSE +21 -0
  59. package/template/vue2/package.json +19 -0
  60. package/template/vue2/src/App.vue +204 -0
  61. package/template/vue3/package.json +19 -0
  62. package/template/vue3/src/App.vue +215 -0
  63. package/template/vue3/src/main.ts +14 -0
  64. package/template/webcomponents/package.json +18 -0
  65. package/template/webcomponents/src/main.ts +134 -0
  66. package/template/webcomponents/src/style.css +97 -0
@@ -0,0 +1,203 @@
1
+ <template>
2
+ <div>
3
+ <vue-particles id="tsparticles" :options="particlesOptions" />
4
+ <div id="app">
5
+ <h1>Tic-Tac-Toe</h1>
6
+ <div class="scoreboard">
7
+ <span>X: <strong>{{ scores.X }}</strong></span>
8
+ <span>Draws: <strong>{{ scores.draw }}</strong></span>
9
+ <span>O: <strong>{{ scores.O }}</strong></span>
10
+ </div>
11
+ <div class="turn">{{ status }}</div>
12
+ <div class="board">
13
+ <div
14
+ v-for="(cell, i) in board"
15
+ :key="i"
16
+ :class="['cell', { taken: cell, win: winLine && winLine.includes(i) }]"
17
+ @click="handleMove(i)"
18
+ >
19
+ {{ cell }}
20
+ </div>
21
+ </div>
22
+ <button class="reset-btn" @click="handleReset">New Game</button>
23
+ </div>
24
+ </div>
25
+ </template>
26
+
27
+ <script>
28
+ import { confetti } from "@tsparticles/confetti";
29
+
30
+ const WIN_PATTERNS = [
31
+ [0, 1, 2], [3, 4, 5], [6, 7, 8],
32
+ [0, 3, 6], [1, 4, 7], [2, 5, 8],
33
+ [0, 4, 8], [2, 4, 6],
34
+ ];
35
+
36
+ export default {
37
+ data() {
38
+ return {
39
+ board: Array(9).fill(null),
40
+ currentPlayer: "X",
41
+ winner: null,
42
+ winLine: null,
43
+ scores: { X: 0, O: 0, draw: 0 },
44
+ particlesOptions: {
45
+ fullScreen: { enable: true, zIndex: -1 },
46
+ background: { color: { value: "#0a0a1a" } },
47
+ fpsLimit: 60,
48
+ particles: {
49
+ number: { value: 30, density: { enable: true } },
50
+ color: { value: ["#6c5ce7", "#a29bfe"] },
51
+ shape: { type: "circle" },
52
+ opacity: { value: 0.2, random: true },
53
+ size: { value: { min: 1, max: 2 } },
54
+ move: { enable: true, speed: 0.5, direction: "none", random: true, straight: false, outModes: { default: "out" } },
55
+ },
56
+ detectRetina: true,
57
+ },
58
+ };
59
+ },
60
+ computed: {
61
+ status() {
62
+ if (!this.winner) return `${this.currentPlayer}'s turn`;
63
+ if (this.winner === "draw") return "It's a draw!";
64
+ return `${this.winner} wins!`;
65
+ },
66
+ },
67
+ methods: {
68
+ checkWin(board) {
69
+ for (const pattern of WIN_PATTERNS) {
70
+ const [a, b, c] = pattern;
71
+ if (board[a] && board[a] === board[b] && board[a] === board[c]) {
72
+ return { winner: board[a], winLine: pattern };
73
+ }
74
+ }
75
+ if (board.every((cell) => cell !== null)) return { winner: "draw", winLine: [] };
76
+ return null;
77
+ },
78
+ fireConfettiEffect() {
79
+ const count = 200;
80
+ const defaults = { origin: { y: 0.7 } };
81
+ const fire = (particleRatio, opts) => {
82
+ confetti({ ...defaults, ...opts, particleCount: Math.floor(count * particleRatio) });
83
+ };
84
+ fire(0.25, { spread: 26, startVelocity: 55 });
85
+ fire(0.2, { spread: 60 });
86
+ fire(0.35, { spread: 100, decay: 0.91, scalar: 0.8 });
87
+ fire(0.1, { spread: 120, startVelocity: 25, decay: 0.92, scalar: 1.2 });
88
+ fire(0.1, { spread: 120, startVelocity: 45 });
89
+ },
90
+ handleMove(index) {
91
+ if (this.board[index] || this.winner) return;
92
+ const board = [...this.board];
93
+ board[index] = this.currentPlayer;
94
+ const result = this.checkWin(board);
95
+ if (result) {
96
+ this.board = board;
97
+ this.winner = result.winner;
98
+ this.winLine = result.winLine;
99
+ if (result.winner === "draw") this.scores.draw++;
100
+ else this.scores[result.winner]++;
101
+ if (result.winner !== "draw") setTimeout(() => this.fireConfettiEffect(), 100);
102
+ } else {
103
+ this.board = board;
104
+ this.currentPlayer = this.currentPlayer === "X" ? "O" : "X";
105
+ }
106
+ },
107
+ handleReset() {
108
+ this.board = Array(9).fill(null);
109
+ this.currentPlayer = "X";
110
+ this.winner = null;
111
+ this.winLine = null;
112
+ },
113
+ },
114
+ };
115
+ </script>
116
+
117
+ <style>
118
+ * {
119
+ box-sizing: border-box;
120
+ }
121
+ body {
122
+ margin: 0;
123
+ min-height: 100vh;
124
+ display: flex;
125
+ align-items: center;
126
+ justify-content: center;
127
+ background: #0a0a1a;
128
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
129
+ color: #fff;
130
+ }
131
+ #app {
132
+ text-align: center;
133
+ z-index: 10;
134
+ padding: 1rem;
135
+ }
136
+ h1 {
137
+ font-size: 2.5em;
138
+ margin-bottom: 1rem;
139
+ background: linear-gradient(135deg, #6c5ce7, #fd79a8);
140
+ -webkit-background-clip: text;
141
+ -webkit-text-fill-color: transparent;
142
+ background-clip: text;
143
+ }
144
+ .scoreboard {
145
+ display: flex;
146
+ justify-content: center;
147
+ gap: 2rem;
148
+ margin-bottom: 1rem;
149
+ font-size: 1.1em;
150
+ opacity: 0.8;
151
+ }
152
+ .turn {
153
+ font-size: 1.2em;
154
+ margin-bottom: 1rem;
155
+ opacity: 0.7;
156
+ }
157
+ .board {
158
+ display: grid;
159
+ grid-template-columns: repeat(3, 100px);
160
+ grid-template-rows: repeat(3, 100px);
161
+ gap: 4px;
162
+ background: rgba(255, 255, 255, 0.1);
163
+ border-radius: 12px;
164
+ overflow: hidden;
165
+ margin: 0 auto;
166
+ width: fit-content;
167
+ }
168
+ .cell {
169
+ display: flex;
170
+ align-items: center;
171
+ justify-content: center;
172
+ font-size: 2.5em;
173
+ font-weight: 700;
174
+ background: #12122a;
175
+ cursor: pointer;
176
+ transition: background 0.2s;
177
+ user-select: none;
178
+ }
179
+ .cell:hover {
180
+ background: #1a1a3a;
181
+ }
182
+ .cell.taken {
183
+ cursor: default;
184
+ }
185
+ .cell.win {
186
+ background: rgba(108, 92, 231, 0.3);
187
+ }
188
+ .reset-btn {
189
+ margin-top: 1.5rem;
190
+ padding: 0.7em 2em;
191
+ font-size: 1em;
192
+ font-weight: 600;
193
+ border: none;
194
+ border-radius: 8px;
195
+ background: linear-gradient(135deg, #6c5ce7, #a29bfe);
196
+ color: #fff;
197
+ cursor: pointer;
198
+ transition: transform 0.2s;
199
+ }
200
+ .reset-btn:hover {
201
+ transform: scale(1.05);
202
+ }
203
+ </style>
@@ -0,0 +1,204 @@
1
+ <template>
2
+ <div>
3
+ <vue-particles id="tsparticles" :options="particlesOptions" />
4
+ <div id="app">
5
+ <h1>Tic-Tac-Toe</h1>
6
+ <div class="scoreboard">
7
+ <span>X: <strong>{{ scores.X }}</strong></span>
8
+ <span>Draws: <strong>{{ scores.draw }}</strong></span>
9
+ <span>O: <strong>{{ scores.O }}</strong></span>
10
+ </div>
11
+ <div class="turn">{{ status }}</div>
12
+ <div class="board">
13
+ <div
14
+ v-for="(cell, i) in board"
15
+ :key="i"
16
+ :class="['cell', { taken: cell, win: winLine?.includes(i) }]"
17
+ @click="handleMove(i)"
18
+ >
19
+ {{ cell }}
20
+ </div>
21
+ </div>
22
+ <button class="reset-btn" @click="handleReset">New Game</button>
23
+ </div>
24
+ </div>
25
+ </template>
26
+
27
+ <script setup>
28
+ import { reactive, computed } from "vue";
29
+ import { confetti } from "@tsparticles/confetti";
30
+
31
+ const WIN_PATTERNS = [
32
+ [0, 1, 2], [3, 4, 5], [6, 7, 8],
33
+ [0, 3, 6], [1, 4, 7], [2, 5, 8],
34
+ [0, 4, 8], [2, 4, 6],
35
+ ];
36
+
37
+ const state = reactive({
38
+ board: Array(9).fill(null),
39
+ currentPlayer: "X",
40
+ winner: null,
41
+ winLine: null,
42
+ scores: { X: 0, O: 0, draw: 0 },
43
+ });
44
+
45
+ const status = computed(() => {
46
+ if (!state.winner) return `${state.currentPlayer}'s turn`;
47
+ if (state.winner === "draw") return "It's a draw!";
48
+ return `${state.winner} wins!`;
49
+ });
50
+
51
+ const { board, currentPlayer, winner, winLine, scores } = toRefs(state);
52
+
53
+ function checkWin(board) {
54
+ for (const pattern of WIN_PATTERNS) {
55
+ const [a, b, c] = pattern;
56
+ if (board[a] && board[a] === board[b] && board[a] === board[c]) {
57
+ return { winner: board[a], winLine: pattern };
58
+ }
59
+ }
60
+ if (board.every((cell) => cell !== null)) return { winner: "draw", winLine: [] };
61
+ return null;
62
+ }
63
+
64
+ function fireConfettiEffect() {
65
+ const count = 200;
66
+ const defaults = { origin: { y: 0.7 } };
67
+ const fire = (particleRatio, opts) => {
68
+ confetti({ ...defaults, ...opts, particleCount: Math.floor(count * particleRatio) });
69
+ };
70
+ fire(0.25, { spread: 26, startVelocity: 55 });
71
+ fire(0.2, { spread: 60 });
72
+ fire(0.35, { spread: 100, decay: 0.91, scalar: 0.8 });
73
+ fire(0.1, { spread: 120, startVelocity: 25, decay: 0.92, scalar: 1.2 });
74
+ fire(0.1, { spread: 120, startVelocity: 45 });
75
+ }
76
+
77
+ function handleMove(index) {
78
+ if (state.board[index] || state.winner) return;
79
+ const board = [...state.board];
80
+ board[index] = state.currentPlayer;
81
+ const result = checkWin(board);
82
+ if (result) {
83
+ state.board = board;
84
+ state.winner = result.winner;
85
+ state.winLine = result.winLine;
86
+ if (result.winner === "draw") state.scores.draw++;
87
+ else state.scores[result.winner]++;
88
+ if (result.winner !== "draw") setTimeout(fireConfettiEffect, 100);
89
+ } else {
90
+ state.board = board;
91
+ state.currentPlayer = state.currentPlayer === "X" ? "O" : "X";
92
+ }
93
+ }
94
+
95
+ function handleReset() {
96
+ state.board = Array(9).fill(null);
97
+ state.currentPlayer = "X";
98
+ state.winner = null;
99
+ state.winLine = null;
100
+ }
101
+
102
+ const particlesOptions = {
103
+ fullScreen: { enable: true, zIndex: -1 },
104
+ background: { color: { value: "#0a0a1a" } },
105
+ fpsLimit: 60,
106
+ particles: {
107
+ number: { value: 30, density: { enable: true } },
108
+ color: { value: ["#6c5ce7", "#a29bfe"] },
109
+ shape: { type: "circle" },
110
+ opacity: { value: 0.2, random: true },
111
+ size: { value: { min: 1, max: 2 } },
112
+ move: { enable: true, speed: 0.5, direction: "none", random: true, straight: false, outModes: { default: "out" } },
113
+ },
114
+ detectRetina: true,
115
+ };
116
+ </script>
117
+
118
+ <style>
119
+ * {
120
+ box-sizing: border-box;
121
+ }
122
+ body {
123
+ margin: 0;
124
+ min-height: 100vh;
125
+ display: flex;
126
+ align-items: center;
127
+ justify-content: center;
128
+ background: #0a0a1a;
129
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
130
+ color: #fff;
131
+ }
132
+ #app {
133
+ text-align: center;
134
+ z-index: 10;
135
+ padding: 1rem;
136
+ }
137
+ h1 {
138
+ font-size: 2.5em;
139
+ margin-bottom: 1rem;
140
+ background: linear-gradient(135deg, #6c5ce7, #fd79a8);
141
+ -webkit-background-clip: text;
142
+ -webkit-text-fill-color: transparent;
143
+ background-clip: text;
144
+ }
145
+ .scoreboard {
146
+ display: flex;
147
+ justify-content: center;
148
+ gap: 2rem;
149
+ margin-bottom: 1rem;
150
+ font-size: 1.1em;
151
+ opacity: 0.8;
152
+ }
153
+ .turn {
154
+ font-size: 1.2em;
155
+ margin-bottom: 1rem;
156
+ opacity: 0.7;
157
+ }
158
+ .board {
159
+ display: grid;
160
+ grid-template-columns: repeat(3, 100px);
161
+ grid-template-rows: repeat(3, 100px);
162
+ gap: 4px;
163
+ background: rgba(255, 255, 255, 0.1);
164
+ border-radius: 12px;
165
+ overflow: hidden;
166
+ margin: 0 auto;
167
+ width: fit-content;
168
+ }
169
+ .cell {
170
+ display: flex;
171
+ align-items: center;
172
+ justify-content: center;
173
+ font-size: 2.5em;
174
+ font-weight: 700;
175
+ background: #12122a;
176
+ cursor: pointer;
177
+ transition: background 0.2s;
178
+ user-select: none;
179
+ }
180
+ .cell:hover {
181
+ background: #1a1a3a;
182
+ }
183
+ .cell.taken {
184
+ cursor: default;
185
+ }
186
+ .cell.win {
187
+ background: rgba(108, 92, 231, 0.3);
188
+ }
189
+ .reset-btn {
190
+ margin-top: 1.5rem;
191
+ padding: 0.7em 2em;
192
+ font-size: 1em;
193
+ font-weight: 600;
194
+ border: none;
195
+ border-radius: 8px;
196
+ background: linear-gradient(135deg, #6c5ce7, #a29bfe);
197
+ color: #fff;
198
+ cursor: pointer;
199
+ transition: transform 0.2s;
200
+ }
201
+ .reset-btn:hover {
202
+ transform: scale(1.05);
203
+ }
204
+ </style>
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "nuxt dev",
8
+ "build": "nuxt build",
9
+ "preview": "nuxt preview"
10
+ },
11
+ "dependencies": {
12
+ "nuxt": "^3.16.0",
13
+ "vue": "^3.5.32",
14
+ "@tsparticles/vue3": "^4.1.3"
15
+ }
16
+ }
@@ -0,0 +1,202 @@
1
+ <template>
2
+ <div>
3
+ <vue-particles id="tsparticles" :options="particlesOptions" />
4
+ <div id="app">
5
+ <h1>Tic-Tac-Toe</h1>
6
+ <div class="scoreboard">
7
+ <span>X: <strong>{{ scores.X }}</strong></span>
8
+ <span>Draws: <strong>{{ scores.draw }}</strong></span>
9
+ <span>O: <strong>{{ scores.O }}</strong></span>
10
+ </div>
11
+ <div class="turn">{{ status }}</div>
12
+ <div class="board">
13
+ <div
14
+ v-for="(cell, i) in board"
15
+ :key="i"
16
+ :class="['cell', { taken: cell, win: winLine?.includes(i) }]"
17
+ @click="handleMove(i)"
18
+ >
19
+ {{ cell }}
20
+ </div>
21
+ </div>
22
+ <button class="reset-btn" @click="handleReset">New Game</button>
23
+ </div>
24
+ </div>
25
+ </template>
26
+
27
+ <script setup>
28
+ import { reactive, computed } from "vue";
29
+ import { confetti } from "@tsparticles/confetti";
30
+
31
+ const WIN_PATTERNS = [
32
+ [0, 1, 2], [3, 4, 5], [6, 7, 8],
33
+ [0, 3, 6], [1, 4, 7], [2, 5, 8],
34
+ [0, 4, 8], [2, 4, 6],
35
+ ];
36
+
37
+ const state = reactive({
38
+ board: Array(9).fill(null),
39
+ currentPlayer: "X",
40
+ winner: null,
41
+ winLine: null,
42
+ scores: { X: 0, O: 0, draw: 0 },
43
+ });
44
+
45
+ const status = computed(() => {
46
+ if (!state.winner) return `${state.currentPlayer}'s turn`;
47
+ if (state.winner === "draw") return "It's a draw!";
48
+ return `${state.winner} wins!`;
49
+ });
50
+
51
+ function checkWin(board) {
52
+ for (const pattern of WIN_PATTERNS) {
53
+ const [a, b, c] = pattern;
54
+ if (board[a] && board[a] === board[b] && board[a] === board[c]) {
55
+ return { winner: board[a], winLine: pattern };
56
+ }
57
+ }
58
+ if (board.every((cell) => cell !== null)) return { winner: "draw", winLine: [] };
59
+ return null;
60
+ }
61
+
62
+ function fireConfettiEffect() {
63
+ const count = 200;
64
+ const defaults = { origin: { y: 0.7 } };
65
+ const fire = (particleRatio, opts) => {
66
+ confetti({ ...defaults, ...opts, particleCount: Math.floor(count * particleRatio) });
67
+ };
68
+ fire(0.25, { spread: 26, startVelocity: 55 });
69
+ fire(0.2, { spread: 60 });
70
+ fire(0.35, { spread: 100, decay: 0.91, scalar: 0.8 });
71
+ fire(0.1, { spread: 120, startVelocity: 25, decay: 0.92, scalar: 1.2 });
72
+ fire(0.1, { spread: 120, startVelocity: 45 });
73
+ }
74
+
75
+ function handleMove(index) {
76
+ if (state.board[index] || state.winner) return;
77
+ const board = [...state.board];
78
+ board[index] = state.currentPlayer;
79
+ const result = checkWin(board);
80
+ if (result) {
81
+ state.board = board;
82
+ state.winner = result.winner;
83
+ state.winLine = result.winLine;
84
+ if (result.winner === "draw") state.scores.draw++;
85
+ else state.scores[result.winner]++;
86
+ if (result.winner !== "draw") setTimeout(fireConfettiEffect, 100);
87
+ } else {
88
+ state.board = board;
89
+ state.currentPlayer = state.currentPlayer === "X" ? "O" : "X";
90
+ }
91
+ }
92
+
93
+ function handleReset() {
94
+ state.board = Array(9).fill(null);
95
+ state.currentPlayer = "X";
96
+ state.winner = null;
97
+ state.winLine = null;
98
+ }
99
+
100
+ const particlesOptions = {
101
+ fullScreen: { enable: true, zIndex: -1 },
102
+ background: { color: { value: "#0a0a1a" } },
103
+ fpsLimit: 60,
104
+ particles: {
105
+ number: { value: 30, density: { enable: true } },
106
+ color: { value: ["#6c5ce7", "#a29bfe"] },
107
+ shape: { type: "circle" },
108
+ opacity: { value: 0.2, random: true },
109
+ size: { value: { min: 1, max: 2 } },
110
+ move: { enable: true, speed: 0.5, direction: "none", random: true, straight: false, outModes: { default: "out" } },
111
+ },
112
+ detectRetina: true,
113
+ };
114
+ </script>
115
+
116
+ <style>
117
+ * {
118
+ box-sizing: border-box;
119
+ }
120
+ body {
121
+ margin: 0;
122
+ min-height: 100vh;
123
+ display: flex;
124
+ align-items: center;
125
+ justify-content: center;
126
+ background: #0a0a1a;
127
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
128
+ color: #fff;
129
+ }
130
+ #app {
131
+ text-align: center;
132
+ z-index: 10;
133
+ padding: 1rem;
134
+ }
135
+ h1 {
136
+ font-size: 2.5em;
137
+ margin-bottom: 1rem;
138
+ background: linear-gradient(135deg, #6c5ce7, #fd79a8);
139
+ -webkit-background-clip: text;
140
+ -webkit-text-fill-color: transparent;
141
+ background-clip: text;
142
+ }
143
+ .scoreboard {
144
+ display: flex;
145
+ justify-content: center;
146
+ gap: 2rem;
147
+ margin-bottom: 1rem;
148
+ font-size: 1.1em;
149
+ opacity: 0.8;
150
+ }
151
+ .turn {
152
+ font-size: 1.2em;
153
+ margin-bottom: 1rem;
154
+ opacity: 0.7;
155
+ }
156
+ .board {
157
+ display: grid;
158
+ grid-template-columns: repeat(3, 100px);
159
+ grid-template-rows: repeat(3, 100px);
160
+ gap: 4px;
161
+ background: rgba(255, 255, 255, 0.1);
162
+ border-radius: 12px;
163
+ overflow: hidden;
164
+ margin: 0 auto;
165
+ width: fit-content;
166
+ }
167
+ .cell {
168
+ display: flex;
169
+ align-items: center;
170
+ justify-content: center;
171
+ font-size: 2.5em;
172
+ font-weight: 700;
173
+ background: #12122a;
174
+ cursor: pointer;
175
+ transition: background 0.2s;
176
+ user-select: none;
177
+ }
178
+ .cell:hover {
179
+ background: #1a1a3a;
180
+ }
181
+ .cell.taken {
182
+ cursor: default;
183
+ }
184
+ .cell.win {
185
+ background: rgba(108, 92, 231, 0.3);
186
+ }
187
+ .reset-btn {
188
+ margin-top: 1.5rem;
189
+ padding: 0.7em 2em;
190
+ font-size: 1em;
191
+ font-weight: 600;
192
+ border: none;
193
+ border-radius: 8px;
194
+ background: linear-gradient(135deg, #6c5ce7, #a29bfe);
195
+ color: #fff;
196
+ cursor: pointer;
197
+ transition: transform 0.2s;
198
+ }
199
+ .reset-btn:hover {
200
+ transform: scale(1.05);
201
+ }
202
+ </style>
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "nuxt dev",
8
+ "build": "nuxt build",
9
+ "preview": "nuxt preview"
10
+ },
11
+ "dependencies": {
12
+ "nuxt": "^4.0.0",
13
+ "vue": "^3.5.32",
14
+ "@tsparticles/vue3": "^4.1.3"
15
+ }
16
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "private": true,
4
+ "version": "1.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc && vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "preact": "^10.26.0",
13
+ "@tsparticles/preact": "^4.1.3"
14
+ },
15
+ "devDependencies": {
16
+ "@preact/preset-vite": "^2.10.0",
17
+ "typescript": "~5.7.0",
18
+ "vite": "^6.0.0"
19
+ }
20
+ }