refactor: reduce snake animation delays for snappier gameplay
Remove transitions and simplify head-pop animation to feel more responsive at higher speed settings.
This commit is contained in:
@@ -75,15 +75,13 @@
|
|||||||
.snake-cell {
|
.snake-cell {
|
||||||
background: #16213e;
|
background: #16213e;
|
||||||
border: 1px solid rgba(255,255,255,0.03);
|
border: 1px solid rgba(255,255,255,0.03);
|
||||||
transition: background 130ms ease-in-out, box-shadow 130ms ease-out;
|
|
||||||
}
|
}
|
||||||
.snake-cell.snake-head {
|
.snake-cell.snake-head {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
animation: head-pop 130ms ease-out;
|
animation: head-pop 50ms ease-out;
|
||||||
}
|
}
|
||||||
@keyframes head-pop {
|
@keyframes head-pop {
|
||||||
0% { transform: scale(0.6); }
|
0% { transform: scale(0.85); }
|
||||||
50% { transform: scale(1.08); }
|
|
||||||
100% { transform: scale(1); }
|
100% { transform: scale(1); }
|
||||||
}
|
}
|
||||||
.snake-cell.snake-food {
|
.snake-cell.snake-food {
|
||||||
@@ -99,6 +97,6 @@
|
|||||||
.snake-cell.snake-dead {
|
.snake-cell.snake-dead {
|
||||||
opacity: 0.35;
|
opacity: 0.35;
|
||||||
filter: grayscale(0.5);
|
filter: grayscale(0.5);
|
||||||
transition: opacity 400ms ease-out, background 130ms ease-in-out;
|
transition: opacity 400ms ease-out;
|
||||||
}
|
}
|
||||||
.snake-wrapper:focus { outline: none; }
|
.snake-wrapper:focus { outline: none; }
|
||||||
|
|||||||
Reference in New Issue
Block a user