Skip to content

Commit a721d43

Browse files
committed
fixes
1 parent 95be2cd commit a721d43

File tree

7 files changed

+54
-18
lines changed

7 files changed

+54
-18
lines changed

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2560,6 +2560,7 @@ a:hover {
25602560

25612561
.cb-stream-editor-panel {
25622562
border: 4px solid #3C4168;
2563+
background-color: black;
25632564
}
25642565

25652566
.cb-stream-editor-left {
@@ -2587,10 +2588,14 @@ a:hover {
25872588
width: 100%;
25882589
border: 3px solid #3C4168;
25892590
border-radius: 25px;
2591+
background-color: black;
25902592
}
25912593

25922594
.cb-stream-full-output {
25932595
width: 100%;
2596+
border: 3px solid black;
2597+
border-radius: 25px;
2598+
background-color: black;
25942599
}
25952600

25962601
.cb-stream-task-description {
@@ -2600,9 +2605,24 @@ a:hover {
26002605

26012606
.cb-stream-widget {
26022607
font-family: 'ExternalPlaneBold';
2603-
background-color: #000000;
26042608
}
26052609

2610+
.cb-stream-left-bg {
2611+
background-image: url('../static/images/stream/left-bg.png');
2612+
background-color: rgba(0, 0, 0, 0.96);
2613+
}
2614+
2615+
.cb-stream-right-bg {
2616+
background-image: url('../static/images/stream/right-bg.png');
2617+
background-color: rgba(0, 0, 0, 0.96);
2618+
}
2619+
2620+
.cb-stream-full-bg {
2621+
background-image: url('../static/images/stream/full-bg.png');
2622+
background-color: rgba(0, 0, 0, 0.96);
2623+
}
2624+
2625+
26062626
.cb-stream-widget .view-line {
26072627
background-color: #000000;
26082628
}
@@ -2624,6 +2644,7 @@ a:hover {
26242644
}
26252645

26262646
.cb-stream-full-editor {
2647+
background-color: black;
26272648
border: 4px solid #3C4168;
26282649
}
26292650

@@ -2656,6 +2677,7 @@ a:hover {
26562677
width: 100%;
26572678
font-weight: 900;
26582679
background-image: url(../static/images/stream/header.svg);
2680+
background-color: black;
26592681

26602682
.winner & {
26612683
background-image: url(../static/images/stream/header-winner.svg);
@@ -2664,6 +2686,7 @@ a:hover {
26642686

26652687
.cb-stream-full-widget-header-title {
26662688
background-size: cover;
2689+
background-color: black;
26672690
width: 100%;
26682691
font-weight: 900;
26692692
background-image: url(../static/images/stream/header-mini.svg);

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

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ import {
1616
import editorThemes from '../../config/editorThemes';
1717
import TaskDescriptionMarkdown from '../game/TaskDescriptionMarkdown';
1818

19+
const getUrl = (id, isWinner) => (
20+
isWinner ? `/${id}-win.png` : `/${id}.png`
21+
);
22+
1923
const renderPlayerId = (id, verticalAlign) => (
2024
<span style={{ marginLeft: '-0.2em', verticalAlign }}>{id}</span>
2125
);
2226

23-
const renderImg = (id, imgStyle) => (
24-
id ? <img style={imgStyle} src={`/assets/images/clans/${id || 1}.png`} alt="И" /> : <></>
27+
const renderImg = (id, imgStyle, isWinner = false) => (
28+
id ? <img style={imgStyle} src={`/assets/images/clans/${getUrl(id || 1, isWinner)}`} alt="И" /> : <></>
2529
);
2630

2731
function StreamFullPanel({
@@ -33,8 +37,9 @@ function StreamFullPanel({
3337
descriptionFontSize,
3438
outputTitleFontSize,
3539
outputDataFontSize,
40+
outputTitleWidth,
3641
nameLineHeight,
37-
headerVerticalAlign,
42+
statusVerticalAlign,
3843
testBarMarginBottom,
3944
testBarFontSize,
4045
testBarHeight,
@@ -110,8 +115,8 @@ function StreamFullPanel({
110115
<div className="d-flexflex-column w-100 h-100 cb-stream-full-info">
111116
<div className="d-flex w-100 justify-content-between py-3 px-4" style={{ height: '25%', minHeight: '25%', maxHeight: '25%' }}>
112117
<div>
113-
<div className="cb-stream-tasks-stats cb-stream-full-task-stats cb-stream-widget-text italic">
114-
<span style={{ verticalAlign: headerVerticalAlign, fontSize: taskHeaderFontSize }}>
118+
<div className="cb-stream-tasks-stats cb-stream-full-task-stats cb-stream-widget-text">
119+
<span style={{ verticalAlign: statusVerticalAlign, fontSize: taskHeaderFontSize }}>
115120
{`${(game?.task?.id || 1) % 21}/21 ЗАДАЧ`}
116121
</span>
117122
</div>
@@ -121,7 +126,7 @@ function StreamFullPanel({
121126
</div>
122127
<div className="d-flex flex-column pb-4 pl-3" style={{ width: '35%', minWidth: '35%', maxWidth: '35%' }}>
123128
<div className="d-flex cb-stream-full-output mt-2 mb-1">
124-
<div className="d-flex flex-column cb-stream-output-title" style={{ width: '33%', fontSize: outputTitleFontSize }}>
129+
<div className="d-flex flex-column cb-stream-output-title" style={{ width: outputTitleWidth, fontSize: outputTitleFontSize }}>
125130
<span>Входные</span>
126131
<span>данные</span>
127132
</div>
@@ -130,7 +135,7 @@ function StreamFullPanel({
130135
</div>
131136
</div>
132137
<div className="d-flex cb-stream-full-output mt-2 mb-1">
133-
<div className="d-flex flex-column cb-stream-output-title" style={{ width: '33%', fontSize: outputTitleFontSize }}>
138+
<div className="d-flex flex-column cb-stream-output-title" style={{ width: outputTitleWidth, fontSize: outputTitleFontSize }}>
134139
<span>Ожидаемые</span>
135140
<span>данные</span>
136141
</div>
@@ -155,12 +160,12 @@ function StreamFullPanel({
155160
className={
156161
cn(
157162
'd-flex position-relative align-items-center justify-content-center',
158-
'cb-stream-player-number cb-stream-widget-text italic',
163+
'cb-stream-player-number cb-stream-widget-text',
159164
)
160165
}
161166
style={imgStyle}
162167
>
163-
{renderPlayerId(leftEditor?.playerId, headerVerticalAlign)}
168+
{renderPlayerId(leftEditor?.playerId, statusVerticalAlign)}
164169
</div>
165170
<div className="cb-stream-player-clan h-100 position-relative mr-3">
166171
{/* {player?.clanId && ( */}
@@ -171,7 +176,7 @@ function StreamFullPanel({
171176
className={cn(
172177
'd-flex flex-column cb-stream-name cb-stream-widget-text',
173178
)}
174-
style={{ verticalAlign: headerVerticalAlign }}
179+
style={{ verticalAlign: statusVerticalAlign }}
175180
>
176181
{(leftPlayer?.name || 'Фамилия Имя').split(' ').map(str => (
177182
<div
@@ -228,12 +233,12 @@ function StreamFullPanel({
228233
className={
229234
cn(
230235
'd-flex position-relative align-items-center justify-content-center',
231-
'cb-stream-player-number cb-stream-widget-text italic',
236+
'cb-stream-player-number cb-stream-widget-text',
232237
)
233238
}
234239
style={imgStyle}
235240
>
236-
{renderPlayerId(rightEditor?.playerId, headerVerticalAlign)}
241+
{renderPlayerId(rightEditor?.playerId, statusVerticalAlign)}
237242
</div>
238243
<div className="cb-stream-player-clan h-100 position-relative mr-3">
239244
{/* {player?.clanId && ( */}
@@ -246,7 +251,7 @@ function StreamFullPanel({
246251
'd-flex flex-column cb-stream-name cb-stream-widget-text',
247252
)
248253
}
249-
style={{ verticalAlign: headerVerticalAlign }}
254+
style={{ verticalAlign: statusVerticalAlign }}
250255
>
251256
{(rightPlayer?.name || 'Фамилия Имя').split(' ').map(str => (
252257
<div

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function StreamTaskInfoPanel({
6464
<div
6565
className={
6666
cn(
67-
'cb-stream-tasks-stats cb-stream-widget-text italic',
67+
'cb-stream-tasks-stats cb-stream-widget-text',
6868
{ winner: isWinner },
6969
)
7070
}
@@ -78,7 +78,7 @@ function StreamTaskInfoPanel({
7878
<div className="d-flex flex-row align-items-center w-auto h-100 px-3">
7979
<div
8080
className={cn(
81-
'd-flex position-relative align-items-center justify-content-center cb-stream-player-number cb-stream-widget-text italic',
81+
'd-flex position-relative align-items-center justify-content-center cb-stream-player-number cb-stream-widget-text',
8282
{ winner: isWinner },
8383
)}
8484
style={imgStyle}

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,15 @@ function StreamWidget({
117117
const headerTitleClassName = orientation === orientations.NONE ? 'cb-stream-full-widget-header-title' : 'cb-stream-widget-header-title';
118118

119119
return (
120-
<div className="vh-100 overflow-hidden cb-stream-widget">
120+
<div className={cn(
121+
'vh-100 overflow-hidden cb-stream-widget',
122+
{
123+
'cb-stream-full-bg': orientation === orientations.NONE,
124+
'cb-stream-left-bg': orientation === orientations.LEFT,
125+
'cb-stream-right-bg': orientation === orientations.RIGHT,
126+
},
127+
)}
128+
>
121129
<div className={cn(
122130
'd-flex flex-column w-100 h-100',
123131
{ winner: isWinnerHeader },
@@ -140,7 +148,7 @@ function StreamWidget({
140148
outputTitleFontSize={outputTitleFontSize}
141149
outputDataFontSize={outputDataFontSize}
142150
outputTitleWidth={outputTitleWidth}
143-
headerVerticalAlign={statusVerticalAlign}
151+
statusVerticalAlign={statusVerticalAlign}
144152
codeFontSize={codeFontSize}
145153
testBarMarginBottom={testBarMarginBottom}
146154
testBarFontSize={testBarFontSize}
Loading
Loading
Loading

0 commit comments

Comments
 (0)