From fd2442c73fc5c4aabba98ac63c583c0e2fec188e Mon Sep 17 00:00:00 2001 From: DevAlissu Date: Sun, 19 Apr 2026 14:21:45 -0400 Subject: [PATCH 1/2] adiciona legenda de comidas no painel lateral - novo componente FoodLegend exibindo tipos de food com cores e valores - wire-up no painel lateral do SnakeGame abaixo do botao pular --- src/features/snake-game/SnakeGame.tsx | 15 ++++++------ .../snake-game/components/FoodLegend.tsx | 23 +++++++++++++++++++ 2 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 src/features/snake-game/components/FoodLegend.tsx diff --git a/src/features/snake-game/SnakeGame.tsx b/src/features/snake-game/SnakeGame.tsx index 3e6d657..049c9b5 100644 --- a/src/features/snake-game/SnakeGame.tsx +++ b/src/features/snake-game/SnakeGame.tsx @@ -12,6 +12,7 @@ import { GameTabs } from './components/GameTabs'; import { HighScoreBadge } from './components/HighScoreBadge'; import { Countdown } from './components/Countdown'; import { PauseOverlay } from './components/PauseOverlay'; +import { FoodLegend } from './components/FoodLegend'; import { useSwipe } from './hooks/useSwipe'; interface SnakeGameProps { @@ -53,7 +54,7 @@ export function SnakeGame({ className = '' }: SnakeGameProps) { return (
-
+
-
-
- - -
- +
+ + +
); diff --git a/src/features/snake-game/components/FoodLegend.tsx b/src/features/snake-game/components/FoodLegend.tsx new file mode 100644 index 0000000..71512c7 --- /dev/null +++ b/src/features/snake-game/components/FoodLegend.tsx @@ -0,0 +1,23 @@ +import { memo } from 'react'; +import { FOOD_TYPES } from '../constants'; +import type { FoodType } from '../types'; + +const ORDER: FoodType[] = ['function', 'class', 'async']; + +export const FoodLegend = memo(function FoodLegend() { + return ( +
+

// comidas

+ {ORDER.map((type) => { + const { points, color, label } = FOOD_TYPES[type]; + return ( +
+ + {label} + +{points} +
+ ); + })} +
+ ); +}); From 1f05039dca2951c468b8f55ef982d80e9cc0db07 Mon Sep 17 00:00:00 2001 From: DevAlissu Date: Sun, 19 Apr 2026 14:21:55 -0400 Subject: [PATCH 2/2] ajusta layout do snake game para responsividade e zoom - oculta jogo no mobile (hidden lg:flex) - grid do HomePage com [1fr_auto] para snake com largura fit-content - canvas com max-width responsivo baseado em altura (min 400px 50vh) - outer canvas com padding maior gerando moldura lateral visivel - painel lateral direito com largura fixa 140px shrink-0 e altura estendida - GameControls compactado (botoes 36px 40px padding menor) - left col com w-auto e min-w-0 para shrink natural --- src/features/home/HomePage.tsx | 6 +++--- src/features/snake-game/components/GameCanvas.tsx | 4 ++-- src/features/snake-game/components/GameControls.tsx | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/features/home/HomePage.tsx b/src/features/home/HomePage.tsx index dd9dd42..dd544ba 100644 --- a/src/features/home/HomePage.tsx +++ b/src/features/home/HomePage.tsx @@ -7,8 +7,8 @@ const SnakeGame = lazy(() => export function HomePage() { return (
-
-
+
+

@@ -44,7 +44,7 @@ export function HomePage() {

-
+
}> diff --git a/src/features/snake-game/components/GameCanvas.tsx b/src/features/snake-game/components/GameCanvas.tsx index 2018120..353a58c 100644 --- a/src/features/snake-game/components/GameCanvas.tsx +++ b/src/features/snake-game/components/GameCanvas.tsx @@ -86,8 +86,8 @@ export const GameCanvas = memo(function GameCanvas({ food, gridSize, particles, }, [gridSize]); return ( -
-
+
+
-

- // use teclado ou swipe +

+

+ // teclado ou swipe

-
+