Skip to content

Commit

Permalink
Release for FSP
Browse files Browse the repository at this point in the history
  • Loading branch information
irdkwmnsb committed Dec 9, 2023
1 parent fb7ca38 commit 3d32f4f
Show file tree
Hide file tree
Showing 16 changed files with 165 additions and 19 deletions.
110 changes: 110 additions & 0 deletions config/fsp/advanced.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"freezeTimeSeconds": 14400,
"teamOverrideTemplate": {
"medias": {
"screen": {
"type": "WebRTCGrabberConnection",
"peerName": "{comp}",
"url": "https://grabber.kbats.ru",
"streamType": "desktop",
"credential": "federationchempionatlive"
},
"camera": {
"type": "WebRTCGrabberConnection",
"url": "https://grabber.kbats.ru",
"peerName": "{comp}",
"streamType": "webcam",
"credential": "federationchempionatlive"
},
"achievement": {
"type": "Photo",
"url": "/media/ach/fsp02.svg"
}
}
},
"teamIdRegexes": {
"customFields": {
"comp": "g27417=fsp(.*)"
}
},
"teamOverrides": {
"g27417=fsp01": {
"displayName": "Москва - 1"
},
"g27417=fsp02": {
"displayName": "Санкт-Петербург - 1"
},
"g27417=fsp03": {
"displayName": "Республика Татарстан"
},
"g27417=fsp04": {
"displayName": "Московская область"
},
"g27417=fsp05": {
"displayName": "Республика Карелия"
},
"g27417=fsp06": {
"displayName": "Свердловская область"
},
"g27417=fsp07": {
"displayName": "Ростовская область"
},
"g27417=fsp08": {
"displayName": "Иркутская область"
},
"g27417=fsp09": {
"displayName": "Республика Саха (Якутия)"
},
"g27417=fsp10": {
"displayName": "Чеченская Республика"
},
"g27417=fsp11": {
"displayName": "Санкт-Петербург - 2"
},
"g27417=fsp12": {
"displayName": "Москва - 2"
},
"g27417=fsp13": {
"displayName": "Москва - 3"
},
"g27417=fsp14": {
"displayName": "Пермский край"
},
"g27417=fsp15": {
"displayName": "Саратовская область"
},
"g27417=fsp16": {
"displayName": "Донецкая народная республика"
},
"g27417=fsp17": {
"displayName": "Резерв 1"
},
"g27417=fsp18": {
"displayName": "Резерв 2"
},
"g27417=fsp19": {
"displayName": "Резерв 3"
},
"g27417=fsp20": {
"displayName": "Резерв 4"
}
},
"problemOverrides": {
"0":{"color":"#e6194B"},
"1":{"color":"#3cb44b"},
"2":{"color":"#ffe119"},
"3":{"color":"#4363d8"},
"4":{"color":"#f58231"},
"5":{"color":"#42d4f4"},
"6":{"color":"#f032e6"},
"7":{"color":"#fabed4"},
"8":{"color":"#469990"},
"9":{"color":"#dcbeff"},
"10":{"color":"#9A6324"},
"11":{"color":"#fffac8"},
"12":{"color":"#800000"},
"13":{"color":"#aaffc3"},
"14":{"color":"#000075"},
"15":{"color":"#a9a9a9"}
}
}
6 changes: 6 additions & 0 deletions config/fsp/settings copy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "cf",
"apiKey": "$creds.codeforces_key",
"apiSecret": "$creds.codeforces_secret",
"contestId": 491142
}
6 changes: 6 additions & 0 deletions config/fsp/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "cf",
"apiKey": "$creds.codeforces_key",
"apiSecret": "$creds.codeforces_secret",
"contestId": 491392
}
9 changes: 9 additions & 0 deletions config/fsp/widget-positions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"queue": {
"positionX": 1520,
"positionY": 16,
"sizeX": 384,
"sizeY": 1048
}
}

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ kotlin.code.style=official

build_version=dev
#change this to `false` to use system installed npm
npm.download=true
npm.download=false
org.gradle.parallel=true
org.gradle.caching=true
live.dev.embedFrontend=true
Expand Down
Binary file not shown.
Binary file not shown.
14 changes: 14 additions & 0 deletions src/frontend/overlay/src/assets/fonts/fonts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,17 @@
src: local('Urbanist'), url(./Urbanist-Italic-VariableFont_wght.ttf) format('truetype');
}

@font-face {
font-family: 'JetBrains Mono';
font-style: normal;
src: local('JetBrainsMono'), url('./JetBrainsMono[wght].ttf') format("truetype-variations");
font-weight: 1 999;
}

@font-face {
font-family: 'JetBrains Mono';
font-style: italic;
src: local('JetBrainsMono'), url('./JetBrainsMono-Italic[wght].ttf') format("truetype-variations");
font-weight: 1 999;
}

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/frontend/overlay/src/components/atoms/ShrinkingBox.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import styled from "styled-components";
import c from "../../config";
import React, {memo, useCallback, useEffect, useRef} from "react";
import React, { memo, useCallback, useEffect, useRef } from "react";

const TextShrinkingWrap = styled.div`
display: flex;
overflow: hidden;
justify-content: ${props => props.align};
font-kerning: none; // Remove after https://bugs.chromium.org/p/chromium/issues/detail?id=1192834 is fixed.
font-family: Arial, sans-serif;
font-family: ${c.GLOBAL_DEFAULT_FONT}, sans-serif;
`;

const storage = window.localStorage;
Expand All @@ -22,7 +22,7 @@ export const getTextWidth = (text, font) => {
let canvas = getTextWidth.canvas || (getTextWidth.canvas = document.createElement("canvas"));
const context = canvas.getContext("2d");
context.font = font;
context.fontKerning = 'none'; // Remove after https://bugs.chromium.org/p/chromium/issues/detail?id=1192834 is fixed.
context.fontKerning = "none"; // Remove after https://bugs.chromium.org/p/chromium/issues/detail?id=1192834 is fixed.
const metrics = context.measureText(stringText);
const result = metrics.width;
storage.setItem(key, result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export const AchievementWrapper = styled.div`

export const Achievement = ({ src, onLoadStatus, className }) => {
return <AchievementWrapper className={className}>
<TeamImageWrapper src={src} onLoad={() => onLoadStatus(true)}/>
<object data={src} type="image/svg+xml" onLoad={() => onLoadStatus(true)}></object>
</AchievementWrapper>;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ const ScoreboardContent = styled.div`


export const nameTable = {
normal: "Current",
optimistic: "Optimistic",
pessimistic: "Pessimistic",
normal: "Текущее",
optimistic: "Оптимистичное",
pessimistic: "Пессимистичное",
};

const ScoreboardTableRowWrap = styled.div`
Expand Down Expand Up @@ -232,9 +232,9 @@ const ScoreboardTableHeader = () => {
const needPenalty = useNeedPenalty();
return <ScoreboardTableHeaderWrap nProblems={problems?.length ?? 1} needPenalty={needPenalty}>
<ScoreboardTableHeaderCell>#</ScoreboardTableHeaderCell>
<ScoreboardTableHeaderNameCell>Name</ScoreboardTableHeaderNameCell>
<ScoreboardTableHeaderNameCell>Название</ScoreboardTableHeaderNameCell>
<ScoreboardTableHeaderCell>Σ</ScoreboardTableHeaderCell>
{needPenalty && <ScoreboardTableHeaderCell>Penalty</ScoreboardTableHeaderCell>}
{needPenalty && <ScoreboardTableHeaderCell>Штраф</ScoreboardTableHeaderCell>}
{problems && problems.map((probData) => <ScoreboardProblemLabel key={probData.name} letter={probData.letter}
problemColor={probData.color}/>
)}
Expand All @@ -248,7 +248,7 @@ export const Scoreboard = ({ widgetData: { settings } }) => {
return <ScoreboardWrap>
<ScoreboardHeader>
<ScoreboardTitle>
{nameTable[settings.optimismLevel] ?? "??"} standings
{nameTable[settings.optimismLevel] ?? "??"} положение
</ScoreboardTitle>
<ScoreboardCaption>
{c.SCOREBOARD_CAPTION}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const slideOut = keyframes`
const TeamViewContainer = styled.div`
width: 100%;
height: 100%;
display: ${props => props.show ? "flex" : "none"};
opacity: ${props => props.show ? "100%" : "0%"};
flex-direction: column;
justify-content: start;
align-items: flex-end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import styled, { keyframes } from "styled-components";
import c from "../../../config";
import { pushLog } from "../../../redux/debug";
import { startScrolling, stopScrolling } from "../../../redux/ticker";
import live from "../../../assets/icons/live.svg";
import live from "../../../assets/icons/fsr_star.png";
import Clock from "../tickers/Clock";
import Scoreboard from "../tickers/Scoreboard";
import Text from "../tickers/Text";
Expand Down
10 changes: 5 additions & 5 deletions src/frontend/overlay/src/config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const config = new Proxy(config_, {
}
});

config.CONTEST_COLOR = "#4C83C3";
config.CONTEST_COLOR = "#6F1DFB";
config.CONTEST_CAPTION = "";

config.BASE_URL_WS = (import.meta.env.VITE_WEBSOCKET_URL ?? WS_PROTO + window.location.hostname + ":" + WS_PORT + "/api/overlay");
Expand All @@ -28,10 +28,10 @@ config.BASE_URL_WS = (import.meta.env.VITE_WEBSOCKET_URL ?? WS_PROTO + window.lo
config.WEBSOCKET_RECONNECT_TIME = 5000; // ms

// Strings
config.QUEUE_TITLE = "Queue";
config.QUEUE_TITLE = "Очередь";
config.QUEUE_CAPTION = config.CONTEST_CAPTION;
config.SCOREBOARD_CAPTION = config.CONTEST_CAPTION;
config.STATISTICS_TITLE = "Statistics";
config.STATISTICS_TITLE = "Статистика";
config.STATISTICS_CAPTION = config.CONTEST_CAPTION;

// Behaviour
Expand All @@ -58,7 +58,7 @@ config.STATISTICS_CELL_MORPH_TIME = 200; //ms
config.CELL_FLASH_PERIOD = 500; //ms

// Styles > Global
config.GLOBAL_DEFAULT_FONT_FAMILY = "Helvetica, serif"; // css-property
config.GLOBAL_DEFAULT_FONT_FAMILY = "JetBrains Mono, serif"; // css-property
config.GLOBAL_DEFAULT_FONT_SIZE = "22px"; // css-property
config.GLOBAL_DEFAULT_FONT_WEIGHT = 400; // css-property
config.GLOBAL_DEFAULT_FONT_WEIGHT_BOLD = 700; // css-property
Expand Down Expand Up @@ -99,7 +99,7 @@ config.SCOREBOARD_CELL_PENALTY_ALIGN = "center";

config.QUEUE_ROW_FONT_SIZE = config.GLOBAL_DEFAULT_FONT_SIZE;
config.QUEUE_ROW_BACKGROUND = "rgba(0, 0, 0, 0.08)";
config.QUEUE_ROW_HEIGHT = 32; // px
config.QUEUE_ROW_HEIGHT = 44; // px
config.QUEUE_ROW_PADDING = 1; // px
config.QUEUE_ROW_FEATURED_RUN_PADDING = 3; // px
config.QUEUE_OPACITY = 0.95;
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/overlay/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Provider } from "react-redux";
import { PersistGate } from "redux-persist/integration/react";
import { createGlobalStyle } from "styled-components";
import App from "./App";
import c from "./config";
import "./assets/fonts/fonts.scss";

import { persistor, store } from "./redux/store";
Expand All @@ -17,7 +18,7 @@ export const GlobalStyle = createGlobalStyle`
//height: 100vh;
//width: 100vw;
font-family: Helvetica, sans-serif;
font-family: ${c.GLOBAL_DEFAULT_FONT_FAMILY};
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand Down

0 comments on commit 3d32f4f

Please sign in to comment.