Skip to content

Commit 376ef8e

Browse files
committed
fixes
1 parent 5868c49 commit 376ef8e

File tree

5 files changed

+27
-13
lines changed

5 files changed

+27
-13
lines changed

services/app/apps/codebattle/assets/css/style.scss

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ $gold: #daa520;
4646
font-display: swap;
4747
}
4848

49+
@font-face {
50+
font-family: 'ExternalPlaneHugh';
51+
src: url('../static/fonts/ygh.ttf') format('truetype');
52+
font-weight: 900;
53+
font-style: normal;
54+
font-display: swap;
55+
}
56+
4957
$fa-font-path: '/fonts';
5058

5159
@import 'fonts';
@@ -2541,6 +2549,7 @@ a:hover {
25412549
}
25422550

25432551
.cb-stream-output-title {
2552+
font-family: 'ExternalPlaneHugh';
25442553
background-color: #FAFF0F;
25452554

25462555
margin: -3px;
@@ -2549,8 +2558,6 @@ a:hover {
25492558
border: 3px solid #FAFF0F;
25502559
border-radius: 25px;
25512560

2552-
font-weight: 700;
2553-
25542561
.winner & {
25552562
color: white;
25562563
background-color: #7642E8;
@@ -2634,14 +2641,14 @@ a:hover {
26342641
}
26352642

26362643
.cb-stream-output-data {
2637-
font-family: 'ExternalPlane';
26382644
color: #B6A4FF;
26392645
display: inline-block;
26402646
overflow: hidden;
26412647
white-space: nowrap;
26422648
background: rgba(0, 0, 0, 0);
26432649

26442650
margin-left: 0.7em;
2651+
font-family: 'ExternalPlaneBold';
26452652
}
26462653

26472654
.cb-stream-full-video {

services/app/apps/codebattle/assets/js/widgets/pages/stream/StreamEditorPanel.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function StreamEditorPanel({
6666
<div className="d-flex w-100 justify-content-end">
6767
<div
6868
style={{ fontSize: testBarFontSize }}
69-
className="d-flex align-items-center cb-stream-widget-text italic mr-2"
69+
className="d-flex align-items-center cb-stream-widget-text italic mr-2 pr-2"
7070
>
7171
{`${Math.round(((output.successCount || 0) * 100) / (output.assertsCount || 1))}/100`}
7272
</div>

services/app/apps/codebattle/assets/js/widgets/pages/stream/StreamFullPanel.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const getUrl = (id, isWinner) => (
2020
isWinner ? `/${id}-win.png` : `/${id}.png`
2121
);
2222

23-
const renderPlayerId = (id, verticalAlign) => (
24-
<span style={{ marginLeft: '-0.2em', verticalAlign }}>{id}</span>
23+
const renderPlayerId = (id, verticalAlign, marginBottom) => (
24+
<span style={{ marginLeft: '-0.2em', verticalAlign, marginBottom }}>{id}</span>
2525
);
2626

2727
const renderImg = (id, imgStyle, isWinner = false) => (
@@ -45,6 +45,7 @@ function StreamFullPanel({
4545
testBarHeight,
4646
testBarWinGifTop,
4747
testBarProgressGifTop,
48+
numberMarginBottom,
4849
progressGifSize,
4950
winGifSize,
5051
}) {
@@ -116,7 +117,7 @@ function StreamFullPanel({
116117
<div className="d-flex w-100 justify-content-between py-3 px-4" style={{ height: '25%', minHeight: '25%', maxHeight: '25%' }}>
117118
<div>
118119
<div className="cb-stream-tasks-stats cb-stream-full-task-stats cb-stream-widget-text">
119-
<span style={{ verticalAlign: statusVerticalAlign, fontSize: taskHeaderFontSize }}>
120+
<span style={{ verticalAlign: statusVerticalAlign, fontSize: taskHeaderFontSize, marginBottom: numberMarginBottom }}>
120121
{`${(game?.task?.id || 1) % 21}/21 ЗАДАЧ`}
121122
</span>
122123
</div>
@@ -165,7 +166,7 @@ function StreamFullPanel({
165166
}
166167
style={imgStyle}
167168
>
168-
{renderPlayerId(leftEditor?.playerId, statusVerticalAlign)}
169+
{renderPlayerId(leftEditor?.playerId, statusVerticalAlign, numberMarginBottom)}
169170
</div>
170171
{leftPlayer?.clanId && (
171172
<div className="cb-stream-player-clan h-100 position-relative mr-3">
@@ -238,7 +239,7 @@ function StreamFullPanel({
238239
}
239240
style={imgStyle}
240241
>
241-
{renderPlayerId(rightEditor?.playerId, statusVerticalAlign)}
242+
{renderPlayerId(rightEditor?.playerId, statusVerticalAlign, numberMarginBottom)}
242243
</div>
243244
{rightPlayer?.clanId && (
244245
<div className="cb-stream-player-clan h-100 position-relative mr-3">

services/app/apps/codebattle/assets/js/widgets/pages/stream/StreamTaskInfoPanel.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const renderImg = (id, imgStyle, isWinner) => (
1818
id ? <img style={imgStyle} src={getUrl(id, isWinner)} alt="" /> : <></>
1919
);
2020

21-
const renderPlayerId = (id, verticalAlign) => (
22-
<span style={{ marginLeft: '-0.2em', verticalAlign }}>{id}</span>
21+
const renderPlayerId = (id, verticalAlign, marginBottom) => (
22+
<span style={{ marginLeft: '-0.2em', verticalAlign, marginBottom }}>{id}</span>
2323
);
2424

2525
function StreamTaskInfoPanel({
@@ -35,6 +35,7 @@ function StreamTaskInfoPanel({
3535
width = '40%',
3636
outputTitleWidth = '24%',
3737
headerVerticalAlign = '-1px',
38+
numberMarginBottom,
3839
}) {
3940
const outputSelector = orientation === 'left' ? leftExecutionOutputSelector : rightExecutionOutputSelector;
4041
const playerSelector = orientation === 'left' ? firstPlayerSelector : secondPlayerSelector;
@@ -73,7 +74,7 @@ function StreamTaskInfoPanel({
7374
)
7475
}
7576
>
76-
<span style={{ verticalAlign: headerVerticalAlign }}>
77+
<span style={{ verticalAlign: headerVerticalAlign, numberMargin: numberMarginBottom }}>
7778
{`${(game?.task?.id || 1) % 21}/21 ЗАДАЧ`}
7879
</span>
7980
</div>
@@ -87,7 +88,7 @@ function StreamTaskInfoPanel({
8788
)}
8889
style={imgStyle}
8990
>
90-
{renderPlayerId(id, headerVerticalAlign)}
91+
{renderPlayerId(id, headerVerticalAlign, numberMarginBottom)}
9192
</div>
9293
<div
9394
className={

services/app/apps/codebattle/assets/js/widgets/pages/stream/StreamWidget.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const orientations = {
2525

2626
const toPxlStr = number => `${number}px`;
2727
const toPrcStr = number => `${number}%`;
28+
const toEmStr = number => `${number}em`;
2829

2930
const useWinnerHeader = (orientation, roomMachineState) => {
3031
const editorSelector = orientation === 'left' ? leftEditorSelector : rightEditorSelector;
@@ -69,6 +70,7 @@ function StreamWidget({
6970
const outputTitleWidth = toPrcStr(searchParams.has('outputTitleWidth') ? searchParams.get('outputTitleWidth') : 25);
7071
const progressGifSize = toPxlStr(searchParams.has('progressGifSize') ? searchParams.get('progressGifSize') : 100);
7172
const winGifSize = toPxlStr(searchParams.has('winGifSize') ? searchParams.get('winGifSize') : 100);
73+
const numberMarginBottom = toEmStr(searchParams.has('numberMarginBottom') ? searchParams.get('numberMarginBottom') : -0.09);
7274

7375
const { mainService, waitingRoomService } = useGameRoomMachine({
7476
mainMachine,
@@ -157,6 +159,7 @@ function StreamWidget({
157159
testBarProgressGifTop={testBarProgressGifTop}
158160
progressGifSize={progressGifSize}
159161
winGifSize={winGifSize}
162+
numberMarginBottom={numberMarginBottom}
160163
/>
161164
)}
162165
{orientations.LEFT === orientation && (
@@ -174,6 +177,7 @@ function StreamWidget({
174177
outputTitleWidth={outputTitleWidth}
175178
imgStyle={{ width: imgSize, height: imgSize }}
176179
width={widthInfoPanelPercentage}
180+
numberMarginBottom={numberMarginBottom}
177181
/>
178182
<StreamEditorPanel
179183
orientation={orientation}
@@ -218,6 +222,7 @@ function StreamWidget({
218222
outputTitleWidth={outputTitleWidth}
219223
imgStyle={{ width: imgSize, height: imgSize }}
220224
width={widthInfoPanelPercentage}
225+
numberMarginBottom={numberMarginBottom}
221226
/>
222227
</div>
223228
)}

0 commit comments

Comments
 (0)