diff --git a/css/style.css b/css/style.css index cd565ed..fb2bba5 100644 --- a/css/style.css +++ b/css/style.css @@ -137,6 +137,16 @@ body::before { letter-spacing: -0.5px; } +/* ── Player colours (assigned in JS by join order) ── */ +.finger.c1 { border-color: rgba(192,132,252,0.7); background: rgba(192,132,252,0.13); } +.finger.c2 { border-color: rgba(96,165,250,0.7); background: rgba(96,165,250,0.13); } +.finger.c3 { border-color: rgba(251,146,60,0.7); background: rgba(251,146,60,0.13); } +.finger.c4 { border-color: rgba(244,114,182,0.7); background: rgba(244,114,182,0.13); } +.finger.c5 { border-color: rgba(34,211,238,0.7); background: rgba(34,211,238,0.13); } +.finger.c6 { border-color: rgba(250,204,21,0.7); background: rgba(250,204,21,0.13); } +.finger.c7 { border-color: rgba(248,113,113,0.7); background: rgba(248,113,113,0.13); } +.finger.c8 { border-color: rgba(163,230,53,0.7); background: rgba(163,230,53,0.13); } + /* Highlight: amber glow */ .finger.highlight { border-color: #f59e0b; diff --git a/js/app.js b/js/app.js index 13d1f19..cb8939f 100644 --- a/js/app.js +++ b/js/app.js @@ -1,7 +1,17 @@ document.addEventListener('DOMContentLoaded', function(){ const stage = document.getElementById('stage'); - const touches = new Map(); // id -> {el,x,y} + const touches = new Map(); // id -> {el,x,y,colorIdx} const MAX_TOUCHES = /iPhone/.test(navigator.userAgent) ? 5 : 20; + const COLOR_CLASSES = ['c1','c2','c3','c4','c5','c6','c7','c8']; + const usedColors = new Set(); + + function pickColor(){ + for(let i=0; inode.remove()); touches.clear(); + usedColors.clear(); },160); } }