Compare commits
24 Commits
0.1.0
..
49d6aae1db
| Author | SHA1 | Date | |
|---|---|---|---|
| 49d6aae1db | |||
| eadcd770ba | |||
| a3255602b3 | |||
| d471eef7af | |||
| 361ce1e817 | |||
| aa70083aed | |||
| 3b757d7ff7 | |||
| 19f3359106 | |||
| d676288315 | |||
| 671886781e | |||
| dc9a7b2e32 | |||
| 5951257c99 | |||
| a59e2a023b | |||
| 4f76bcc7c6 | |||
| 25b69fd7b6 | |||
| c18026bce6 | |||
| 91fa247696 | |||
| 97365371c8 | |||
| fdc0f1d73b | |||
| bc644c16e3 | |||
| 5497997455 | |||
| 53459648c6 | |||
| 8c97a726a7 | |||
| 2582f8e4d6 |
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/devcontainer-config/features/dot-config:4": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "ghcr.io/devcontainer-config/features/dot-config@sha256:d9ca770ccb218e619d5725fd50f00dfacdf582d92a8c3901f11b53b1caddd878",
|
||||||
|
"integrity": "sha256:d9ca770ccb218e619d5725fd50f00dfacdf582d92a8c3901f11b53b1caddd878"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
|
// README at: https://github.com/devcontainers/templates/tree/main/src/alpine
|
||||||
|
{
|
||||||
|
"name": "Alpine",
|
||||||
|
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||||
|
"image": "mcr.microsoft.com/devcontainers/base:alpine-3.22",
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/devcontainer-config/features/dot-config:4": {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||||
|
// "features": {},
|
||||||
|
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
// "forwardPorts": [],
|
||||||
|
|
||||||
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
|
// "postCreateCommand": "uname -a",
|
||||||
|
|
||||||
|
// Configure tool-specific properties.
|
||||||
|
// "customizations": {},
|
||||||
|
|
||||||
|
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||||
|
// "remoteUser": "root"
|
||||||
|
}
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
## 0.0.0 (2026-05-12)
|
|
||||||
|
|
||||||
### Features
|
|
||||||
|
|
||||||
* added bot, light and dark mode ([2de003e](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/2de003e497baee72f998d0d805ca1e58aababe48))
|
|
||||||
* added web view 1v1 ([1828fa3](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/1828fa3275ddb8ce6bb90a9f6a970ec428ebce3a))
|
|
||||||
* NCS-63 User account implementation ([#2](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/issues/2)) ([ff75c8c](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/ff75c8ce2fad54137f04a14c15bc1d4a38fa9bb8))
|
|
||||||
* NCS-75 Frontend Deployment Dockerfile ([#4](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/issues/4)) ([bd7ec58](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/bd7ec581e38b5d8e775741bf16e19b4dc67b979e))
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* build issues ([36d72fd](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/36d72fd6cda41be51d28f8ac307dcdbcd31afa91))
|
|
||||||
* cleaner components seperation ([8b090e4](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/8b090e4d96c64c0adb253e3aefad7930108ccfb9))
|
|
||||||
* gitignore ([4da882f](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/4da882f481ba7a008aac868fb37de7cb2bafea5d))
|
|
||||||
* GITIGNORE ([8df2d05](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/8df2d0550ab17c9afb2d19c414eac700a75add02))
|
|
||||||
* npm ([c11c1d4](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/c11c1d4dce9de4bd5b463e891eebf961b37feb04))
|
|
||||||
* removed .vs ([2833ead](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/2833ead7be3b47ee5c188d2d21b7326cb3cb3f26))
|
|
||||||
* removed cache files ([7ee59c4](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/7ee59c434bf137a08fd560bbc02ceefbcfd90f04))
|
|
||||||
* size of pieces and removed text view of the game state ([c60d00f](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/c60d00f9d25247504845654615065fbccd7fe448))
|
|
||||||
* structure ([3e8c7c4](https://git.janis-eccarius.de/NowChess/NowChess-Frontend/commit/3e8c7c4057e55aeec7cee8c24f6751ff24912c93))
|
|
||||||
-25
@@ -1,25 +0,0 @@
|
|||||||
FROM --platform=$BUILDPLATFORM node:lts-alpine3.23 AS builder
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
COPY . .
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM --platform=$TARGETPLATFORM nginx:stable-alpine AS production
|
|
||||||
|
|
||||||
RUN apk add --no-cache gettext
|
|
||||||
|
|
||||||
RUN rm -rf /usr/share/nginx/html/*
|
|
||||||
COPY --from=builder /app/dist/nowchess-frontend/browser /usr/share/nginx/html
|
|
||||||
|
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
||||||
|
|
||||||
COPY public/env.template.js /usr/share/nginx/html/env.template.js
|
|
||||||
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
|
||||||
RUN chmod +x /docker-entrypoint.sh
|
|
||||||
|
|
||||||
EXPOSE 80
|
|
||||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
||||||
+4
-15
@@ -47,25 +47,17 @@
|
|||||||
"budgets": [
|
"budgets": [
|
||||||
{
|
{
|
||||||
"type": "initial",
|
"type": "initial",
|
||||||
"maximumWarning": "1MB",
|
"maximumWarning": "500kB",
|
||||||
"maximumError": "5MB"
|
"maximumError": "1MB"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "anyComponentStyle",
|
"type": "anyComponentStyle",
|
||||||
"maximumWarning": "1MB",
|
"maximumWarning": "12kB",
|
||||||
"maximumError": "5MB"
|
"maximumError": "20kB"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"outputHashing": "all"
|
"outputHashing": "all"
|
||||||
},
|
},
|
||||||
"staging": {
|
|
||||||
"fileReplacements": [
|
|
||||||
{
|
|
||||||
"replace": "src/environments/environment.ts",
|
|
||||||
"with": "src/environments/environment.staging.ts"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"development": {
|
"development": {
|
||||||
"fileReplacements": [
|
"fileReplacements": [
|
||||||
{
|
{
|
||||||
@@ -91,9 +83,6 @@
|
|||||||
"production": {
|
"production": {
|
||||||
"buildTarget": "nowchess-frontend:build:production"
|
"buildTarget": "nowchess-frontend:build:production"
|
||||||
},
|
},
|
||||||
"staging": {
|
|
||||||
"buildTarget": "nowchess-frontend:build:staging"
|
|
||||||
},
|
|
||||||
"development": {
|
"development": {
|
||||||
"buildTarget": "nowchess-frontend:build:development"
|
"buildTarget": "nowchess-frontend:build:development"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Replace placeholders in env.template.js with environment variables and write env.js
|
|
||||||
TEMPLATE_PATH="/usr/share/nginx/html/env.template.js"
|
|
||||||
TARGET_PATH="/usr/share/nginx/html/env.js"
|
|
||||||
|
|
||||||
if [ -f "$TEMPLATE_PATH" ]; then
|
|
||||||
echo "Rendering runtime config from $TEMPLATE_PATH"
|
|
||||||
echo "Using environment variables:"
|
|
||||||
printenv
|
|
||||||
echo "----"
|
|
||||||
envsubst < "$TEMPLATE_PATH" > "$TARGET_PATH"
|
|
||||||
else
|
|
||||||
echo "No runtime template found at $TEMPLATE_PATH, skipping"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec nginx -g 'daemon off;'
|
|
||||||
-22
@@ -1,22 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name localhost;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html index.htm;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /env.js {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
default_type application/javascript;
|
|
||||||
expires -1;
|
|
||||||
add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
|
|
||||||
}
|
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
|
||||||
location = /50x.html {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+1
-2
@@ -4,8 +4,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
"build": "ng build --configuration production",
|
"build": "ng build",
|
||||||
"build:staging": "ng build --configuration staging",
|
|
||||||
"watch": "ng build --watch --configuration development",
|
"watch": "ng build --watch --configuration development",
|
||||||
"test": "ng test"
|
"test": "ng test"
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -15,4 +15,4 @@
|
|||||||
"changeOrigin": true,
|
"changeOrigin": true,
|
||||||
"ws": true
|
"ws": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
window.__RUNTIME_CONFIG__ = {
|
|
||||||
API_URL: "${API_URL}",
|
|
||||||
WEBSOCKET_URL: "${WEBSOCKET_URL}"
|
|
||||||
};
|
|
||||||
@@ -2,11 +2,23 @@
|
|||||||
<label>{{ label }}</label>
|
<label>{{ label }}</label>
|
||||||
|
|
||||||
@if (inputType === 'textarea') {
|
@if (inputType === 'textarea') {
|
||||||
<textarea #textareaInput [placeholder]="placeholder" [value]="value" [rows]="rows"
|
<textarea
|
||||||
(input)="onValueChange(textareaInput.value)" class="form-input"></textarea>
|
#textareaInput
|
||||||
|
[placeholder]="placeholder"
|
||||||
|
[value]="value"
|
||||||
|
[rows]="rows"
|
||||||
|
(input)="onValueChange(textareaInput.value)"
|
||||||
|
class="form-input"
|
||||||
|
></textarea>
|
||||||
} @else {
|
} @else {
|
||||||
<input #textInput type="text" [placeholder]="placeholder" [value]="value" (input)="onValueChange(textInput.value)"
|
<input
|
||||||
class="form-input" />
|
#textInput
|
||||||
|
type="text"
|
||||||
|
[placeholder]="placeholder"
|
||||||
|
[value]="value"
|
||||||
|
(input)="onValueChange(textInput.value)"
|
||||||
|
class="form-input"
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
|
|
||||||
<button type="button" class="app-btn w-100" (click)="onButtonClick()">
|
<button type="button" class="app-btn w-100" (click)="onButtonClick()">
|
||||||
@@ -14,6 +26,6 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
@if (hintText) {
|
@if (hintText) {
|
||||||
<p class="hint-text">{{ hintText }}</p>
|
<p class="hint-text">{{ hintText }}</p>
|
||||||
}
|
}
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -2,22 +2,26 @@
|
|||||||
<div class="promotion-dialog">
|
<div class="promotion-dialog">
|
||||||
<div class="promotion-header">
|
<div class="promotion-header">
|
||||||
<h3>Pawn Promotion</h3>
|
<h3>Pawn Promotion</h3>
|
||||||
<button class="app-btn" (click)="close()" aria-label="Close"
|
<button class="app-btn" (click)="close()" aria-label="Close" style="padding:0.2rem 0.5rem;min-width:unset;">×</button>
|
||||||
style="padding:0.2rem 0.5rem;min-width:unset;">×</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="promotion-body">
|
<div class="promotion-body">
|
||||||
<p class="promotion-prompt">Choose a piece to promote your pawn to:</p>
|
<p class="promotion-prompt">Choose a piece to promote your pawn to:</p>
|
||||||
|
|
||||||
<div class="promotion-options">
|
<div class="promotion-options">
|
||||||
@for (piece of promotionPieces; track piece.type) {
|
@for (piece of promotionPieces; track piece.type) {
|
||||||
<button type="button" class="app-btn promotion-choice" [attr.data-piece]="piece.type"
|
<button
|
||||||
(click)="selectPromotion(piece.type)" [title]="piece.label">
|
type="button"
|
||||||
<span class="piece-symbol">{{ piece.symbol }}</span>
|
class="app-btn promotion-choice"
|
||||||
<span class="piece-label">{{ piece.label }}</span>
|
[attr.data-piece]="piece.type"
|
||||||
</button>
|
(click)="selectPromotion(piece.type)"
|
||||||
|
[title]="piece.label"
|
||||||
|
>
|
||||||
|
<span class="piece-symbol">{{ piece.symbol }}</span>
|
||||||
|
<span class="piece-label">{{ piece.label }}</span>
|
||||||
|
</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
/**
|
|
||||||
* Load runtime configuration from window.__RUNTIME_CONFIG__
|
|
||||||
* This is injected by docker-entrypoint.sh at container startup
|
|
||||||
*/
|
|
||||||
export function loadRuntimeConfig() {
|
|
||||||
const config = (window as any).__RUNTIME_CONFIG__ || {};
|
|
||||||
return {
|
|
||||||
apiUrl: config.API_URL || '',
|
|
||||||
wsUrl: config.WEBSOCKET_URL || 'ws://localhost:8080'
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -30,7 +30,6 @@
|
|||||||
|
|
||||||
header {
|
header {
|
||||||
margin-bottom: var(--size-xl);
|
margin-bottom: var(--size-xl);
|
||||||
margin-bottom: var(--size-xl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h1,
|
h1,
|
||||||
@@ -38,13 +37,9 @@ h2 {
|
|||||||
color: var(--color-text-primary);
|
color: var(--color-text-primary);
|
||||||
margin: 0 0 var(--size-md);
|
margin: 0 0 var(--size-md);
|
||||||
font-size: var(--heading-h1);
|
font-size: var(--heading-h1);
|
||||||
color: var(--color-text-primary);
|
|
||||||
margin: 0 0 var(--size-md);
|
|
||||||
font-size: var(--heading-h1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.meta {
|
.meta {
|
||||||
color: var(--color-text-primary);
|
|
||||||
color: var(--color-text-primary);
|
color: var(--color-text-primary);
|
||||||
font-size: 0.95rem;
|
font-size: 0.95rem;
|
||||||
}
|
}
|
||||||
@@ -53,8 +48,6 @@ h2 {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-bottom: var(--size-sm);
|
margin-bottom: var(--size-sm);
|
||||||
color: var(--color-text-primary);
|
color: var(--color-text-primary);
|
||||||
margin-bottom: var(--size-sm);
|
|
||||||
color: var(--color-text-primary);
|
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
@@ -117,10 +110,6 @@ h2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.board-section {
|
.board-section {
|
||||||
background: var(--color-bg-board);
|
|
||||||
border: var(--border-width) solid var(--color-border);
|
|
||||||
border-radius: var(--border-radius-md);
|
|
||||||
padding: clamp(var(--size-sm), 1vw, var(--size-lg));
|
|
||||||
background: var(--color-bg-board);
|
background: var(--color-bg-board);
|
||||||
border: var(--border-width) solid var(--color-border);
|
border: var(--border-width) solid var(--color-border);
|
||||||
border-radius: var(--border-radius-md);
|
border-radius: var(--border-radius-md);
|
||||||
@@ -327,7 +316,6 @@ h2 {
|
|||||||
@media (max-width: 991px) {
|
@media (max-width: 991px) {
|
||||||
.game-card {
|
.game-card {
|
||||||
padding: clamp(var(--size-md), 1.5vw, var(--size-lg));
|
padding: clamp(var(--size-md), 1.5vw, var(--size-lg));
|
||||||
padding: clamp(var(--size-md), 1.5vw, var(--size-lg));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.board-section {
|
.board-section {
|
||||||
@@ -337,30 +325,25 @@ h2 {
|
|||||||
h1,
|
h1,
|
||||||
h2 {
|
h2 {
|
||||||
font-size: var(--heading-h1-tablet);
|
font-size: var(--heading-h1-tablet);
|
||||||
font-size: var(--heading-h1-tablet);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
.game-shell {
|
.game-shell {
|
||||||
padding: clamp(var(--size-sm), 1.5vw, var(--size-lg));
|
padding: clamp(var(--size-sm), 1.5vw, var(--size-lg));
|
||||||
padding: clamp(var(--size-sm), 1.5vw, var(--size-lg));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.game-card {
|
.game-card {
|
||||||
padding: clamp(var(--size-sm), 1vw, var(--size-md));
|
padding: clamp(var(--size-sm), 1vw, var(--size-md));
|
||||||
padding: clamp(var(--size-sm), 1vw, var(--size-md));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
header {
|
header {
|
||||||
margin-bottom: var(--size-lg);
|
margin-bottom: var(--size-lg);
|
||||||
margin-bottom: var(--size-lg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h1,
|
h1,
|
||||||
h2 {
|
h2 {
|
||||||
font-size: var(--heading-h1-mobile);
|
font-size: var(--heading-h1-mobile);
|
||||||
font-size: var(--heading-h1-mobile);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.meta {
|
.meta {
|
||||||
@@ -370,8 +353,6 @@ h2 {
|
|||||||
.top-section {
|
.top-section {
|
||||||
gap: var(--size-xs);
|
gap: var(--size-xs);
|
||||||
margin-bottom: var(--size-xs);
|
margin-bottom: var(--size-xs);
|
||||||
gap: var(--size-xs);
|
|
||||||
margin-bottom: var(--size-xs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.board-section {
|
.board-section {
|
||||||
@@ -382,24 +363,19 @@ h2 {
|
|||||||
@media (max-width: 480px) {
|
@media (max-width: 480px) {
|
||||||
.game-shell {
|
.game-shell {
|
||||||
padding: var(--size-sm);
|
padding: var(--size-sm);
|
||||||
padding: var(--size-sm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.game-card {
|
.game-card {
|
||||||
padding: var(--size-sm);
|
padding: var(--size-sm);
|
||||||
border-radius: var(--border-radius-md);
|
border-radius: var(--border-radius-md);
|
||||||
padding: var(--size-sm);
|
|
||||||
border-radius: var(--border-radius-md);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
header {
|
header {
|
||||||
margin-bottom: var(--size-md);
|
margin-bottom: var(--size-md);
|
||||||
margin-bottom: var(--size-md);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: var(--heading-h1-small);
|
font-size: var(--heading-h1-small);
|
||||||
font-size: var(--heading-h1-small);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.meta {
|
.meta {
|
||||||
@@ -409,8 +385,6 @@ h2 {
|
|||||||
.top-section {
|
.top-section {
|
||||||
gap: var(--size-xs-gap);
|
gap: var(--size-xs-gap);
|
||||||
margin-bottom: var(--size-xs);
|
margin-bottom: var(--size-xs);
|
||||||
gap: var(--size-xs-gap);
|
|
||||||
margin-bottom: var(--size-xs);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.board-section {
|
.board-section {
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
<main class="game-shell" [class.theme-dark]="isDarkMode">
|
<main class="game-shell" [class.theme-dark]="isDarkMode">
|
||||||
<app-promotion-dialog [isOpen]="facade.isPromotionDialogOpen" (promotionSelected)="facade.onPromotionSelected($event)"
|
<app-promotion-dialog
|
||||||
(closed)="facade.onPromotionClosed()" />
|
[isOpen]="facade.isPromotionDialogOpen"
|
||||||
|
(promotionSelected)="facade.onPromotionSelected($event)"
|
||||||
|
(closed)="facade.onPromotionClosed()"
|
||||||
|
/>
|
||||||
|
|
||||||
<section class="game-card">
|
<section class="game-card">
|
||||||
<header class="mb-3">
|
<header class="mb-3">
|
||||||
@@ -10,126 +13,150 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
@if (facade.loading) {
|
@if (facade.loading) {
|
||||||
<p>Loading game state...</p>
|
<p>Loading game state...</p>
|
||||||
} @else if (facade.state) {
|
} @else if (facade.state) {
|
||||||
@if (facade.isGameFinished && facade.gameCompletionMessage) {
|
@if (facade.isGameFinished && facade.gameCompletionMessage) {
|
||||||
<div class="game-completion-alert alert alert-success mb-3">
|
<div class="game-completion-alert alert alert-success mb-3">
|
||||||
<h2 class="completion-title">{{ facade.gameCompletionMessage }}</h2>
|
<h2 class="completion-title">{{ facade.gameCompletionMessage }}</h2>
|
||||||
<p class="completion-subtitle mb-0">
|
<p class="completion-subtitle mb-0">
|
||||||
<a routerLink="/" class="completion-link">Start a new game</a>
|
<a routerLink="/" class="completion-link">Start a new game</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
|
||||||
}
|
|
||||||
@if (facade.isGameFinished && facade.gameCompletionMessage) {
|
|
||||||
<div class="game-completion-alert alert alert-success mb-3">
|
|
||||||
<h2 class="completion-title">{{ facade.gameCompletionMessage }}</h2>
|
|
||||||
<p class="completion-subtitle mb-0">
|
|
||||||
<a routerLink="/" class="completion-link">Start a new game</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="row g-3">
|
|
||||||
<!-- Left Sidebar - Dummy Timers -->
|
|
||||||
<div class="col-lg-3 col-md-6 col-12 order-lg-1 order-2">
|
|
||||||
<section class="timer-card">
|
|
||||||
<h2>Timers</h2>
|
|
||||||
<div class="player-timer" [class.active-timer]="facade.state.turn === 'white'">
|
|
||||||
<p class="timer-label">White</p>
|
|
||||||
<p class="timer-value">{{ formatTimer(whiteTimerSeconds) }}</p>
|
|
||||||
</div>
|
|
||||||
<div class="player-timer" [class.active-timer]="facade.state.turn === 'black'">
|
|
||||||
<p class="timer-label">Black</p>
|
|
||||||
<p class="timer-value">{{ formatTimer(blackTimerSeconds) }}</p>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<!-- Center - Chess Board -->
|
<div class="container-fluid">
|
||||||
<div class="col-lg-6 col-md-12 col-12 order-lg-2 order-1">
|
<div class="row g-3">
|
||||||
<section class="center-column d-flex flex-column h-100">
|
<!-- Left Sidebar - Dummy Timers -->
|
||||||
<div class="board-section flex-grow-1 d-flex align-items-center justify-content-center">
|
<div class="col-lg-3 col-md-6 col-12 order-lg-1 order-2">
|
||||||
<app-chess-board [fen]="facade.state.fen" [selectedSquare]="facade.selectedSquare"
|
<section class="timer-card">
|
||||||
[highlightedSquares]="facade.highlightedSquares" [boardTheme]="boardTheme"
|
<h2>Timers</h2>
|
||||||
(squareSelected)="facade.onBoardSquareSelected($event)" />
|
<div class="player-timer" [class.active-timer]="facade.state.turn === 'white'">
|
||||||
</div>
|
<p class="timer-label">White</p>
|
||||||
|
<p class="timer-value">{{ formatTimer(whiteTimerSeconds) }}</p>
|
||||||
<section class="top-section">
|
</div>
|
||||||
<section class="board-theme-card" aria-label="Board design chooser">
|
<div class="player-timer" [class.active-timer]="facade.state.turn === 'black'">
|
||||||
<h3>Board Design</h3>
|
<p class="timer-label">Black</p>
|
||||||
<div class="board-theme-group" role="radiogroup" aria-label="Board design">
|
<p class="timer-value">{{ formatTimer(blackTimerSeconds) }}</p>
|
||||||
<label class="board-theme-option">
|
</div>
|
||||||
<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 label="Play move (UCI)" placeholder="e2e4" buttonLabel="Send Move" inputType="input"
|
|
||||||
[value]="facade.moveInput" cardClass="move-card" hintText="Click your piece to highlight legal targets."
|
|
||||||
(valueChange)="facade.moveInput = $event" (buttonClick)="facade.submitMove()" />
|
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Right Sidebar - Export -->
|
<!-- Center - Chess Board -->
|
||||||
<div class="col-lg-3 col-md-6 col-12 order-lg-3 order-3">
|
<div class="col-lg-6 col-md-12 col-12 order-lg-2 order-1">
|
||||||
<section class="history-card">
|
<section class="center-column d-flex flex-column h-100">
|
||||||
<h2>Move History</h2>
|
<div class="board-section flex-grow-1 d-flex align-items-center justify-content-center">
|
||||||
|
<app-chess-board
|
||||||
|
[fen]="facade.state.fen"
|
||||||
|
[selectedSquare]="facade.selectedSquare"
|
||||||
|
[highlightedSquares]="facade.highlightedSquares"
|
||||||
|
[boardTheme]="boardTheme"
|
||||||
|
(squareSelected)="facade.onBoardSquareSelected($event)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
@if (facade.state.moves.length === 0) {
|
<section class="top-section">
|
||||||
<p class="history-empty">No moves yet.</p>
|
<section class="board-theme-card" aria-label="Board design chooser">
|
||||||
} @else {
|
<h3>Board Design</h3>
|
||||||
<ol class="history-list">
|
<div class="board-theme-group" role="radiogroup" aria-label="Board design">
|
||||||
@for (move of facade.state.moves; track $index) {
|
<label class="board-theme-option">
|
||||||
<li>
|
<input
|
||||||
<span class="history-number">{{ $index + 1 }}.</span>
|
type="radio"
|
||||||
<span class="history-move">{{ move }}</span>
|
name="boardTheme"
|
||||||
</li>
|
[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
|
||||||
|
label="Play move (UCI)"
|
||||||
|
placeholder="e2e4"
|
||||||
|
buttonLabel="Send Move"
|
||||||
|
inputType="input"
|
||||||
|
[value]="facade.moveInput"
|
||||||
|
cardClass="move-card"
|
||||||
|
hintText="Click your piece to highlight legal targets."
|
||||||
|
(valueChange)="facade.moveInput = $event"
|
||||||
|
(buttonClick)="facade.submitMove()"
|
||||||
|
/>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Right Sidebar - Export -->
|
||||||
|
<div class="col-lg-3 col-md-6 col-12 order-lg-3 order-3">
|
||||||
|
<section class="history-card">
|
||||||
|
<h2>Move History</h2>
|
||||||
|
|
||||||
|
@if (facade.state.moves.length === 0) {
|
||||||
|
<p class="history-empty">No moves yet.</p>
|
||||||
|
} @else {
|
||||||
|
<ol class="history-list">
|
||||||
|
@for (move of facade.state.moves; track $index) {
|
||||||
|
<li>
|
||||||
|
<span class="history-number">{{ $index + 1 }}.</span>
|
||||||
|
<span class="history-move">{{ move }}</span>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ol>
|
||||||
}
|
}
|
||||||
</ol>
|
</section>
|
||||||
}
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="export-card">
|
<section class="export-card">
|
||||||
<h2>Export</h2>
|
<h2>Export</h2>
|
||||||
<div class="export-mode-group" role="radiogroup" aria-label="Export mode">
|
<div class="export-mode-group" role="radiogroup" aria-label="Export mode">
|
||||||
<label class="export-mode-option">
|
<label class="export-mode-option">
|
||||||
<input type="radio" name="exportType" [checked]="exportType === 'fen'"
|
<input
|
||||||
(change)="setExportType('fen')" />
|
type="radio"
|
||||||
<span>FEN</span>
|
name="exportType"
|
||||||
</label>
|
[checked]="exportType === 'fen'"
|
||||||
<label class="export-mode-option">
|
(change)="setExportType('fen')"
|
||||||
<input type="radio" name="exportType" [checked]="exportType === 'pgn'"
|
/>
|
||||||
(change)="setExportType('pgn')" />
|
<span>FEN</span>
|
||||||
<span>PGN</span>
|
</label>
|
||||||
</label>
|
<label class="export-mode-option">
|
||||||
</div>
|
<input
|
||||||
|
type="radio"
|
||||||
|
name="exportType"
|
||||||
|
[checked]="exportType === 'pgn'"
|
||||||
|
(change)="setExportType('pgn')"
|
||||||
|
/>
|
||||||
|
<span>PGN</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
<textarea class="export-text" [value]="exportValue"
|
<textarea
|
||||||
[placeholder]="exportType === 'fen' ? 'FEN will appear here' : 'PGN will appear here'" rows="8"
|
class="export-text"
|
||||||
readonly></textarea>
|
[value]="exportValue"
|
||||||
|
[placeholder]="exportType === 'fen' ? 'FEN will appear here' : 'PGN will appear here'"
|
||||||
|
rows="8"
|
||||||
|
readonly
|
||||||
|
></textarea>
|
||||||
|
|
||||||
<button type="button" class="app-btn w-100" (click)="completeExport()">Done</button>
|
<button type="button" class="app-btn w-100" (click)="completeExport()">Done</button>
|
||||||
|
|
||||||
@if (exportNotice) {
|
@if (exportNotice) {
|
||||||
<p class="export-note">{{ exportNotice }}</p>
|
<p class="export-note">{{ exportNotice }}</p>
|
||||||
}
|
}
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (facade.errorMessage) {
|
@if (facade.errorMessage) {
|
||||||
<p class="alert alert-danger mt-3 mb-0">{{ facade.errorMessage }}</p>
|
<p class="alert alert-danger mt-3 mb-0">{{ facade.errorMessage }}</p>
|
||||||
}
|
}
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bpart" style="height:36vh;">
|
<div class="bpart" style="height:36vh;">
|
||||||
<div>
|
<div style="padding:5px 5px 0;">
|
||||||
<div class="bb">
|
<div class="bb">
|
||||||
<div class="bb-tag">JOIN</div>
|
<div class="bb-tag">JOIN</div>
|
||||||
<div class="bb-title">JOIN<br />GAME</div>
|
<div class="bb-title">JOIN<br />GAME</div>
|
||||||
@@ -94,7 +94,8 @@
|
|||||||
<div class="bb-tag">WELCOME</div>
|
<div class="bb-tag">WELCOME</div>
|
||||||
<div class="bb-title" style="font-size:clamp(16px,1.8vw,26px);">WELCOME TO<br />NOWCHESS</div>
|
<div class="bb-title" style="font-size:clamp(16px,1.8vw,26px);">WELCOME TO<br />NOWCHESS</div>
|
||||||
<div class="bb-subtitle">Play your next move from the skyline.</div>
|
<div class="bb-subtitle">Play your next move from the skyline.</div>
|
||||||
<button type="button" class="app-btn" (click)="startOneVsOne()" [disabled]="creating">
|
<button type="button" class="app-btn" (click)="startOneVsOne()"
|
||||||
|
[disabled]="creating">
|
||||||
{{ creating ? 'CREATING...' : 'START NOW →' }}
|
{{ creating ? 'CREATING...' : 'START NOW →' }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -247,7 +248,8 @@
|
|||||||
[placeholder]="importMode === 'fen' ? 'Paste FEN here' : 'Paste PGN here'" [disabled]="importing"
|
[placeholder]="importMode === 'fen' ? 'Paste FEN here' : 'Paste PGN here'" [disabled]="importing"
|
||||||
rows="5"></textarea>
|
rows="5"></textarea>
|
||||||
<div class="dialog-actions">
|
<div class="dialog-actions">
|
||||||
<button type="button" class="app-btn" (click)="submitImportGame()" [disabled]="importing || !importText.trim()">
|
<button type="button" class="app-btn" (click)="submitImportGame()"
|
||||||
|
[disabled]="importing || !importText.trim()">
|
||||||
{{ importing ? 'IMPORTING...' : 'IMPORT' }}
|
{{ importing ? 'IMPORTING...' : 'IMPORT' }}
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="app-btn" (click)="closeImportDialog()" [disabled]="importing">CANCEL</button>
|
<button type="button" class="app-btn" (click)="closeImportDialog()" [disabled]="importing">CANCEL</button>
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
import { loadRuntimeConfig } from '../app/core/config.loader';
|
|
||||||
|
|
||||||
const runtimeConfig = loadRuntimeConfig();
|
|
||||||
|
|
||||||
export const environment = {
|
|
||||||
production: true,
|
|
||||||
apiBaseUrl: runtimeConfig.apiUrl || 'https://st.nowchess.janis-eccarius.de',
|
|
||||||
accountServiceUrl: runtimeConfig.apiUrl || 'https://st.nowchess.janis-eccarius.de',
|
|
||||||
wsBaseUrl: runtimeConfig.wsUrl || 'wss://st.nowchess.janis-eccarius.de',
|
|
||||||
apiPath: '/api/board/game'
|
|
||||||
};
|
|
||||||
@@ -1,11 +1,7 @@
|
|||||||
import { loadRuntimeConfig } from '../app/core/config.loader';
|
|
||||||
|
|
||||||
const runtimeConfig = loadRuntimeConfig();
|
|
||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: true,
|
||||||
apiBaseUrl: runtimeConfig.apiUrl || '',
|
apiBaseUrl: '',
|
||||||
accountServiceUrl: runtimeConfig.apiUrl || '',
|
accountServiceUrl: '',
|
||||||
wsBaseUrl: runtimeConfig.wsUrl,
|
wsBaseUrl: 'ws://localhost:8080',
|
||||||
apiPath: '/api/board/game'
|
apiPath: '/api/board/game'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
<base href="/">
|
<base href="/">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
<script src="/env.js" defer></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<app-root></app-root>
|
<app-root></app-root>
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
/* ========================================
|
||||||
|
COLOR VARIABLES - Semantic Naming
|
||||||
|
======================================== */
|
||||||
|
|
||||||
/* Light Mode Colors (Default) */
|
/* Light Mode Colors (Default) */
|
||||||
:root:not([data-theme='dark']) {
|
:root:not([data-theme='dark']) {
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
MAJOR=0
|
|
||||||
MINOR=1
|
|
||||||
PATCH=0
|
|
||||||
Reference in New Issue
Block a user