Skip to content

Commit d972640

Browse files
committed
Fix fe
1 parent da5f383 commit d972640

3 files changed

Lines changed: 99 additions & 59 deletions

File tree

apps/codebattle/assets/js/widgets/pages/game/ThreejsGamePage.jsx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ const baseEditorOptions = {
195195
contextmenu: false,
196196
};
197197

198-
const DEFAULT_FONT_SIZE = 24;
198+
const DEFAULT_FONT_SIZE = 22;
199199
const MIN_FONT_SIZE = 10;
200200
const MAX_FONT_SIZE = 64;
201201

@@ -309,9 +309,10 @@ function Pane({
309309
};
310310

311311
return (
312-
<div style={wrapperStyle} onMouseDown={onBringToFront}>
312+
<div style={wrapperStyle} onMouseDown={onBringToFront} role="presentation">
313313
{showHeader && (
314314
<div
315+
role="presentation"
315316
onMouseDown={editMode ? onDragStart : undefined}
316317
style={{
317318
background: "#060a12",
@@ -335,6 +336,7 @@ function Pane({
335336
</span>
336337
{editMode && (
337338
<div
339+
role="presentation"
338340
style={{ display: "flex", alignItems: "center", gap: "6px" }}
339341
onMouseDown={(e) => e.stopPropagation()}
340342
>
@@ -379,6 +381,7 @@ function Pane({
379381
{!showHeader && editMode && (
380382
<>
381383
<div
384+
role="presentation"
382385
onMouseDown={onDragStart}
383386
style={{
384387
position: "absolute",
@@ -423,6 +426,7 @@ function Pane({
423426
<div style={{ flexGrow: 1, minHeight: 0, ...bodyStyle }}>{children}</div>
424427
{editMode && (
425428
<div
429+
role="presentation"
426430
onMouseDown={onResizeStart}
427431
style={{
428432
position: "absolute",
@@ -639,9 +643,13 @@ function TimerBody({ deadlineMs, gameState }) {
639643
return () => clearInterval(id);
640644
}, []);
641645

642-
const remaining = deadlineMs ? Math.max(0, Math.floor((deadlineMs - now) / 1000)) : null;
643-
const danger = remaining !== null && remaining < 60;
644-
const finished = gameState === "game_over" || gameState === "timeout" || remaining === 0;
646+
const finished = ["game_over", "timeout", "canceled", "finished"].includes(gameState);
647+
const remaining = finished
648+
? 0
649+
: deadlineMs
650+
? Math.max(0, Math.floor((deadlineMs - now) / 1000))
651+
: null;
652+
const danger = !finished && remaining !== null && remaining < 60;
645653

646654
return (
647655
<div
@@ -713,8 +721,8 @@ function ThreejsGamePage() {
713721
return {
714722
leftEditor: DEFAULT_FONT_SIZE,
715723
rightEditor: DEFAULT_FONT_SIZE,
716-
task: 24,
717-
examples: 24,
724+
task: 22,
725+
examples: 22,
718726
...(preset?.fontSizes || {}),
719727
};
720728
});
@@ -829,8 +837,8 @@ function ThreejsGamePage() {
829837
setFontSizes({
830838
leftEditor: DEFAULT_FONT_SIZE,
831839
rightEditor: DEFAULT_FONT_SIZE,
832-
task: 24,
833-
examples: 24,
840+
task: 22,
841+
examples: 22,
834842
});
835843
setZOrder({
836844
task: 1,

apps/codebattle/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
"oxc-minify": "^0.114.0",
162162
"oxfmt": "^0.33.0",
163163
"oxlint": "^1.48.0",
164-
"postcss": "^8.5.6",
164+
"postcss": "^8.5.10",
165165
"postcss-scss": "^4.0.9",
166166
"prettier": "^3.8.1",
167167
"react-refresh": "^0.18.0",
@@ -183,8 +183,10 @@
183183
"lodash-es": "^4.18.0",
184184
"picomatch@<2.3.2": "^2.3.2",
185185
"picomatch@>=4.0.0 <4.0.4": "^4.0.4",
186+
"postcss": "^8.5.10",
186187
"qs": "^6.14.2",
187188
"rollup": "^4.59.0",
189+
"uuid": "^14.0.0",
188190
"yaml@>=1.0.0 <1.10.3": "^1.10.3"
189191
},
190192
"onlyBuiltDependencies": [

0 commit comments

Comments
 (0)