Skip to content

Commit

Permalink
Add vite front
Browse files Browse the repository at this point in the history
  • Loading branch information
vehlwn committed Jun 14, 2024
1 parent 171d486 commit efef62d
Show file tree
Hide file tree
Showing 15 changed files with 2,189 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/target
/.mypy_cache/
/Cargo.lock
node_modules/
dist/
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
actix-cors = "0.7.0"
actix-web = "4.7.0"
anyhow = "1.0.86"
clap = { version = "4.5.4", features = ["derive"] }
Expand Down
5 changes: 5 additions & 0 deletions front/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 85,
"tabWidth": 4,
"trailingComma": "none"
}
28 changes: 28 additions & 0 deletions front/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import globals from "globals";
import js from "@eslint/js";
import stylisticJs from "@stylistic/eslint-plugin-js";

export default [
js.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
plugins: {
"@stylistic/js": stylisticJs,
},
rules: {
"no-implicit-coercion": "error",
"no-var": "error",
"prefer-const": "warn",
curly: ["warn", "all"],
eqeqeq: ["warn", "always"],
radix: "warn",
strict: ["warn", "global"],
"@stylistic/js/operator-linebreak": ["error", "before"],
},
},
];
64 changes: 64 additions & 0 deletions front/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Chess Alpha Beta</title>

<link rel="stylesheet" href="assets/chessboard.css" />
<link rel="stylesheet" href="assets/extensions/markers/markers.css" />
<link
rel="stylesheet"
href="assets/extensions/promotion-dialog/promotion-dialog.css"
/>
<link rel="stylesheet" href="assets/extensions/arrows/arrows.css" />
<script type="module" src="/src/index.ts"></script>
</head>

<body>
<noscript>
<p style="color: red">This site requires JavaScript!</p>
</noscript>

<div id="game_mode_selector">
<label> Choose game mode: </label>
<button type="button" id="cc">Computer-Computer</button>
<button type="button" id="wubc">White user-Black computer</button>
<button type="button" id="buwc">Black user-White computer</button>
</div>

<div id="game_container" class="flex_container hidden">
<div>
<label>
Search depth
<input type="number" id="depth" min="1" max="10" />
</label>

<button type="button" id="switch_orientation">
Switch orientation
</button>

<button type="button" id="next_move" class="hidden">
Next move
</button>

<div id="board"></div>

<label id="turn"></label>
</div>

<div>
<div id="messages"></div>
</div>
</div>

<div class="hidden">
<svg xmlns="http://www.w3.org/2000/svg">
<g id="marker_highlight">
<rect width="40" height="40"></rect>
</g>
</svg>
</div>
</body>
</html>
Loading

0 comments on commit efef62d

Please sign in to comment.