feat: new boared design

This commit is contained in:
shahdlala66
2026-04-26 13:34:55 +02:00
parent dc9a7b2e32
commit 671886781e
69 changed files with 546 additions and 352 deletions
+14 -4
View File
@@ -28,8 +28,13 @@
}, },
{ {
"glob": "**/*", "glob": "**/*",
"input": "arabian-chess", "input": "assets/arabian-chess",
"output": "/arabian-chess" "output": "/assets/arabian-chess"
},
{
"glob": "**/*",
"input": "assets/ChessAssets",
"output": "/assets/ChessAssets"
} }
], ],
"styles": [ "styles": [
@@ -99,8 +104,13 @@
}, },
{ {
"glob": "**/*", "glob": "**/*",
"input": "arabian-chess", "input": "assets/arabian-chess",
"output": "/arabian-chess" "output": "/assets/arabian-chess"
},
{
"glob": "**/*",
"input": "assets/ChessAssets",
"output": "/assets/ChessAssets"
} }
], ],
"styles": [ "styles": [
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Before

Width:  |  Height:  |  Size: 518 KiB

After

Width:  |  Height:  |  Size: 518 KiB

Before

Width:  |  Height:  |  Size: 4.8 MiB

After

Width:  |  Height:  |  Size: 4.8 MiB

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Before

Width:  |  Height:  |  Size: 907 B

After

Width:  |  Height:  |  Size: 907 B

Before

Width:  |  Height:  |  Size: 919 B

After

Width:  |  Height:  |  Size: 919 B

Before

Width:  |  Height:  |  Size: 818 B

After

Width:  |  Height:  |  Size: 818 B

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Before

Width:  |  Height:  |  Size: 161 B

After

Width:  |  Height:  |  Size: 161 B

Before

Width:  |  Height:  |  Size: 188 B

After

Width:  |  Height:  |  Size: 188 B

Before

Width:  |  Height:  |  Size: 188 B

After

Width:  |  Height:  |  Size: 188 B

Before

Width:  |  Height:  |  Size: 237 B

After

Width:  |  Height:  |  Size: 237 B

Before

Width:  |  Height:  |  Size: 243 B

After

Width:  |  Height:  |  Size: 243 B

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 264 B

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 244 B

Before

Width:  |  Height:  |  Size: 240 B

After

Width:  |  Height:  |  Size: 240 B

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 232 B

Before

Width:  |  Height:  |  Size: 287 B

After

Width:  |  Height:  |  Size: 287 B

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 211 B

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 238 B

Before

Width:  |  Height:  |  Size: 227 B

After

Width:  |  Height:  |  Size: 227 B

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 267 B

Before

Width:  |  Height:  |  Size: 300 B

After

Width:  |  Height:  |  Size: 300 B

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 218 B

Before

Width:  |  Height:  |  Size: 244 B

After

Width:  |  Height:  |  Size: 244 B

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 245 B

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 229 B

Before

Width:  |  Height:  |  Size: 286 B

After

Width:  |  Height:  |  Size: 286 B

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 245 B

Before

Width:  |  Height:  |  Size: 266 B

After

Width:  |  Height:  |  Size: 266 B

Before

Width:  |  Height:  |  Size: 297 B

After

Width:  |  Height:  |  Size: 297 B

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 258 B

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 263 B

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 313 B

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 251 B

Before

Width:  |  Height:  |  Size: 275 B

After

Width:  |  Height:  |  Size: 275 B

Before

Width:  |  Height:  |  Size: 305 B

After

Width:  |  Height:  |  Size: 305 B

Before

Width:  |  Height:  |  Size: 281 B

After

Width:  |  Height:  |  Size: 281 B

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 280 B

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

@@ -42,11 +42,41 @@
} }
.square.light { .square.light {
background-image: url('/arabian-chess/sprites/board/board_square_white.png'); background-image: url('/assets/arabian-chess/sprites/board/board_square_white.png');
} }
.square.dark { .square.dark {
background-image: url('/arabian-chess/sprites/board/board_square_black.png'); background-image: url('/assets/arabian-chess/sprites/board/board_square_black.png');
}
.board-grid--classic {
border-radius: var(--border-radius-md);
}
.board-grid--classic .square {
background-image: none;
transition: filter 160ms ease;
}
.board-grid--classic .square.light {
background-color: #f3c8a0;
}
.board-grid--classic .square.dark {
background-color: #ba6d4b;
}
.board-grid--classic .square.drag-over {
outline-color: #5a2c28;
}
.board-grid--classic .square.selected {
outline-color: #5a2c28;
}
.board-grid--classic .square.highlighted::after {
background: #b9dad1;
border-color: #5a2c28;
} }
.square.highlighted::after { .square.highlighted::after {
@@ -1,5 +1,5 @@
<div class="board-shell"> <div class="board-shell">
<div class="board-grid"> <div class="board-grid" [class.board-grid--classic]="boardTheme === 'classic'" [class.board-grid--arabian]="boardTheme === 'arabian'">
@for (square of squares; track trackByCoordinate($index, square)) { @for (square of squares; track trackByCoordinate($index, square)) {
<button <button
type="button" type="button"
@@ -17,6 +17,7 @@
> >
<app-chess-piece <app-chess-piece
[pieceCode]="square.pieceCode" [pieceCode]="square.pieceCode"
[boardTheme]="boardTheme"
[draggable]="!!square.pieceCode" [draggable]="!!square.pieceCode"
(pieceDragStart)="onPieceDragStart($event, square)" (pieceDragStart)="onPieceDragStart($event, square)"
(pieceDragEnd)="onSquareDragEnd()" (pieceDragEnd)="onSquareDragEnd()"
@@ -25,5 +26,7 @@
} }
</div> </div>
<img class="board-bottom" src="/arabian-chess/sprites/board/board_bottom.png" alt="Board frame" /> @if (boardTheme === 'arabian') {
<img class="board-bottom" src="/assets/arabian-chess/sprites/board/board_bottom.png" alt="Board frame" />
}
</div> </div>
@@ -7,6 +7,8 @@ interface BoardSquare {
pieceCode: string | null; pieceCode: string | null;
} }
type BoardTheme = 'arabian' | 'classic';
@Component({ @Component({
selector: 'app-chess-board', selector: 'app-chess-board',
standalone: true, standalone: true,
@@ -18,6 +20,7 @@ export class ChessBoardComponent implements OnChanges {
@Input({ required: true }) fen = ''; @Input({ required: true }) fen = '';
@Input() selectedSquare: string | null = null; @Input() selectedSquare: string | null = null;
@Input() highlightedSquares: string[] = []; @Input() highlightedSquares: string[] = [];
@Input() boardTheme: BoardTheme = 'arabian';
@Output() squareSelected = new EventEmitter<string>(); @Output() squareSelected = new EventEmitter<string>();
squares: BoardSquare[] = []; squares: BoardSquare[] = [];
@@ -1,5 +1,7 @@
import { Component, EventEmitter, Input, Output } from '@angular/core'; import { Component, EventEmitter, Input, Output } from '@angular/core';
type BoardTheme = 'arabian' | 'classic';
@Component({ @Component({
selector: 'app-chess-piece', selector: 'app-chess-piece',
standalone: true, standalone: true,
@@ -8,6 +10,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
}) })
export class ChessPieceComponent { export class ChessPieceComponent {
@Input({ required: true }) pieceCode: string | null = null; @Input({ required: true }) pieceCode: string | null = null;
@Input() boardTheme: BoardTheme = 'arabian';
@Input() draggable = false; @Input() draggable = false;
@Output() pieceDragStart = new EventEmitter<DragEvent>(); @Output() pieceDragStart = new EventEmitter<DragEvent>();
@Output() pieceDragEnd = new EventEmitter<void>(); @Output() pieceDragEnd = new EventEmitter<void>();
@@ -30,12 +33,21 @@ export class ChessPieceComponent {
return ''; return '';
} }
const color = this.pieceCode === this.pieceCode.toUpperCase() ? 'white' : 'black'; const isWhite = this.pieceCode === this.pieceCode.toUpperCase();
const pieceName = this.getPieceName(this.pieceCode.toLowerCase()); const pieceCode = this.pieceCode.toLowerCase();
return `/arabian-chess/sprites/pieces/${color}_${pieceName}.png`;
if (this.boardTheme === 'classic') {
const colorPrefix = isWhite ? 'w' : 'b';
const classicPieceName = this.getClassicPieceName(pieceCode);
return `/assets/ChessAssets/${colorPrefix}_${classicPieceName}.png`;
}
const arabianColor = isWhite ? 'white' : 'black';
const arabianPieceName = this.getArabianPieceName(pieceCode);
return `/assets/arabian-chess/sprites/pieces/${arabianColor}_${arabianPieceName}.png`;
} }
private getPieceName(piece: string): string { private getArabianPieceName(piece: string): string {
switch (piece) { switch (piece) {
case 'k': case 'k':
return 'king'; return 'king';
@@ -53,4 +65,23 @@ export class ChessPieceComponent {
return 'pawn'; return 'pawn';
} }
} }
private getClassicPieceName(piece: string): string {
switch (piece) {
case 'k':
return 'King';
case 'q':
return 'Queen';
case 'r':
return 'Rook';
case 'b':
return 'Bishop';
case 'n':
return 'Knight';
case 'p':
return 'Pawn';
default:
return 'Pawn';
}
}
} }
+33
View File
@@ -48,6 +48,39 @@ h2 {
flex: 0 0 auto; flex: 0 0 auto;
} }
.board-theme-card {
background: var(--color-bg-card);
border: var(--border-width) solid var(--color-border);
border-radius: var(--border-radius-md);
padding: var(--size-md-padding);
display: grid;
gap: var(--size-sm);
}
.board-theme-card h3 {
margin: 0;
color: var(--color-text-primary);
font-size: 1rem;
}
.board-theme-group {
display: flex;
gap: var(--size-md);
flex-wrap: wrap;
}
.board-theme-option {
display: inline-flex;
align-items: center;
gap: var(--size-xs);
color: var(--color-text-primary);
font-weight: 600;
}
.board-theme-option input {
accent-color: var(--color-primary);
}
.move-card { .move-card {
padding: var(--size-lg-padding); padding: var(--size-lg-padding);
} }
+26
View File
@@ -48,11 +48,37 @@
[fen]="facade.state.fen" [fen]="facade.state.fen"
[selectedSquare]="facade.selectedSquare" [selectedSquare]="facade.selectedSquare"
[highlightedSquares]="facade.highlightedSquares" [highlightedSquares]="facade.highlightedSquares"
[boardTheme]="boardTheme"
(squareSelected)="facade.onBoardSquareSelected($event)" (squareSelected)="facade.onBoardSquareSelected($event)"
/> />
</div> </div>
<section class="top-section"> <section class="top-section">
<section class="board-theme-card" aria-label="Board design chooser">
<h3>Board Design</h3>
<div class="board-theme-group" role="radiogroup" aria-label="Board design">
<label class="board-theme-option">
<input
type="radio"
name="boardTheme"
[checked]="boardTheme === 'arabian'"
(change)="setBoardTheme('arabian')"
/>
<span>Arabian</span>
</label>
<label class="board-theme-option">
<input
type="radio"
name="boardTheme"
[checked]="boardTheme === 'classic'"
(change)="setBoardTheme('classic')"
/>
<span>Classic</span>
</label>
</div>
</section>
<app-input-card <app-input-card
label="Play move (UCI)" label="Play move (UCI)"
placeholder="e2e4" placeholder="e2e4"
+14
View File
@@ -9,6 +9,7 @@ import { PromotionDialogComponent } from '../../components/promotion-dialog/prom
import { GameFacade } from './game.facade'; import { GameFacade } from './game.facade';
type TimerTurn = 'white' | 'black'; type TimerTurn = 'white' | 'black';
type BoardTheme = 'arabian' | 'classic';
interface TimerSnapshot { interface TimerSnapshot {
whiteSeconds: number; whiteSeconds: number;
@@ -27,18 +28,21 @@ interface TimerSnapshot {
}) })
export class GameComponent implements OnInit, OnDestroy { export class GameComponent implements OnInit, OnDestroy {
private static readonly TIMER_START_SECONDS = 10 * 60; private static readonly TIMER_START_SECONDS = 10 * 60;
private static readonly BOARD_THEME_STORAGE_KEY = 'nowchess.boardTheme';
private readonly route = inject(ActivatedRoute); private readonly route = inject(ActivatedRoute);
private readonly destroyRef = inject(DestroyRef); private readonly destroyRef = inject(DestroyRef);
readonly facade = inject(GameFacade); readonly facade = inject(GameFacade);
whiteTimerSeconds = GameComponent.TIMER_START_SECONDS; whiteTimerSeconds = GameComponent.TIMER_START_SECONDS;
blackTimerSeconds = GameComponent.TIMER_START_SECONDS; blackTimerSeconds = GameComponent.TIMER_START_SECONDS;
exportType: 'fen' | 'pgn' = 'fen'; exportType: 'fen' | 'pgn' = 'fen';
boardTheme: BoardTheme = 'arabian';
exportValue = ''; exportValue = '';
exportNotice = ''; exportNotice = '';
private timerIntervalId: number | null = null; private timerIntervalId: number | null = null;
private activeGameId = ''; private activeGameId = '';
ngOnInit(): void { ngOnInit(): void {
this.boardTheme = this.resolveStoredBoardTheme();
this.startDummyTimers(); this.startDummyTimers();
this.route.paramMap.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((paramMap) => { this.route.paramMap.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((paramMap) => {
@@ -70,6 +74,11 @@ export class GameComponent implements OnInit, OnDestroy {
this.syncExportValue(); this.syncExportValue();
} }
setBoardTheme(theme: BoardTheme): void {
this.boardTheme = theme;
localStorage.setItem(GameComponent.BOARD_THEME_STORAGE_KEY, theme);
}
completeExport(): void { completeExport(): void {
this.syncExportValue(); this.syncExportValue();
if (!this.exportValue.trim()) { if (!this.exportValue.trim()) {
@@ -220,4 +229,9 @@ export class GameComponent implements OnInit, OnDestroy {
private getTimerStorageKey(gameId: string): string { private getTimerStorageKey(gameId: string): string {
return `nowchess.timer.${gameId}`; return `nowchess.timer.${gameId}`;
} }
private resolveStoredBoardTheme(): BoardTheme {
const stored = localStorage.getItem(GameComponent.BOARD_THEME_STORAGE_KEY);
return stored === 'classic' ? 'classic' : 'arabian';
}
} }
+329 -311
View File
@@ -1,22 +1,67 @@
.welcome-shell { .welcome-shell {
min-height: 100vh; --city-sky-top: #dbefff;
--city-sky-mid: #bfd7eb;
--city-sky-bottom: #95b3ca;
--city-fog: rgba(168, 203, 226, 0.35);
--city-building-a: #8ba8be;
--city-building-b: #7696af;
--city-building-c: #6787a3;
--city-building-edge: rgba(230, 247, 255, 0.2);
--city-window: #bdeeff;
--city-window-soft: rgba(189, 238, 255, 0.25);
--city-billboard-bg: rgba(223, 246, 255, 0.92);
--city-billboard-border: rgba(111, 161, 195, 0.6);
--city-billboard-text: #21435a;
--city-panel-bg: rgba(235, 248, 255, 0.9);
--city-panel-border: rgba(122, 170, 201, 0.55);
--city-panel-input: rgba(255, 255, 255, 0.92);
min-height: 100svh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between;
align-items: center; align-items: center;
justify-content: center; padding: clamp(1rem, 2.3vw, 1.75rem);
padding: var(--size-xl);
position: relative; position: relative;
overflow: hidden;
background: linear-gradient(180deg, var(--city-sky-top) 0%, var(--city-sky-mid) 58%, var(--city-sky-bottom) 100%);
}
:host-context([data-theme='dark']) .welcome-shell {
--city-sky-top: #010f1f;
--city-sky-mid: #051424;
--city-sky-bottom: #00626e;
--city-fog: rgba(0, 218, 243, 0.14);
--city-building-a: #122131;
--city-building-b: #1c2b3c;
--city-building-c: #273647;
--city-building-edge: rgba(255, 255, 255, 0.08);
--city-window: #00e5ff;
--city-window-soft: rgba(0, 229, 255, 0.22);
--city-billboard-bg: rgba(0, 218, 243, 0.16);
--city-billboard-border: rgba(0, 229, 255, 0.45);
--city-billboard-text: #d4e4fa;
--city-panel-bg: rgba(18, 33, 49, 0.88);
--city-panel-border: rgba(0, 218, 243, 0.35);
--city-panel-input: rgba(5, 20, 36, 0.88);
}
.sky-vignette {
position: absolute;
inset: 0;
pointer-events: none;
background: linear-gradient(180deg, transparent 45%, var(--city-fog) 100%);
opacity: 0.9;
} }
.clouds-container { .clouds-container {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: flex-start; align-items: flex-start;
gap: 60px; gap: clamp(1.25rem, 4vw, 3.5rem);
width: 100%; width: 100%;
max-width: 900px; max-width: 980px;
margin-bottom: var(--size-xl); margin-top: clamp(2.8rem, 6vh, 5.2rem);
position: relative;
z-index: 1; z-index: 1;
} }
@@ -27,7 +72,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.12)); filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.18));
} }
.plane-body { .plane-body {
@@ -54,7 +99,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.12)); filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
} }
.cloud::before { .cloud::before {
@@ -85,91 +130,288 @@
height: 100px; height: 100px;
object-fit: contain; object-fit: contain;
z-index: 10; z-index: 10;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
position: relative; position: relative;
} }
.gif-with-halo { .welcome-intro {
position: relative; position: relative;
display: inline-block; z-index: 2;
} margin-top: clamp(0.4rem, 1.1vh, 1rem);
text-align: center;
.gif-with-halo::before {
content: '';
position: absolute;
top: -10px;
left: 50%;
transform: translateX(-50%);
width: 75px;
height: 15px;
border: 2px solid rgba(255, 215, 0, 0.7);
border-radius: 50%;
box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
z-index: 5;
}
.welcome-card {
width: min(900px, 100%);
border-radius: var(--border-radius-lg);
border: var(--border-width) solid var(--color-border);
background: var(--color-bg-main);
padding: var(--size-xl-padding);
box-shadow: var(--shadow-md);
} }
h1 { h1 {
margin: 0 0 var(--size-xs); margin: 0;
color: var(--color-text-primary); color: var(--city-billboard-text);
font-size: var(--heading-h1); font-size: clamp(1.65rem, 3.6vw, 2.65rem);
letter-spacing: 0.04em;
text-transform: uppercase;
} }
p { p {
margin: 0 0 var(--size-lg); margin: 0;
color: var(--city-billboard-text);
} }
.mode-grid { .welcome-intro p {
margin-top: 0.25rem;
opacity: 0.9;
font-size: clamp(0.88rem, 1.6vw, 1.02rem);
}
.skyline-controls {
position: relative;
width: min(1200px, 100%);
min-height: clamp(280px, 43vh, 500px);
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); grid-template-columns: repeat(4, minmax(110px, 1fr));
gap: var(--size-xl-gap); gap: clamp(0.6rem, 1.2vw, 1.2rem);
align-items: end;
z-index: 2;
padding-inline: clamp(0.2rem, 1.2vw, 0.9rem);
margin-top: auto;
}
.tower {
--tower-height: clamp(210px, 38vh, 430px);
position: relative;
height: var(--tower-height);
border-radius: 14px 14px 0 0;
overflow: visible;
background: linear-gradient(180deg, var(--city-building-b) 0%, var(--city-building-a) 65%, var(--city-building-c) 100%);
border: 1px solid var(--city-building-edge);
box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.2);
}
.tower::before {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 48%, transparent 52%);
opacity: 0.55;
pointer-events: none;
}
.tower-windows {
position: absolute;
left: 18%;
right: 18%;
bottom: 22px;
display: grid;
gap: 14px;
}
.tower-windows span {
height: 2px;
border-radius: 999px;
background: var(--city-window);
box-shadow: 0 0 5px var(--city-window);
opacity: 0.28;
}
.tower-bot {
--tower-height: clamp(245px, 48vh, 520px);
}
.tower-1v1 {
--tower-height: clamp(200px, 39vh, 430px);
}
.tower-join {
--tower-height: clamp(225px, 44vh, 480px);
}
.tower-import {
--tower-height: clamp(265px, 51vh, 560px);
} }
.mode { .mode {
border: var(--border-width) solid var(--color-border); border-radius: 0.8rem;
border-radius: var(--border-radius-md); border: 1px solid var(--city-billboard-border);
padding: var(--size-lg-padding); background: var(--city-billboard-bg);
color: var(--city-billboard-text);
backdrop-filter: blur(4px);
text-align: left; text-align: left;
display: grid; display: grid;
gap: var(--size-xs); gap: 0.2rem;
transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.mode-billboard {
position: absolute;
left: 12%;
right: 12%;
top: 0;
transform: translateY(-56%);
padding: 0.8rem 0.9rem;
} }
.mode span { .mode span {
font-size: 1.15rem; font-size: clamp(0.95rem, 1.4vw, 1.12rem);
color: var(--color-text-primary); font-weight: 700;
letter-spacing: 0.02em;
} }
.mode small { .mode small {
color: var(--color-text-primary); color: var(--city-billboard-text);
opacity: 0.9; opacity: 0.85;
font-size: 0.75rem;
} }
.mode-active { .mode-active {
background: var(--color-secondary-mint);
cursor: pointer; cursor: pointer;
} }
.mode-active:hover:enabled { .mode-active:hover:enabled {
background: var(--color-secondary-blue); transform: translateY(-60%) scale(1.01);
box-shadow: 0 0 22px var(--city-window-soft);
} }
.mode-disabled { .mode-active:disabled {
background: var(--color-bg-card); opacity: 0.6;
opacity: 0.75; cursor: not-allowed;
}
.interaction-deck {
width: min(880px, 100%);
display: grid;
gap: 0.7rem;
margin-top: 0.45rem;
margin-bottom: clamp(0.5rem, 1.4vh, 0.95rem);
z-index: 3;
}
.difficulty-selector,
.join-game-form,
.import-game-form {
background: var(--city-panel-bg);
border: 1px solid var(--city-panel-border);
border-radius: 12px;
padding: 0.8rem;
backdrop-filter: blur(6px);
}
.difficulty-selector p,
.join-game-form p,
.import-game-form p {
margin: 0 0 0.65rem;
font-weight: 600;
}
.difficulty-buttons {
display: flex;
gap: 0.55rem;
flex-wrap: wrap;
}
.difficulty-btn {
flex: 1;
min-width: 78px;
padding: 0.45rem 0.65rem;
border: 1px solid var(--city-panel-border);
border-radius: 9px;
cursor: pointer;
font-weight: 600;
background: rgba(170, 226, 255, 0.68);
color: var(--city-billboard-text);
}
.difficulty-btn:hover:enabled {
filter: brightness(0.96);
}
.join-game-input-group {
display: flex;
gap: 0.5rem;
flex-wrap: wrap;
}
.join-game-input,
.import-game-text {
width: 100%;
border: 1px solid var(--city-panel-border);
border-radius: 9px;
background: var(--city-panel-input);
color: var(--city-billboard-text);
font-family: inherit;
}
.join-game-input {
flex: 1;
min-width: 155px;
padding: 0.58rem 0.72rem;
font-size: 0.95rem;
}
.import-game-text {
margin-top: 0.55rem;
margin-bottom: 0.55rem;
min-height: 110px;
resize: vertical;
padding: 0.58rem 0.72rem;
font-size: 0.95rem;
}
.join-game-input:focus,
.import-game-text:focus {
outline: none;
border-color: var(--city-window);
box-shadow: 0 0 0 2px var(--city-window-soft);
}
.import-mode-group {
display: flex;
gap: 0.8rem;
margin-bottom: 0.5rem;
}
.import-mode-option {
display: inline-flex;
align-items: center;
gap: 0.35rem;
font-size: 0.92rem;
}
.join-game-btn {
padding: 0.52rem 0.72rem;
border-radius: 9px;
border: 1px solid var(--city-panel-border);
cursor: pointer;
font-weight: 600;
color: var(--city-billboard-text);
}
.join-game-btn.join {
background: rgba(170, 226, 255, 0.68);
}
.join-game-btn.join:hover:enabled {
filter: brightness(0.95);
}
.join-game-btn.cancel {
background: rgba(238, 243, 252, 0.82);
}
.join-game-btn.cancel:hover:enabled {
filter: brightness(0.96);
}
.join-game-btn:disabled,
.difficulty-btn:disabled {
opacity: 0.56;
cursor: not-allowed;
} }
.error { .error {
color: var(--color-text-primary); margin-top: 0.05rem;
font-weight: 700; margin-bottom: 0;
margin-top: var(--size-xl); color: #ffd0d0;
background: rgba(146, 0, 16, 0.45);
border: 1px solid rgba(255, 170, 170, 0.6);
border-radius: 9px;
padding: 0.5rem 0.65rem;
font-weight: 600;
} }
.plane-left { .plane-left {
@@ -187,281 +429,57 @@ p {
} }
@keyframes float { @keyframes float {
0%, 100% { 0%,
transform: translateY(0px); 100% {
transform: translateY(0);
} }
50% { 50% {
transform: translateY(-15px); transform: translateY(-12px);
} }
} }
@media (max-width: 768px) { @media (max-width: 900px) {
.welcome-shell {
padding: var(--size-lg);
}
.clouds-container { .clouds-container {
gap: 30px; gap: 1rem;
margin-bottom: var(--size-lg);
} }
.plane { .skyline-controls {
width: 240px; grid-template-columns: repeat(2, minmax(130px, 1fr));
height: 110px; min-height: clamp(350px, 53vh, 620px);
} }
.plane-gif { .tower {
width: 55px; --tower-height: clamp(170px, 25vh, 280px);
height: 55px; }
transform: translateX(-20px) translateY(12px); }
@media (max-width: 560px) {
.welcome-shell {
padding: 0.75rem;
} }
.cloud { .skyline-controls {
width: 170px; gap: 0.45rem;
height: 75px; min-height: clamp(360px, 57vh, 650px);
} }
.cloud::before { .mode-billboard {
width: 65px; left: 10%;
height: 65px; right: 10%;
box-shadow: 40px 0 0 7px #ffffff, 80px 0 0 3px #ffffff, 20px -13px 0 10px #ffffff, 60px -10px 0 8px #ffffff; padding: 0.72rem 0.72rem;
}
.cloud::after {
width: 170px;
height: 38px;
}
.cloud-gif {
width: 140px;
height: 140px;
}
.gif-with-halo::before {
top: -8px;
width: 80px;
height: 12px;
border: 1.5px solid rgba(255, 215, 0, 0.7);
}
.welcome-card {
padding: var(--size-xl);
}
h1 {
font-size: var(--heading-h1-mobile);
}
p {
font-size: 0.875rem;
margin: 0 0 var(--size-lg);
}
.mode-grid {
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
gap: var(--size-md-gap);
}
.mode {
padding: var(--size-md-padding);
gap: var(--size-xs-gap);
} }
.mode span { .mode span {
font-size: 1rem; font-size: 0.9rem;
} }
.mode small { .mode small {
font-size: 0.7rem; font-size: 0.7rem;
} }
.error { .interaction-deck {
font-size: 0.75rem; margin-top: 0.3rem;
margin-bottom: 0.45rem;
} }
} }
@media (max-width: 480px) {
.welcome-shell {
padding: var(--size-sm);
}
.welcome-card {
padding: var(--size-lg-padding);
border-radius: var(--border-radius-md);
}
h1 {
font-size: var(--heading-h1-small);
margin: 0 0 var(--size-xs);
}
p {
font-size: 0.8rem;
margin: 0 0 var(--size-md);
}
.mode-grid {
grid-template-columns: 1fr;
}
.mode {
padding: var(--size-md-padding);
}
.mode span {
font-size: 0.95rem;
}
}
.difficulty-selector {
grid-column: 1 / -1;
background: var(--color-bg-card);
border: var(--border-width) solid var(--color-border);
border-radius: var(--border-radius-md);
padding: var(--size-lg-padding);
margin: var(--size-md) 0;
}
.difficulty-selector p {
margin: 0 0 var(--size-md);
font-weight: 600;
}
.difficulty-buttons {
display: flex;
gap: var(--size-md-gap);
flex-wrap: wrap;
}
.difficulty-btn {
flex: 1;
min-width: 80px;
padding: var(--size-md-padding);
border: var(--border-width) solid var(--color-border);
border-radius: var(--border-radius-md);
cursor: pointer;
font-weight: 600;
transition: all 0.3s ease;
}
.difficulty-btn.easy {
background: var(--color-success-light, #d4edda);
color: var(--color-text-primary);
}
.difficulty-btn.easy:hover:enabled {
background: var(--color-success, #28a745);
color: white;
}
.difficulty-btn.medium {
background: var(--color-warning-light, #fff3cd);
color: var(--color-text-primary);
}
.difficulty-btn.medium:hover:enabled {
background: var(--color-warning, #ffc107);
color: var(--color-text-primary);
}
.difficulty-btn.hard {
background: var(--color-danger-light, #f8d7da);
color: var(--color-text-primary);
}
.difficulty-btn.hard:hover:enabled {
background: var(--color-danger, #dc3545);
color: white;
}
.join-game-form {
grid-column: 1 / -1;
background: var(--color-bg-card);
border: var(--border-width) solid var(--color-border);
border-radius: var(--border-radius-md);
padding: var(--size-lg-padding);
margin: var(--size-md) 0;
}
.join-game-form p {
margin: 0 0 var(--size-md);
font-weight: 600;
}
.join-game-input-group {
display: flex;
gap: var(--size-md-gap);
flex-wrap: wrap;
}
.join-game-input {
flex: 1;
min-width: 150px;
padding: var(--size-md-padding);
border: var(--border-width) solid var(--color-border);
border-radius: var(--border-radius-md);
background: var(--color-bg-input);
color: var(--color-text-primary);
font-family: inherit;
font-size: 1rem;
transition: border-color 0.3s ease;
}
.join-game-input:focus {
outline: none;
border-color: var(--color-secondary-mint);
box-shadow: 0 0 0 3px rgba(185, 218, 209, 0.2);
}
.join-game-input:disabled {
background: var(--color-bg-card);
opacity: 0.6;
}
.join-game-btn {
padding: var(--size-md-padding) var(--size-lg);
border: var(--border-width) solid var(--color-border);
border-radius: var(--border-radius-md);
cursor: pointer;
font-weight: 600;
font-size: 0.95rem;
transition: all 0.3s ease;
}
.join-game-btn.join {
background: var(--color-secondary-mint);
color: var(--color-text-primary);
}
.join-game-btn.join:hover:enabled {
background: var(--color-secondary-blue);
}
.join-game-btn.join:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.join-game-btn.cancel {
background: var(--color-bg-card);
color: var(--color-text-primary);
}
.join-game-btn.cancel:hover:enabled {
background: var(--color-border);
}
.join-game-btn.cancel:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.difficulty-btn.hard:hover:enabled {
background: var(--color-danger, #dc3545);
color: white;
}
.difficulty-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
+54 -28
View File
@@ -8,62 +8,88 @@
</label> </label>
</div> </div>
</div> </div>
<div class="sky-vignette" aria-hidden="true"></div>
<div class="clouds-container"> <div class="clouds-container">
<div class="cloud cloud-left"> <div class="cloud cloud-left">
<img src="arabian-chess/player-one.gif" alt="Player One" class="cloud-gif" /> <img src="/assets/arabian-chess/player-one.gif" alt="Player One" class="cloud-gif" />
</div> </div>
<div class="plane plane-left"> <div class="plane plane-left">
<img src="arabian-chess/plane.png" alt="Plane" class="plane-body" /> <img src="/assets/arabian-chess/plane.png" alt="Plane" class="plane-body" />
<img src="arabian-chess/raf.gif" alt="Raf" class="plane-gif" /> <img src="/assets/arabian-chess/raf.gif" alt="Raf" class="plane-gif" />
</div> </div>
<div class="cloud cloud-right"> <div class="cloud cloud-right">
<div class="gif-with-halo"> <div class="gif-with-halo">
<img src="arabian-chess/player-two.gif" alt="Player Two" class="cloud-gif" /> <img src="/assets/arabian-chess/player-two.gif" alt="Player Two" class="cloud-gif" />
</div> </div>
</div> </div>
</div> </div>
<section class="welcome-card">
<section class="welcome-intro">
<h1>Welcome to NowChess</h1> <h1>Welcome to NowChess</h1>
<p>Pick a mode to begin.</p> <p>Pick a mode to begin.</p>
</section>
<div class="mode-grid"> <section class="skyline-controls" aria-label="Game mode skyline">
<button type="button" class="mode mode-active" (click)="toggleDifficultySelector()" [disabled]="creating"> <article class="tower tower-bot">
<button type="button" class="mode mode-active mode-billboard" (click)="toggleDifficultySelector()" [disabled]="creating">
<span>Bot</span> <span>Bot</span>
<small>{{ creating ? 'Creating game...' : 'Choose difficulty' }}</small> <small>{{ creating ? 'Creating game...' : 'Choose difficulty' }}</small>
</button> </button>
<div class="tower-windows" aria-hidden="true">
<span></span><span></span><span></span><span></span>
</div>
</article>
@if (showDifficultySelector) { <article class="tower tower-1v1">
<div class="difficulty-selector"> <button type="button" class="mode mode-active mode-billboard" (click)="startOneVsOne()" [disabled]="creating">
<p>Select difficulty:</p>
<div class="difficulty-buttons">
<button type="button" class="difficulty-btn easy" (click)="startVsBot('easy')" [disabled]="creating">
Easy
</button>
<button type="button" class="difficulty-btn medium" (click)="startVsBot('medium')" [disabled]="creating">
Medium
</button>
<button type="button" class="difficulty-btn hard" (click)="startVsBot('hard')" [disabled]="creating">
Hard
</button>
</div>
</div>
}
<button type="button" class="mode mode-active" (click)="startOneVsOne()" [disabled]="creating">
<span>1 vs 1</span> <span>1 vs 1</span>
<small>{{ creating ? 'Creating game...' : 'Start now' }}</small> <small>{{ creating ? 'Creating game...' : 'Start now' }}</small>
</button> </button>
<div class="tower-windows" aria-hidden="true">
<span></span><span></span><span></span><span></span><span></span>
</div>
</article>
<button type="button" class="mode mode-active" (click)="toggleJoinGameForm()" [disabled]="joiningGame"> <article class="tower tower-join">
<button type="button" class="mode mode-active mode-billboard" (click)="toggleJoinGameForm()" [disabled]="joiningGame">
<span>Join Game</span> <span>Join Game</span>
<small>{{ joiningGame ? 'Joining...' : 'Enter game ID' }}</small> <small>{{ joiningGame ? 'Joining...' : 'Enter game ID' }}</small>
</button> </button>
<div class="tower-windows" aria-hidden="true">
<span></span><span></span><span></span><span></span>
</div>
</article>
<button type="button" class="mode mode-active" (click)="toggleImportGameForm()" [disabled]="importing"> <article class="tower tower-import">
<button type="button" class="mode mode-active mode-billboard" (click)="toggleImportGameForm()" [disabled]="importing">
<span>Import Game</span> <span>Import Game</span>
<small>{{ importing ? 'Importing...' : 'FEN or PGN' }}</small> <small>{{ importing ? 'Importing...' : 'FEN or PGN' }}</small>
</button> </button>
</div> <div class="tower-windows" aria-hidden="true">
<span></span><span></span><span></span><span></span><span></span><span></span>
</div>
</article>
</section>
<section class="interaction-deck">
@if (showDifficultySelector) {
<div class="difficulty-selector">
<p>Select difficulty:</p>
<div class="difficulty-buttons">
<button type="button" class="difficulty-btn easy" (click)="startVsBot('easy')" [disabled]="creating">
Easy
</button>
<button type="button" class="difficulty-btn medium" (click)="startVsBot('medium')" [disabled]="creating">
Medium
</button>
<button type="button" class="difficulty-btn hard" (click)="startVsBot('hard')" [disabled]="creating">
Hard
</button>
</div>
</div>
}
@if (showJoinGameForm) { @if (showJoinGameForm) {
<div class="join-game-form"> <div class="join-game-form">
+1 -1
View File
@@ -11,7 +11,7 @@ import { GameApiService } from '../../services/game-api.service';
standalone: true, standalone: true,
imports: [CommonModule, FormsModule], imports: [CommonModule, FormsModule],
templateUrl: './welcome.component.html', templateUrl: './welcome.component.html',
styleUrl: './welcome.component.css' styleUrls: ['./welcome.component.css']
}) })
export class WelcomeComponent { export class WelcomeComponent {
creating = false; creating = false;