@littlepartytime/dev-kit 1.21.2 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/webapp/index.html +11 -2
- package/dist/webapp/pages/Mobile.tsx +40 -20
- package/package.json +1 -1
package/dist/webapp/index.html
CHANGED
|
@@ -8,8 +8,17 @@
|
|
|
8
8
|
/* ── Dev-Kit UI base ── */
|
|
9
9
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
10
10
|
html, body { background: #0a0a0a; color: #e5e5e5; font-family: system-ui, -apple-system, sans-serif; overflow: hidden; overscroll-behavior: none; }
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
|
|
12
|
+
/* ── Game sandbox: mirrors platform globals.css ── */
|
|
13
|
+
.game-sandbox {
|
|
14
|
+
height: 100%;
|
|
15
|
+
padding-top: env(safe-area-inset-top, 0px);
|
|
16
|
+
padding-bottom: env(safe-area-inset-bottom, 0px);
|
|
17
|
+
}
|
|
18
|
+
.game-sandbox, .game-sandbox * {
|
|
19
|
+
-webkit-user-select: auto;
|
|
20
|
+
user-select: auto;
|
|
21
|
+
touch-action: auto;
|
|
13
22
|
}
|
|
14
23
|
|
|
15
24
|
/* ── Interactive states (can't be expressed as inline styles) ── */
|
|
@@ -5,18 +5,31 @@ import PlatformTakeover from '../components/PlatformTakeover';
|
|
|
5
5
|
declare const __SOCKET_PORT__: number;
|
|
6
6
|
declare const __DEV_KIT_MODE__: string;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Root container mirrors the platform's room page:
|
|
10
|
+
* <div class="h-[100dvh] flex flex-col overflow-hidden">
|
|
11
|
+
* No position:fixed — uses 100dvh which shrinks with mobile keyboard.
|
|
12
|
+
*/
|
|
13
|
+
const rootStyle: React.CSSProperties = {
|
|
10
14
|
height: '100dvh',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: 'column',
|
|
11
17
|
overflow: 'hidden',
|
|
12
|
-
position: 'fixed',
|
|
13
|
-
top: 0,
|
|
14
|
-
left: 0,
|
|
15
18
|
background: '#0a0a0a',
|
|
16
19
|
color: '#e5e5e5',
|
|
17
20
|
fontFamily: 'system-ui, -apple-system, sans-serif',
|
|
18
21
|
};
|
|
19
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Game outer wrapper mirrors the platform's flex-1 scrollable area:
|
|
25
|
+
* <div class="flex-1 min-h-0 overflow-y-auto">
|
|
26
|
+
*/
|
|
27
|
+
const gameOuterStyle: React.CSSProperties = {
|
|
28
|
+
flex: 1,
|
|
29
|
+
minHeight: 0,
|
|
30
|
+
overflowY: 'auto',
|
|
31
|
+
};
|
|
32
|
+
|
|
20
33
|
export default function Mobile() {
|
|
21
34
|
const [socket, setSocket] = useState<Socket | null>(null);
|
|
22
35
|
const [nickname, setNickname] = useState('');
|
|
@@ -108,7 +121,7 @@ export default function Mobile() {
|
|
|
108
121
|
// Join screen
|
|
109
122
|
if (!joined) {
|
|
110
123
|
return (
|
|
111
|
-
<div style={{ ...
|
|
124
|
+
<div style={{ ...rootStyle, alignItems: 'center', justifyContent: 'center' }}>
|
|
112
125
|
<div style={{ width: '85%', maxWidth: 320 }}>
|
|
113
126
|
<h2 style={{ fontSize: 20, fontWeight: 700, marginBottom: 16, textAlign: 'center' }}>Join Game</h2>
|
|
114
127
|
<input
|
|
@@ -133,7 +146,7 @@ export default function Mobile() {
|
|
|
133
146
|
// Lobby
|
|
134
147
|
if (room.phase === 'lobby' || room.phase === 'ready') {
|
|
135
148
|
return (
|
|
136
|
-
<div style={{ ...
|
|
149
|
+
<div style={{ ...rootStyle, padding: 16 }}>
|
|
137
150
|
<h2 style={{ fontSize: 20, fontWeight: 700, marginBottom: 16 }}>Lobby</h2>
|
|
138
151
|
<div style={{ flex: 1, overflow: 'auto', display: 'flex', flexDirection: 'column', gap: 8 }}>
|
|
139
152
|
{room.players.map((p: any) => (
|
|
@@ -169,20 +182,27 @@ export default function Mobile() {
|
|
|
169
182
|
);
|
|
170
183
|
}
|
|
171
184
|
|
|
172
|
-
// Game —
|
|
185
|
+
// Game — mirrors platform container structure:
|
|
186
|
+
// div.h-[100dvh].flex.flex-col.overflow-hidden (root)
|
|
187
|
+
// div.flex-1.min-h-0.overflow-y-auto (game outer)
|
|
188
|
+
// div.game-sandbox (safe area padding)
|
|
173
189
|
return (
|
|
174
|
-
<div style={
|
|
175
|
-
{
|
|
176
|
-
<
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
190
|
+
<div style={rootStyle}>
|
|
191
|
+
<div style={gameOuterStyle}>
|
|
192
|
+
<div className="game-sandbox">
|
|
193
|
+
{gameOver ? (
|
|
194
|
+
<PlatformTakeover
|
|
195
|
+
result={gameResult}
|
|
196
|
+
players={room.players.map((p: any) => ({ id: p.id, nickname: p.nickname }))}
|
|
197
|
+
onReturn={handleReturn}
|
|
198
|
+
/>
|
|
199
|
+
) : GameRenderer && platform && gameState ? (
|
|
200
|
+
<GameRenderer platform={platform} state={gameState} />
|
|
201
|
+
) : (
|
|
202
|
+
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%', color: '#71717a' }}>Loading game...</div>
|
|
203
|
+
)}
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
186
206
|
</div>
|
|
187
207
|
);
|
|
188
208
|
}
|