diff --git a/src/ui/App.tsx b/src/ui/App.tsx index d1d8c17..accfb11 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -1,10 +1,9 @@ import type { Component } from "solid-js"; import type { DeepReadonly } from "solid-js/store"; -import Moves from "./components/Moves"; import Controls from "./components/Controls"; -import Load from "./components/Load"; import { Handlers } from "../types"; import { State } from "../state"; +import GameTabs from "./components/GameTabs"; import "./app.css"; @@ -19,8 +18,10 @@ const App: Component<{ handlers: Handlers; state: DeepReadonly }> = (
- {/* */} - +
); diff --git a/src/ui/app.css b/src/ui/app.css index 9bfdba9..85310a6 100644 --- a/src/ui/app.css +++ b/src/ui/app.css @@ -8,6 +8,7 @@ margin: 0; padding: 0; box-sizing: border-box; + outline: none; } html { @@ -49,8 +50,8 @@ body { display: grid; grid-template-columns: 1fr 2fr 1fr; grid-template-areas: - "setup board controls" - "setup board moves"; + "setup board moves" + "setup board controls"; } .moves-box { @@ -87,18 +88,6 @@ body { padding: 20px; } -.move { - display: inline-block; - width: 50%; - min-width: 150px; - text-align: left; -} - -.ply { - padding-left: 10px; - cursor: pointer; -} - @media screen and (max-width: 1024px) { .layout { grid-template-columns: 1fr; @@ -116,3 +105,7 @@ body { height: auto; } } + +::placeholder { + color: #677794; +} diff --git a/src/ui/components/GameTabs.tsx b/src/ui/components/GameTabs.tsx new file mode 100644 index 0000000..c03d1c2 --- /dev/null +++ b/src/ui/components/GameTabs.tsx @@ -0,0 +1,43 @@ +import { Component, createSignal, Switch, Match } from "solid-js"; +import Moves from "./Moves"; +import Load from "./Load"; +import { Handlers } from "../../types"; +import "./gameTabs.css"; + +const GameTabs: Component<{ moves: readonly string[]; handlers: Handlers }> = ( + props +) => { + const [tab, setTab] = createSignal("load"); + + return ( +
+ + + + + + + + + + +
+ ); +}; + +export default GameTabs; diff --git a/src/ui/components/Load.tsx b/src/ui/components/Load.tsx index 667658f..bb9348c 100644 --- a/src/ui/components/Load.tsx +++ b/src/ui/components/Load.tsx @@ -1,9 +1,7 @@ -import { Component, For } from "solid-js"; -import chunk_ from "@arrows/array/chunk_"; -import { Handlers } from "../../types"; +import { Component } from "solid-js"; import "./load.css"; -const Load: Component<{}> = (props) => { +const Load: Component = () => { return (
= (props) => { type="text" name="load-fen" placeholder="PASTE FEN..." + spellcheck={false} />
diff --git a/src/ui/components/Moves.tsx b/src/ui/components/Moves.tsx index ca4a54c..d326eec 100644 --- a/src/ui/components/Moves.tsx +++ b/src/ui/components/Moves.tsx @@ -1,6 +1,7 @@ import { Component, For } from "solid-js"; import chunk_ from "@arrows/array/chunk_"; import { Handlers } from "../../types"; +import "./moves.css"; const Moves: Component<{ moves: readonly string[]; handlers: Handlers }> = ( props @@ -12,21 +13,21 @@ const Moves: Component<{ moves: readonly string[]; handlers: Handlers }> = ( const [white, black] = move as [string, string]; return ( -

- {i() + 1}. +

+ {i() + 1}. props.handlers.goto(i() * 2 + 1)} > {white} props.handlers.goto(i() * 2 + 2)} > {black} -

+
); }} diff --git a/src/ui/components/gameTabs.css b/src/ui/components/gameTabs.css new file mode 100644 index 0000000..c3aeb5a --- /dev/null +++ b/src/ui/components/gameTabs.css @@ -0,0 +1,23 @@ +.game-tabs { + margin: 10px; + /* height: 100%; */ +} + +.game-tabs__btn { + width: 50%; + background: #2a2c38; + padding: 10px; + font-family: Ubuntu; + font-size: 1.5rem; + color: rgb(0, 207, 162); + border-top-left-radius: 5px; + border-top-right-radius: 5px; + cursor: pointer; +} + +.game-tabs__btn--active { + width: 50%; + background: #13141a; + color: rgb(0, 173, 136); + cursor: default; +} diff --git a/src/ui/components/load.css b/src/ui/components/load.css index 39401e5..8854fff 100644 --- a/src/ui/components/load.css +++ b/src/ui/components/load.css @@ -1,26 +1,42 @@ .load { - background: black; + background: #13141a; padding: 20px; } -.load__fen-input { - width: 100%; - padding: 10px; - font-family: "Fira Mono"; - font-size: 1.4rem; -} - +.load__fen-input, .load__pgn-input { width: 100%; padding: 10px; font-family: "Fira Mono"; font-size: 1.4rem; + margin-bottom: 10px; + background: #20242a; + border: solid 1px #2d323a; + color: #acbddb; + outline: none; +} + +.load__fen-input:focus, +.load__pgn-input:focus { + border-color: rgb(0, 87, 68); +} + +.load__pgn-input { + height: 30vh; + margin-top: 20px; } .load__fen-btn, .load__pgn-btn { width: 100%; padding: 10px; - font-family: "Fira Mono"; - font-size: 1.4rem; + font-family: "Ubuntu"; + font-size: 1.5rem; + background: rgb(0, 173, 136); +} + +.load__fen-btn:hover, +.load__pgn-btn:hover { + background: rgb(0, 207, 162); + cursor: pointer; } diff --git a/src/ui/components/moves.css b/src/ui/components/moves.css new file mode 100644 index 0000000..3289f75 --- /dev/null +++ b/src/ui/components/moves.css @@ -0,0 +1,29 @@ +.moves { + background: #13141a; + font-size: 1.4rem; + font-family: "Fira Mono"; + text-align: left; +} + +.move { + display: inline-block; + padding: 3px; +} + +.move__id { + display: inline-block; + width: 40px; + text-align: right; + margin-right: 10px; +} + +.move__ply { + display: inline-block; + width: 60px; + color: rgb(0, 173, 136); +} + +.move__ply:hover { + text-decoration: underline; + cursor: pointer; +}