diff --git a/README.md b/README.md index ef2b907..b1917c8 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,9 @@ ## TODO - [x] add gray shades -- [ ] update icons -- [ ] manage UI buttons -- [ ] fix undo missing animation -- [ ] fix undo when circle picked +- [x] update icons +- [x] manage UI buttons +- [x] fix undo missing animation +- [x] fix undo when circle picked - [ ] add about page +- [ ] handle U, R and A keypresses diff --git a/src/App.svelte b/src/App.svelte index 9454a85..01c984a 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -122,15 +122,16 @@ const [src, dest, color] = moveStack.pop() circleColors[src] = color jumpReverse(circles, dest, src) + clearPick() + clearDests() victory = false gameover = false - - setTimeout(() => (circleColors = circleColors), duration) } } const getColor = i => colors[i % colors.length] const getDestColor = _ => circleColors[circles.indexOf(C_PICK)] + $: getCircleColor = i => { if (circles[i] == C_HOLE) return `bg-gray` if (circles[i] == C_POLE) return `bg-${circleColors[i]}` @@ -152,6 +153,9 @@ return common } + const clearPick = () => + (circles = circles.map(c => (c == C_PICK ? C_POLE : c))) + const clearDests = () => (circles = circles.map(c => (c == C_DEST ? C_HOLE : c)))