@littlepartytime/dev-kit 1.6.1 → 1.7.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.
|
@@ -9,6 +9,10 @@ const INNER_R = OUTER_R - BEZEL;
|
|
|
9
9
|
const BODY_W = SCREEN_W + BEZEL * 2;
|
|
10
10
|
const BODY_H = SCREEN_H + BEZEL * 2;
|
|
11
11
|
|
|
12
|
+
// iPhone 14/15 safe area insets (portrait)
|
|
13
|
+
const SAFE_AREA_TOP = 59; // Dynamic Island
|
|
14
|
+
const SAFE_AREA_BOTTOM = 34; // Home Indicator
|
|
15
|
+
|
|
12
16
|
export default function PhoneFrame({ children }: { children: React.ReactNode }) {
|
|
13
17
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
14
18
|
const [scale, setScale] = useState(1);
|
|
@@ -74,7 +78,21 @@ export default function PhoneFrame({ children }: { children: React.ReactNode })
|
|
|
74
78
|
contain: 'paint',
|
|
75
79
|
}}
|
|
76
80
|
>
|
|
77
|
-
{
|
|
81
|
+
{/* Safe area: game content is constrained here.
|
|
82
|
+
contain:paint makes this the containing block for
|
|
83
|
+
position:fixed elements inside the game. */}
|
|
84
|
+
<div
|
|
85
|
+
className="absolute overflow-hidden"
|
|
86
|
+
style={{
|
|
87
|
+
top: SAFE_AREA_TOP,
|
|
88
|
+
left: 0,
|
|
89
|
+
right: 0,
|
|
90
|
+
bottom: SAFE_AREA_BOTTOM,
|
|
91
|
+
contain: 'paint',
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{children}
|
|
95
|
+
</div>
|
|
78
96
|
</div>
|
|
79
97
|
|
|
80
98
|
{/* Dynamic Island */}
|
|
@@ -191,15 +191,35 @@ export default function Preview() {
|
|
|
191
191
|
{/* Player Switcher */}
|
|
192
192
|
<div className="bg-zinc-900 rounded-lg p-3">
|
|
193
193
|
<h3 className="text-sm font-bold text-zinc-400 mb-2">Current Player</h3>
|
|
194
|
-
<
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
194
|
+
<div className="space-y-1">
|
|
195
|
+
{mockPlayers.map((p, i) => {
|
|
196
|
+
const isActive = i === playerIndex;
|
|
197
|
+
const hue = (i * 137) % 360; // deterministic color per player
|
|
198
|
+
return (
|
|
199
|
+
<button
|
|
200
|
+
key={p.id}
|
|
201
|
+
onClick={() => setPlayerIndex(i)}
|
|
202
|
+
className={`w-full flex items-center gap-2 px-2 py-1.5 rounded text-sm text-left transition-colors ${
|
|
203
|
+
isActive
|
|
204
|
+
? 'bg-amber-600/20 ring-1 ring-amber-500 text-white'
|
|
205
|
+
: 'bg-zinc-800 hover:bg-zinc-700 text-zinc-300'
|
|
206
|
+
}`}
|
|
207
|
+
>
|
|
208
|
+
{/* Avatar */}
|
|
209
|
+
<div
|
|
210
|
+
className="w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold shrink-0"
|
|
211
|
+
style={{ background: `hsl(${hue}, 55%, 45%)` }}
|
|
212
|
+
>
|
|
213
|
+
{p.nickname[0]}
|
|
214
|
+
</div>
|
|
215
|
+
<span className="truncate">{p.nickname}</span>
|
|
216
|
+
{p.isHost && (
|
|
217
|
+
<span className="ml-auto text-[10px] text-amber-400 shrink-0">HOST</span>
|
|
218
|
+
)}
|
|
219
|
+
</button>
|
|
220
|
+
);
|
|
221
|
+
})}
|
|
222
|
+
</div>
|
|
203
223
|
</div>
|
|
204
224
|
|
|
205
225
|
{/* Game Result */}
|