1
0
mirror of https://github.com/lexogrine/cs2-react-hud.git synced 2025-12-10 02:42:49 +01:00

added SP support

This commit is contained in:
Hubert Walczak 2023-11-28 18:53:57 +01:00
parent 02bf217740
commit 656fce7e4f
No known key found for this signature in database
GPG Key ID: 17BB1C9355357860
3 changed files with 82 additions and 1 deletions

View File

@ -17,6 +17,7 @@ import Timeout from "../PauseTimeout/Timeout";
import { CSGO } from "csgogsi"; import { CSGO } from "csgogsi";
import { Match } from "../../API/types"; import { Match } from "../../API/types";
import { useAction } from "../../API/contexts/actions"; import { useAction } from "../../API/contexts/actions";
import { Scout } from "../Scout";
interface Props { interface Props {
game: CSGO, game: CSGO,
@ -73,7 +74,7 @@ const Layout = ({game,match}: Props) => {
<TeamBox team={right} players={rightPlayers} side="right" current={game.player} /> <TeamBox team={right} players={rightPlayers} side="right" current={game.player} />
<Trivia /> <Trivia />
<Scout left={left.side} right={right.side} />
<MapSeries teams={[left, right]} match={match} isFreezetime={isFreezetime} map={game.map} /> <MapSeries teams={[left, right]} match={match} isFreezetime={isFreezetime} map={game.map} />
<div className={"boxes left"}> <div className={"boxes left"}>
<UtilityLevel side={left.side} players={game.players} show={isFreezetime && !forceHide} /> <UtilityLevel side={left.side} players={game.players} show={isFreezetime && !forceHide} />

63
src/HUD/Scout/index.scss Normal file
View File

@ -0,0 +1,63 @@
#scout {
width: 512.5px;
background-color: var(--sub-panel-color);
padding: 10px;
position: fixed;
left: 50%;
transform: translateX(-50%);
color: white;
top: 126px;
opacity: 0;
transition: opacity 0.5s;
&.show {
opacity: 1;
}
.bar-container {
position: relative;
width: 100%;
height: 29px;
display: flex;
.bar {
position: relative;
width: 100%;
z-index: 0;
height: 100%;
.team-prediction {
position: absolute;
height: 100%;
width: 100%;
}
.left {
z-index: 0;
}
.right {
margin-left: auto;
width: 50%;
z-index: 2;
right: 0;
}
.team-CT {
background-color: var(--color-new-ct);
}
.team-T {
background-color: var(--color-new-t);
}
}
.overlay {
position: absolute;
width: 100%;
height: 100%;
display: flex;
justify-content: space-between;
z-index: 2;
align-items: center;
.team-prediction-value {
margin: 0 10px;
text-shadow: 1px 1px 0px black;
}
}
}
}

17
src/HUD/Scout/index.tsx Normal file
View File

@ -0,0 +1,17 @@
import { Side } from "csgogsi";
import "./index.scss";
export const Scout = ({ left, right }: { left: Side, right: Side }) => {
return <div id="scout">
<div className="bar-container">
<div className="overlay">
<div className={`team-prediction-value left ${left}`}>50%</div>
<div className={`team-prediction-value right ${right}`}>50%</div>
</div>
<div className="bar">
<div className={`team-prediction team-${left} left`} />
<div className={`team-prediction team-${right} right`} />
</div>
</div>
</div>
}