24 | {siteConfig.tagline}
25 |Default mode with Unicode chess pieces
23 |ASCII mode for better compatibility
34 |{description}
47 |latest;
27 | }
28 |
29 | return {version};
30 | }
31 |
32 | export function DockerCommands(): JSX.Element {
33 | const [version, setVersion] = useStatePull and run a specific version:
59 |
60 | {`docker pull ghcr.io/thomas-mauran/chess-tui:${tag}
61 | docker run --rm -it ghcr.io/thomas-mauran/chess-tui:${tag}`}
62 |
63 | Or run directly without pulling first:
64 |
65 | {`docker run --rm -it ghcr.io/thomas-mauran/chess-tui:${tag}`}
66 |
67 | >
68 | );
69 | }
70 |
71 |
--------------------------------------------------------------------------------
/src/constants.rs:
--------------------------------------------------------------------------------
1 | use core::fmt;
2 | use std::path::PathBuf;
3 |
4 | use ratatui::style::Color;
5 |
6 | pub const UNDEFINED_POSITION: u8 = u8::MAX;
7 | pub const WHITE: Color = Color::Rgb(160, 160, 160);
8 | pub const BLACK: Color = Color::Rgb(128, 95, 69);
9 |
10 | // Network constants
11 | pub const NETWORK_PORT: u16 = 2308;
12 | pub const NETWORK_BUFFER_SIZE: usize = 5;
13 | pub const SLEEP_DURATION_SHORT_MS: u64 = 50;
14 | pub const SLEEP_DURATION_LONG_MS: u64 = 100;
15 |
16 | pub const TITLE: &str = r"
17 | ██████╗██╗ ██╗███████╗███████╗███████╗ ████████╗██╗ ██╗██╗
18 | ██╔════╝██║ ██║██╔════╝██╔════╝██╔════╝ ╚══██╔══╝██║ ██║██║
19 | ██║ ███████║█████╗ ███████╗███████╗█████╗██║ ██║ ██║██║
20 | ██║ ██╔══██║██╔══╝ ╚════██║╚════██║╚════╝██║ ██║ ██║██║
21 | ╚██████╗██║ ██║███████╗███████║███████║ ██║ ╚██████╔╝██║
22 | ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝ ╚═╝ ╚═════╝ ╚═╝
23 | ";
24 |
25 | #[derive(Debug, Clone, Copy, PartialEq)]
26 | pub enum DisplayMode {
27 | DEFAULT,
28 | ASCII,
29 | CUSTOM,
30 | }
31 |
32 | impl fmt::Display for DisplayMode {
33 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
34 | match *self {
35 | DisplayMode::ASCII => write!(f, "ASCII"),
36 | DisplayMode::DEFAULT => write!(f, "DEFAULT"),
37 | DisplayMode::CUSTOM => write!(f, "CUSTOM"),
38 | }
39 | }
40 | }
41 |
42 | pub fn config_dir() -> Result
46 |
50 | Play online on Lichess directly from your terminal!
54 |
55 | See Lichess Features for details.
56 |
60 |
64 |