From c4238d19e8beccf749ee8341bac34ad5e2f2b7ba Mon Sep 17 00:00:00 2001 From: Daniel Dolezal Date: Mon, 6 Apr 2026 06:05:20 +0200 Subject: [PATCH] remove lines between snakes body parts --- server/templates/dashboard.html | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/server/templates/dashboard.html b/server/templates/dashboard.html index fff8cc8..18f5f0b 100644 --- a/server/templates/dashboard.html +++ b/server/templates/dashboard.html @@ -1776,10 +1776,11 @@ if (snakeBody.has(key)) { const hasHeadIcon = headIconByCell.has(key); const hasTailIcon = tailIconByCell.has(key); + const bodyColor = snakeBody.get(key); if (hasHeadIcon || hasTailIcon) { //cell.style.background = "var(--cell)"; } else { - cell.style.background = snakeBody.get(key); + cell.style.background = bodyColor; } if (selectedSnakeId && snakeIdByCell.get(key) !== selectedSnakeId) { cell.style.opacity = "0.2"; @@ -1796,24 +1797,33 @@ if (up && right && !down && !left) { cell.classList.add("snake-turn-cell"); cell.classList.add("snake-turn-dl"); - cell.style.setProperty("--turn-color", snakeBody.get(key)); + cell.style.setProperty("--turn-color", bodyColor); cell.style.background = "var(--cell)"; } else if (up && left && !down && !right) { cell.classList.add("snake-turn-cell"); cell.classList.add("snake-turn-dr"); - cell.style.setProperty("--turn-color", snakeBody.get(key)); + cell.style.setProperty("--turn-color", bodyColor); cell.style.background = "var(--cell)"; } else if (down && right && !up && !left) { cell.classList.add("snake-turn-cell"); cell.classList.add("snake-turn-ul"); - cell.style.setProperty("--turn-color", snakeBody.get(key)); + cell.style.setProperty("--turn-color", bodyColor); cell.style.background = "var(--cell)"; } else if (down && left && !up && !right) { cell.classList.add("snake-turn-cell"); cell.classList.add("snake-turn-ur"); - cell.style.setProperty("--turn-color", snakeBody.get(key)); + cell.style.setProperty("--turn-color", bodyColor); cell.style.background = "var(--cell)"; } + + const bridgeShadows = []; + if (up) bridgeShadows.push(`0 -1px 0 ${bodyColor}`); + if (down) bridgeShadows.push(`0 1px 0 ${bodyColor}`); + if (left) bridgeShadows.push(`-1px 0 0 ${bodyColor}`); + if (right) bridgeShadows.push(`1px 0 0 ${bodyColor}`); + if (bridgeShadows.length > 0) { + cell.style.boxShadow = bridgeShadows.join(", "); + } } } }