Skip to content

Commit a2cf7ba

Browse files
committed
[EXT] Popup overflow solved
1 parent 1625b0b commit a2cf7ba

3 files changed

Lines changed: 45 additions & 26 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[![CI/CD](https://github.com/stevenselcuk/onelittlemistake/actions/workflows/ci.yml/badge.svg)](https://github.com/stevenselcuk/onelittlemistake/actions/workflows/ci.yml)
88

9-
[Play Now](https://onelittlemistake.tabbythecat.com/) | [Staging](https://stevenselcuk.github.io/OneLittleMistake/) | [iOS\*](https://apps.apple.com/us/app/one-little-mistake/id6759854640)
9+
[Play Now](https://onelittlemistake.tabbythecat.com/) | [Staging](https://stevenselcuk.github.io/OneLittleMistake/) | [Chrome Extension](https://chromewebstore.google.com/detail/one-little-mistake/hkpdjognnjlfdodllndjmijkikanfcli) | [iOS\*](https://apps.apple.com/us/app/one-little-mistake/id6759854640)
1010

1111
\*_iOS comes with multiplayer support, leaderboards and achievements_
1212

src/App.tsx

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ export default function App() {
6868
const [turn, setTurn] = useState<Player>(() => initialGameState?.turn ?? INITIAL_STARTER);
6969
const [scores, setScores] = useState(() => initialGameState?.scores ?? { P: 0, C: 0 });
7070
const [gameOver, setGameOver] = useState(false);
71-
const [lastLineId, setLastLineId] = useState<string | null>(() => initialGameState?.lastLineId ?? null);
71+
const [lastLineId, setLastLineId] = useState<string | null>(
72+
() => initialGameState?.lastLineId ?? null,
73+
);
7274
const [toast, setToast] = useState<{ message: string; isVisible: boolean }>(() => {
7375
if (initialGameState) {
7476
return { message: 'Game loaded!', isVisible: true };
@@ -275,39 +277,45 @@ export default function App() {
275277

276278
return (
277279
<div
278-
className={`min-h-screen ${theme.appBg} ${theme.appText} flex flex-col items-center p-4 font-sans transition-colors duration-500`}
280+
className={`h-full w-full overflow-hidden ${theme.appBg} ${theme.appText} flex flex-col items-center p-4 font-sans transition-colors duration-500`}
279281
>
280282
<h1 className="sr-only">One Little Mistake - Dots and Boxes Game</h1>
281283
<motion.div
282284
initial={{ opacity: 0 }}
283285
animate={{ opacity: 1 }}
284-
className="flex w-full max-w-[512px] flex-1 flex-col items-center justify-center pb-12"
286+
className="flex min-h-0 w-full max-w-[500px] flex-1 flex-col items-center justify-between pb-2"
285287
>
286-
<ScoreBoard
287-
scores={scores}
288-
turn={turn}
289-
gameOver={gameOver}
290-
onReset={() => resetGame()}
291-
theme={theme}
292-
themeName={themeName}
293-
onThemeChange={setThemeName}
294-
onInfoOpen={() => setIsInfoOpen(true)}
295-
/>
296-
297-
<div className="mt-4 flex aspect-square w-full max-w-[512px] items-center justify-center">
298-
<GameBoard
299-
gridSize={gridSize}
300-
lines={lines}
301-
squares={squares}
302-
onLineClick={handleLineClick}
288+
<div className="w-full shrink-0">
289+
<ScoreBoard
290+
scores={scores}
303291
turn={turn}
292+
gameOver={gameOver}
293+
onReset={() => resetGame()}
304294
theme={theme}
305-
lastLineId={lastLineId}
295+
themeName={themeName}
296+
onThemeChange={setThemeName}
297+
onInfoOpen={() => setIsInfoOpen(true)}
306298
/>
307299
</div>
308300

301+
<div className="my-2 flex min-h-0 w-full flex-1 items-center justify-center">
302+
<div className="relative aspect-square h-full max-w-full">
303+
<div className="absolute inset-0">
304+
<GameBoard
305+
gridSize={gridSize}
306+
lines={lines}
307+
squares={squares}
308+
onLineClick={handleLineClick}
309+
turn={turn}
310+
theme={theme}
311+
lastLineId={lastLineId}
312+
/>
313+
</div>
314+
</div>
315+
</div>
316+
309317
<div
310-
className={`mt-8 flex items-center justify-center gap-6 font-mono text-xs ${theme.mutedText} transition-colors duration-500`}
318+
className={`flex shrink-0 items-center justify-center gap-6 font-mono text-xs ${theme.mutedText} transition-colors duration-500`}
311319
>
312320
{LEVELS.map((size) => {
313321
const isUnlocked = size <= maxUnlocked;

src/index.css

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@
88

99
html,
1010
body {
11-
width: 600px;
12-
height: 800px;
11+
width: 500px;
12+
height: 600px;
13+
min-width: 500px;
14+
min-height: 600px;
15+
max-width: 500px;
16+
max-height: 600px;
1317
margin: 0;
1418
padding: 0;
15-
overflow-x: hidden;
19+
overflow: hidden;
20+
box-sizing: border-box;
21+
}
22+
23+
#root {
24+
width: 100%;
25+
height: 100%;
26+
overflow: hidden;
1627
}

0 commit comments

Comments
 (0)