Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add End-of-round #11

Merged
merged 26 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
744904f
change docker publish
b4iterdev Nov 26, 2024
c9462d1
Merge branch 'ValoSpectra:main' into main
b4iterdev Dec 15, 2024
7266342
add endRound
b4iterdev Dec 15, 2024
9d24b2e
change endround display condition
b4iterdev Dec 15, 2024
3767dd0
Merge branch 'ValoSpectra:main' into main
b4iterdev Dec 17, 2024
ce1fe6e
Merge branch 'ValoSpectra:main' into add-endround2
b4iterdev Dec 17, 2024
8853336
fix linting
b4iterdev Dec 17, 2024
23bb25d
change teamWon logic and run lint-fix
b4iterdev Dec 18, 2024
a7ddb9a
change endround background to webp
b4iterdev Dec 18, 2024
59c47a0
change overflow : hidden and improve animations
b4iterdev Dec 18, 2024
f5d86eb
add Endround button on testing
b4iterdev Dec 18, 2024
b0647ca
Merge branch 'ValoSpectra:main' into add-endround2
b4iterdev Dec 18, 2024
0c6311e
actually disable scrollbar
b4iterdev Dec 21, 2024
839f0b4
move EndRound Phrase to changeRoundPhase()
b4iterdev Dec 24, 2024
a782ff2
change image preload to / and allow dynamic changes of image url
b4iterdev Dec 24, 2024
3e63a4e
add endround button logic
b4iterdev Jan 1, 2025
b773b5c
Merge branch 'ValoSpectra:main' into main
b4iterdev Jan 11, 2025
cf026b9
Merge branch 'main' into add-endround2
b4iterdev Jan 11, 2025
8619823
Revert docker publish target
b4iterdev Jan 11, 2025
e33683a
Merge branch 'ValoSpectra:main' into add-endround2
b4iterdev Jan 12, 2025
07e37b3
remove margin in intro-box
b4iterdev Jan 26, 2025
d493b6f
Merge branch 'ValoSpectra:main' into add-endround2
b4iterdev Jan 26, 2025
4f5a538
remove endround-bg and change default endround background image url
b4iterdev Jan 26, 2025
9e49344
A bit of cleanup
DarkView Jan 26, 2025
3cc9e62
Properly switch to end when testing was just loaded
DarkView Jan 26, 2025
c479322
More animation cleanup
DarkView Jan 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
ghcr.io/valospectra/overlay:${{ env.RELEASE_TAG }}




2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { InhouseTrackerPlayercardComponent } from "./combat/playercard/playercar
import { OverlayComponent } from "./overlay/overlay.component";
import { PlayerControllerComponent } from "./testing/player-controller/player-controller.component";
import { TeamControllerComponent } from "./testing/team-controller/team-controller.component";
import { EndroundComponent } from "./endround/endround.component";
import { ShieldIconComponent } from "./combat/playercard/shield-icon/shield-icon.component";
import { MapinfoComponent } from "./topscore/topinfo/mapinfo/mapinfo.component";
import { JsonPipe } from "@angular/common";
Expand All @@ -42,6 +43,7 @@ import { RedirectComponent } from "./redirect/redirect.component";
OverlayComponent,
PlayerControllerComponent,
TeamControllerComponent,
EndroundComponent,
ShieldIconComponent,
MapinfoComponent,
AgentSelectComponent,
Expand Down
26 changes: 26 additions & 0 deletions src/app/endround/endround.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<div *ngIf="match.roundPhase === 'end'">
<div class="intro-box">
<div class="intro-box-content" [style.background-image]="setTournamentBackgroundImage()">
<div class="intro-info-box">
<img class="intro-info-image" src="{{ tournamentUrl }}" />
<div class="intro-round-text">ROUND WIN</div>
</div>
</div>
</div>
<div class="endround">
<div class="endround-box" [style.background-image]="setTournamentBackgroundImage()">
<div class="win-side">
<div class="win-side-image-box">
<img class="win-side-image" src="{{ match.teams[teamWon].teamUrl }}" />
</div>
<div class="win-side-text">{{ match.attackersWon ? "ATTACKER" : "DEFENDER" }} WIN</div>
</div>
<div class="info-box">
<div class="info-image-box">
<img class="info-image" src="{{ tournamentUrl }}" />
</div>
<div class="round-number">ROUND {{ match.roundNumber }}</div>
</div>
</div>
</div>
</div>
205 changes: 205 additions & 0 deletions src/app/endround/endround.component.scss
b4iterdev marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
.intro-box {
position: absolute;
left: 26.23%;
top: 40.5%;
width: 875px;
height: 200px;
overflow: hidden;
animation-name: fly-down;
animation-duration: 4s;
animation-fill-mode: both;
}

.intro-box-content {
position: relative;
width: 875px;
height: 200px;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
animation-name: slide-in;
animation-duration: 1s;
animation-fill-mode: both;
transition-timing-function: ease-in-out;
}

.intro-info-box {
position: relative;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
overflow: hidden;
width: 50%;
height: 100%;
}

.intro-info-image {
position: relative;
max-height: 100%;
max-width: 100%;
}

.intro-round-text {
position: relative;
width: fit-content;
text-shadow: 0px 1.21px 4.83px rgba(0, 0, 0, 0.12);
font-family: "Unbounded", Helvetica;
font-weight: 700;
color: #ffffff;
font-size: 30px;
font-style: normal;
text-align: center;
line-height: normal;
}

.endround {
position: absolute;
left: 26%;
top: 100%;
width: 875px;
height: 200px;
overflow: hidden;
animation-name: slide-up;
animation-duration: 3.95s;
animation-fill-mode: both;
}

.endround-box {
position: relative;
width: 875px;
height: 200px;
background-repeat: no-repeat;
background-position: center;
background-size: cover;
display: flex;
flex-direction: row;
overflow: hidden;
flex-wrap: nowrap;
justify-content: center;
align-items: stretch;
}

.win-side {
position: relative;
flex-grow: 1;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
overflow: hidden;
width: 30%;
height: 100%;
}

.win-side-image-box {
display: flex;
height: 70%;
align-items: center;
justify-content: center;
scale: 0.9;
}

.win-side-image {
position: relative;
max-height: 100%;
max-width: 100%;
}

.win-side-text {
position: relative;
width: fit-content;
text-shadow: 0px 1.21px 4.83px rgba(0, 0, 0, 0.12);
font-family: "Montserrat", Helvetica;
font-weight: 700;
color: #ffffff;
font-size: 30px;
font-style: normal;
text-align: center;
line-height: normal;
}

.info-box {
position: relative;
flex-grow: 1;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
overflow: hidden;
width: 50%;
height: 100%;
}

.info-image-box {
display: flex;
height: 70%;
align-items: center;
justify-content: center;
scale: 0.9;
}

.info-image {
position: relative;
max-height: 100%;
max-width: 100%;
}

.round-number {
position: relative;
width: fit-content;
text-shadow: 0px 1.21px 4.83px rgba(0, 0, 0, 0.12);
font-family: "Montserrat", Helvetica;
font-weight: 700;
color: #ffffff;
font-size: 30px;
font-style: normal;
text-align: center;
line-height: normal;
}

@keyframes fly-down {
0% {
top: 40.5%;
}
90% {
top: 40.5%;
}
100% {
top: 150%;
}
}

@keyframes slide-up {
0% {
top: 100%;
}
25% {
top: 100%;
}
90% {
top: 100%;
}
100% {
top: 82%;
}
}

@keyframes slide-in {
0% {
left: -102%;
}
75% {
left: -102%;
}
100% {
left: 0%;
}
}
46 changes: 46 additions & 0 deletions src/app/endround/endround.component.ts
b4iterdev marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { Component, Input, OnChanges, SimpleChanges, OnInit } from "@angular/core";
@Component({
selector: "app-endround",
templateUrl: "./endround.component.html",
styleUrls: ["./endround.component.scss"],
})
export class EndroundComponent implements OnChanges, OnInit {
@Input() match!: any;
tournamentUrl = "../../assets/misc/logo.webp";

tournamentBackgroundUrl = "../../assets/misc/backdrop.webp";

teamWon = 0;
ngOnInit(): void {
this.tournamentUrl =
this.match?.tools?.tournamentInfo?.logoUrl && this.match.tools.tournamentInfo.logoUrl !== ""
? this.match.tools.tournamentInfo.logoUrl
: "../../assets/misc/logo.webp";

this.tournamentBackgroundUrl =
this.match?.tools?.tournamentInfo?.backdropUrl &&
this.match.tools.tournamentInfo.backdropUrl !== ""
? this.match.tools.tournamentInfo.backdropUrl
: "../../assets/misc/backdrop.webp";

this.preloadImage(this.tournamentUrl);
this.preloadImage(this.tournamentBackgroundUrl);
}
ngOnChanges(changes: SimpleChanges) {
b4iterdev marked this conversation as resolved.
Show resolved Hide resolved
if (changes["match"]) {
const match = changes["match"].currentValue;
if (match.attackersWon) {
this.teamWon = match.teams[0].isAttacking ? 0 : 1;
} else {
this.teamWon = match.teams[0].isAttacking ? 1 : 0;
}
}
}
private preloadImage(url: string): void {
const img = new Image();
img.src = url;
}
setTournamentBackgroundImage(): string {
return `url(${this.tournamentBackgroundUrl})`;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@ export class PlayerControllerComponent implements OnDestroy {

inCombat = true;
inShopping = false;
inEnd = false;
@Input()
set gamePhase(v: string) {
if (v == "combat") {
this.inCombat = true;
this.inShopping = false;
} else {
this.inEnd = false;
} else if (v == "shopping") {
this.inCombat = false;
this.inShopping = true;
this.inEnd = false;
} else {
this.inCombat = false;
this.inShopping = false;
this.inEnd = true;
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/testing/team-controller/team-controller.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ export class TeamControllerComponent {
@Input() teamName!: string;
@Input() teamCode!: string;

_roundPhase: "shopping" | "combat" = "combat";
_roundPhase: "shopping" | "combat" | "end" = "combat";
@Input()
set roundPhase(s: "shopping" | "combat") {
set roundPhase(s: "shopping" | "combat" | "end") {
this._roundPhase = s;
this.propagateRoundPhase(s);
}
Expand Down Expand Up @@ -136,7 +136,7 @@ export class TeamControllerComponent {
}
}

propagateRoundPhase(phase: "shopping" | "combat") {
propagateRoundPhase(phase: "shopping" | "combat" | "end") {
for (const playerController of this.playerControllers) {
playerController.instance.gamePhase = phase;
}
Expand Down
6 changes: 5 additions & 1 deletion src/app/testing/testing.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class TestingComponent implements AfterViewInit {

matchData: any;
isSpikePlanted = false;
roundPhase: "shopping" | "combat" = "combat";
roundPhase: "shopping" | "combat" | "end" = "combat";

showInterface = true;
showBackground = true;
Expand Down Expand Up @@ -122,6 +122,10 @@ export class TestingComponent implements AfterViewInit {
changeRoundPhase(): void {
if (this.matchData.roundPhase == "shopping") {
this.matchData.roundPhase = "combat";
} else if (this.matchData.roundPhase == "combat") {
this.matchData.roundPhase = "end";
} else if (this.matchData.roundPhase == "LOBBY") {
this.matchData.roundPhase = "end";
} else {
this.matchData.roundPhase = "shopping";
}
Expand Down
1 change: 1 addition & 0 deletions src/app/tracker/tracker.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<div *ngIf="shouldDisplay()">
<app-topinfo [match]="match" />
<app-topscore [match]="match" />
<app-endround *ngIf="match.roundPhase !== 'shopping'" [match]="match" [@fadeFast] />
<app-combat *ngIf="match.roundPhase !== 'shopping'" [match]="match" [@fade] />
<app-scoreboard *ngIf="match.roundPhase === 'shopping'" [match]="match" [@fade] />
</div>
2 changes: 1 addition & 1 deletion src/app/tracker/tracker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { AutoswitchComponent } from "../autoswitch/autoswitch.component";
animations: [
trigger("fade", [
transition(":enter", [style({ opacity: "0" }), animate("0.5s", style({ opacity: "1" }))]),

transition(":leave", animate("0.5s", style({ opacity: "0" }))),
]),
trigger("fadeFast", [transition(":leave", animate("0.25s ease-out", style({ opacity: "0" })))]),
],
})
export class TrackerComponent implements OnInit {
Expand Down
Loading