Switch chessboard to tap-tap interaction and fix/enhance premoving

This commit is contained in:
tyuXX 2026-11-22 19:13:24 +03:00
parent e2e085b341
commit 02b8bafb1e
6 changed files with 364 additions and 294 deletions

View file

@ -17,7 +17,8 @@
--sq-dark: #b58863;
--sq-last: rgba(155, 199, 0, 0.42);
--sq-selected: rgba(20, 85, 30, 0.52);
--sq-premove: rgba(35, 105, 175, 0.5);
--sq-premove: rgba(41, 121, 255, 0.45);
--sq-premove-selected: rgba(41, 121, 255, 0.52);
--coord-light: #9e7350;
--coord-dark: #f0d9b5;
}
@ -1009,6 +1010,8 @@ a {
user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: transparent;
touch-action: manipulation;
}
.board-wrap {
@ -1036,6 +1039,11 @@ a {
height: 12.5%;
}
.sq-interactive,
.sq-target {
cursor: pointer;
}
.sq-light {
background: var(--sq-light);
}
@ -1077,6 +1085,17 @@ a {
pointer-events: none;
}
.sq-premove-selected:after {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: var(--sq-premove-selected);
pointer-events: none;
}
.sq-check {
background: radial-gradient(ellipse at center, #ff1111 0%, #c92020 55%, rgba(200, 0, 0, 0) 85%);
}
@ -1120,7 +1139,7 @@ a {
bottom: 3%;
left: 3%;
z-index: 3;
cursor: pointer;
pointer-events: none;
}
.piece-svg {
@ -1129,17 +1148,6 @@ a {
display: block;
}
.piece-dragging-origin {
opacity: 0.25;
}
.drag-ghost {
position: fixed;
z-index: 999;
pointer-events: none;
transform: translate(-50%, -50%);
}
.hint-dot {
position: absolute;
top: 36%;
@ -1164,6 +1172,30 @@ a {
pointer-events: none;
}
.hint-premove-dot {
position: absolute;
top: 36%;
left: 36%;
width: 28%;
height: 28%;
border-radius: 50%;
background: rgba(41, 121, 255, 0.58);
z-index: 4;
pointer-events: none;
}
.hint-premove-capture {
position: absolute;
top: 6%;
right: 6%;
bottom: 6%;
left: 6%;
border-radius: 50%;
border: 4px solid rgba(41, 121, 255, 0.65);
z-index: 4;
pointer-events: none;
}
.board-arrows {
position: absolute;
top: 0;
@ -1222,6 +1254,7 @@ a {
cursor: pointer;
}
.premove-banner,
.live-notice {
margin-top: 6px;
padding: 6px 10px;
@ -1233,6 +1266,10 @@ a {
font-size: 12px;
}
.premove-banner {
border-left: 3px solid #2979ff;
}
.game-meta-line {
font-size: 12px;
color: var(--muted);