Commit 32bfa830 authored by Mahmoud Aglan's avatar Mahmoud Aglan

feat(chess): flat drawn pieces everywhere; white pieces get a readable edge

The uploaded piece images were heavily outlined old-style art; they are
backed up to docs/branding-backup-2026-10-19-chess-pieces.json and cleared
in platform_assets, so every board draws the flat Night Arcade pieces.
White pieces get a thin mid-grey edge and a silver lip to read on the
light squares. tools/shoot.mjs --drop-assets previews the built-in art.
Co-Authored-By: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
parent 4ce3d90f
[{"id":"chess_piece_bB","category":"chess","label":"chess_piece_bB","label_ar":null,"description":null,"asset_url":"https://safe-supabase-kong.caprover.al-arcade.com/storage/v1/object/public/profile-images/branding/chess_piece_bB.png?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE4OTM0NTYwMDB9.31PF6PvP-pSrvRuQwLFptQoejR0W1A7o53lZhEbnz84&v=1780707513","asset_url_dark":null,"asset_url_ar":null,"fallback_type":"color","fallback_value":null,"mime_type":null,"dimensions":"128x128","file_size_kb":null,"assigned_by":null,"assigned_at":null,"is_required":false,"sort_order":0,"created_at":"2026-06-05T05:05:46.488198+00:00","updated_at":"2026-06-05T05:05:46.488198+00:00"},
{"id":"chess_piece_bK","category":"chess","label":"chess_piece_bK","label_ar":null,"description":null,"asset_url":"https://safe-supabase-kong.caprover.al-arcade.com/storage/v1/object/public/profile-images/branding/chess_piece_king.png?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE4OTM0NTYwMDB9.31PF6PvP-pSrvRuQwLFptQoejR0W1A7o53lZhEbnz84&v=1780635943","asset_url_dark":null,"asset_url_ar":null,"fallback_type":"color","fallback_value":null,"mime_type":null,"dimensions":"64x64","file_size_kb":null,"assigned_by":null,"assigned_at":null,"is_required":false,"sort_order":0,"created_at":"2026-06-05T05:05:45.738792+00:00","updated_at":"2026-06-05T05:05:45.738792+00:00"},
{"id":"chess_piece_bN","category":"chess","label":"chess_piece_bN","label_ar":null,"description":null,"asset_url":"https://safe-supabase-kong.caprover.al-arcade.com/storage/v1/object/public/profile-images/branding/chess_piece_knight.png?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE4OTM0NTYwMDB9.31PF6PvP-pSrvRuQwLFptQoejR0W1A7o53lZhEbnz84&v=1780635943","asset_url_dark":null,"asset_url_ar":null,"fallback_type":"color","fallback_value":null,"mime_type":null,"dimensions":"64x64","file_size_kb":null,"assigned_by":null,"assigned_at":null,"is_required":false,"sort_order":0,"created_at":"2026-06-05T05:05:46.789141+00:00","updated_at":"2026-06-05T05:05:46.789141+00:00"},
{"id":"chess_piece_bP","category":"chess","label":"chess_piece_bP","label_ar":null,"description":null,"asset_url":"https://safe-supabase-kong.caprover.al-arcade.com/storage/v1/object/public/profile-images/branding/chess_piece_bP.png?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE4OTM0NTYwMDB9.31PF6PvP-pSrvRuQwLFptQoejR0W1A7o53lZhEbnz84&v=1780707479","asset_url_dark":null,"asset_url_ar":null,"fallback_type":"color","fallback_value":null,"mime_type":null,"dimensions":"128x128","file_size_kb":null,"assigned_by":null,"assigned_at":null,"is_required":false,"sort_order":0,"created_at":"2026-06-05T05:05:47.019317+00:00","updated_at":"2026-06-05T05:05:47.019317+00:00"},
{"id":"chess_piece_bQ","category":"chess","label":"chess_piece_bQ","label_ar":null,"description":null,"asset_url":"https://safe-supabase-kong.caprover.al-arcade.com/storage/v1/object/public/profile-images/branding/chess_piece_queen.png?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE4OTM0NTYwMDB9.31PF6PvP-pSrvRuQwLFptQoejR0W1A7o53lZhEbnz84&v=1780635943","asset_url_dark":null,"asset_url_ar":null,"fallback_type":"color","fallback_value":null,"mime_type":null,"dimensions":"64x64","file_size_kb":null,"assigned_by":null,"assigned_at":null,"is_required":false,"sort_order":0,"created_at":"2026-06-05T05:05:45.963994+00:00","updated_at":"2026-06-05T05:05:45.963994+00:00"},
{"id":"chess_piece_bR","category":"chess","label":"chess_piece_bR","label_ar":null,"description":null,"asset_url":"https://safe-supabase-kong.caprover.al-arcade.com/storage/v1/object/public/profile-images/branding/chess_piece_rook.png?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE4OTM0NTYwMDB9.31PF6PvP-pSrvRuQwLFptQoejR0W1A7o53lZhEbnz84&v=1780635943","asset_url_dark":null,"asset_url_ar":null,"fallback_type":"color","fallback_value":null,"mime_type":null,"dimensions":"64x64","file_size_kb":null,"assigned_by":null,"assigned_at":null,"is_required":false,"sort_order":0,"created_at":"2026-06-05T05:05:46.262811+00:00","updated_at":"2026-06-05T05:05:46.262811+00:00"},
{"id":"chess_piece_wB","category":"chess","label":"chess_piece_wB","label_ar":null,"description":null,"asset_url":"https://safe-supabase-kong.caprover.al-arcade.com/storage/v1/object/public/profile-images/branding/chess_piece_wB.png?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE4OTM0NTYwMDB9.31PF6PvP-pSrvRuQwLFptQoejR0W1A7o53lZhEbnz84&v=1780707459","asset_url_dark":null,"asset_url_ar":null,"fallback_type":"color","fallback_value":null,"mime_type":null,"dimensions":"128x128","file_size_kb":null,"assigned_by":null,"assigned_at":null,"is_required":false,"sort_order":0,"created_at":"2026-06-05T05:05:44.917226+00:00","updated_at":"2026-06-05T05:05:44.917226+00:00"},
{"id":"chess_piece_wK","category":"chess","label":"chess_piece_wK","label_ar":null,"description":null,"asset_url":"https://safe-supabase-kong.caprover.al-arcade.com/storage/v1/object/public/profile-images/branding/chess_piece_kingW.png?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE4OTM0NTYwMDB9.31PF6PvP-pSrvRuQwLFptQoejR0W1A7o53lZhEbnz84&v=1780635943","asset_url_dark":null,"asset_url_ar":null,"fallback_type":"color","fallback_value":null,"mime_type":null,"dimensions":"64x64","file_size_kb":null,"assigned_by":null,"assigned_at":null,"is_required":false,"sort_order":0,"created_at":"2026-06-05T05:05:44.165019+00:00","updated_at":"2026-06-05T05:05:44.165019+00:00"},
{"id":"chess_piece_wN","category":"chess","label":"chess_piece_wN","label_ar":null,"description":null,"asset_url":"https://safe-supabase-kong.caprover.al-arcade.com/storage/v1/object/public/profile-images/branding/chess_piece_KnightW.png?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE4OTM0NTYwMDB9.31PF6PvP-pSrvRuQwLFptQoejR0W1A7o53lZhEbnz84&v=1780635943","asset_url_dark":null,"asset_url_ar":null,"fallback_type":"color","fallback_value":null,"mime_type":null,"dimensions":"64x64","file_size_kb":null,"assigned_by":null,"assigned_at":null,"is_required":false,"sort_order":0,"created_at":"2026-06-05T05:05:45.220201+00:00","updated_at":"2026-06-05T05:05:45.220201+00:00"},
{"id":"chess_piece_wP","category":"chess","label":"chess_piece_wP","label_ar":null,"description":null,"asset_url":"https://safe-supabase-kong.caprover.al-arcade.com/storage/v1/object/public/profile-images/branding/chess_piece_wP.png?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE4OTM0NTYwMDB9.31PF6PvP-pSrvRuQwLFptQoejR0W1A7o53lZhEbnz84&v=1780707466","asset_url_dark":null,"asset_url_ar":null,"fallback_type":"color","fallback_value":null,"mime_type":null,"dimensions":"128x128","file_size_kb":null,"assigned_by":null,"assigned_at":null,"is_required":false,"sort_order":0,"created_at":"2026-06-05T05:05:45.454361+00:00","updated_at":"2026-06-05T05:05:45.454361+00:00"},
{"id":"chess_piece_wQ","category":"chess","label":"chess_piece_wQ","label_ar":null,"description":null,"asset_url":"https://safe-supabase-kong.caprover.al-arcade.com/storage/v1/object/public/profile-images/branding/chess_piece_queenW.png?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE4OTM0NTYwMDB9.31PF6PvP-pSrvRuQwLFptQoejR0W1A7o53lZhEbnz84&v=1780635943","asset_url_dark":null,"asset_url_ar":null,"fallback_type":"color","fallback_value":null,"mime_type":null,"dimensions":"64x64","file_size_kb":null,"assigned_by":null,"assigned_at":null,"is_required":false,"sort_order":0,"created_at":"2026-06-05T05:05:44.38628+00:00","updated_at":"2026-06-05T05:05:44.38628+00:00"},
{"id":"chess_piece_wR","category":"chess","label":"chess_piece_wR","label_ar":null,"description":null,"asset_url":"https://safe-supabase-kong.caprover.al-arcade.com/storage/v1/object/public/profile-images/branding/chess_piece_rookW.png?apikey=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjE4OTM0NTYwMDB9.31PF6PvP-pSrvRuQwLFptQoejR0W1A7o53lZhEbnz84&v=1780635943","asset_url_dark":null,"asset_url_ar":null,"fallback_type":"color","fallback_value":null,"mime_type":null,"dimensions":"64x64","file_size_kb":null,"assigned_by":null,"assigned_at":null,"is_required":false,"sort_order":0,"created_at":"2026-06-05T05:05:44.690936+00:00","updated_at":"2026-06-05T05:05:44.690936+00:00"}]
......@@ -28,6 +28,8 @@ function palette() {
PAL.check = getColor('board_check', '#FF4D5E');
PAL.ink = getColor('ink', '#1A1722');
PAL.ink2 = getColor('ink_2', '#4B4558');
PAL.ink3 = getColor('ink_3', '#7D768C');
PAL.whiteLip = getColor('silver_edge', '#9B94AE');
PAL.card = getColor('card', '#FFFFFF');
PAL.cardEdge = getColor('card_edge', '#CFC9DA');
PAL.lipDark = getColor('back_950', '#0D0C12');
......@@ -68,7 +70,8 @@ function imageFor(piece) {
}
// The drawn pieces: the fallback when no art is uploaded or an image fails.
// Canvas paths on a 45-unit grid. White is white with a thin lip-coloured edge,
// Canvas paths on a 45-unit grid. White is white with a thin mid-grey edge (so it
// reads on the light squares),
// Black is ink with a slightly lighter edge so it reads on the dark squares.
const PIECE_SHAPES = { k: kingPath, q: queenPath, r: rookPath, b: bishopPath, n: knightPath, p: pawnPath };
......@@ -81,8 +84,8 @@ function drawVectorPiece(ctx, piece, x, y, s) {
ctx.translate(x, y);
ctx.scale(s / 45, s / 45);
ctx.fillStyle = white ? P.card : P.ink;
ctx.strokeStyle = white ? P.cardEdge : P.ink2;
ctx.lineWidth = 1.2;
ctx.strokeStyle = white ? P.ink3 : P.ink2;
ctx.lineWidth = white ? 1.4 : 1.2;
ctx.lineJoin = 'round';
ctx.lineCap = 'round';
shape(ctx);
......@@ -548,7 +551,7 @@ export class ChessBoard {
const sg = shape.getContext('2d');
paintPiece(sg, piece, px * 0.06, px * 0.03, px * 0.88);
sg.globalCompositeOperation = 'source-in';
sg.fillStyle = white ? P.cardEdge : P.lipDark;
sg.fillStyle = white ? P.whiteLip : P.lipDark;
sg.fillRect(0, 0, px, px);
s = document.createElement('canvas');
s.width = s.height = px;
......
......@@ -28,6 +28,7 @@ const GUEST = args.includes('--guest');
const ANON = args.includes('--anon'); // signed out: the first-run screens
const WITH_FRIEND = args.includes('--with-friend'); // a second account, befriended and online
const RAW_THEME = args.includes('--raw-theme');
const DROP_ASSETS = argOf('--drop-assets', ''); // regex: stored asset ids to hide, to preview the built-in art
const PUSH = argOf('--push', '');
const PARAMS = argOf('--params', '{}');
const NAME = argOf('--name', PUSH);
......@@ -166,6 +167,7 @@ try {
if (!RAW_THEME && req.url().includes('/api/branding.php') && req.method() === 'GET') {
const res = await fetch(req.url()).then(x => x.json()).catch(() => ({}));
for (const k of Object.keys(res)) if (THEME_KEYS.test(k)) delete res[k];
if (DROP_ASSETS && res.assets) for (const k of Object.keys(res.assets)) if (new RegExp(DROP_ASSETS).test(k)) delete res.assets[k];
return req.respond({ status: 200, contentType: 'application/json', body: JSON.stringify(res) });
}
req.continue();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment