starting to abstract the game

This commit is contained in:
2025-08-28 22:20:24 -04:00
parent d69336027a
commit 0d6d3d6d32
8 changed files with 59 additions and 21 deletions

View File

@@ -14,6 +14,7 @@ import { createObservable, createObservableWithInit, cx } from "~/fn";
import { me, mePromise } from "~/profile";
import Game from "./Game";
import Player from "./Player";
import games from "@games/shared/games/index";
export const TableContext = createContext<{
view: Accessor<any>;
@@ -110,7 +111,14 @@ export default (props: { tableKey: string }) => {
}}
>
<Show when={view() == null}>
<div class="absolute center">
<div class="absolute tc mt-8 flex gap-4">
<select>
<For each={Object.entries(games)}>
{([gameId, game]) => (
<option value={gameId}>{game.title}</option>
)}
</For>
</select>
<button
onClick={() => setReady((prev) => !prev)}
class="button p-1 "

View File

@@ -25,20 +25,16 @@ export default defineConfig({
"bc",
{
bottom: 0,
left: 0,
right: 0,
"margin-left": "auto",
"margin-right": "auto",
left: "50%",
transform: "translateX(-50%)",
},
],
[
"tc",
{
top: 0,
left: 0,
right: 0,
"margin-left": "auto",
"margin-right": "auto",
left: "50%",
transform: "translateX(-50%)",
},
],