diff --git a/README.md b/README.md
index cbd6e81..73fc8f3 100644
--- a/README.md
+++ b/README.md
@@ -4,24 +4,27 @@ Spectra is your all-in-one solution for an amazing looking Valorant Tournament O
To learn more and see a live demo, visit [valospectra.com](https://www.valospectra.com/).
It is comprised of three parts:
- - [The Spectra Client](https://github.com/ValoSpectra/Spectra-Client)
- - Running this software on a single in-game observer provides the Spectra Server with all data currently provided by Overwolf.
- - [The Spectra Server](https://github.com/ValoSpectra/Spectra-Server)
- - Ingests data from the Observer Client to reproduce the games state, allowing us to have an accurate representation of the game for further use.
- - [The Spectra Frontend](https://github.com/ValoSpectra/Spectra-Frontend)
- - Receives the game state from the Server every 100 milliseconds, presenting it in a beautiful manner for viewers to enjoy.
+
+- [The Spectra Client](https://github.com/ValoSpectra/Spectra-Client)
+ - Running this software on a single in-game observer provides the Spectra Server with all data currently provided by Overwolf.
+- [The Spectra Server](https://github.com/ValoSpectra/Spectra-Server)
+ - Ingests data from the Observer Client to reproduce the games state, allowing us to have an accurate representation of the game for further use.
+- [The Spectra Frontend](https://github.com/ValoSpectra/Spectra-Frontend)
+ - Receives the game state from the Server every 100 milliseconds, presenting it in a beautiful manner for viewers to enjoy.
Further updates for new features, as well as a detailed setup guide and an easy to host docker container are in the pipeline!
# Docker Compose tutorial:
-First, create a seperate folder in your working directory and create a folder ``` config``` inside it:
+First, create a seperate folder in your working directory and create a folder ` config` inside it:
+
```
mkdir -p spectra-frontend/config
cd spectra-frontend
```
-Create a file named ```docker-compose.yml``` as follow:
+Create a file named `docker-compose.yml` as follow:
+
```
---
services:
@@ -32,17 +35,30 @@ services:
volumes:
- ./config:/usr/share/nginx/html/assets/config/
```
-You can change ```3000``` to a different port which you want the frontend accessible outside the container to.
-Inside ``` config``` folder, create a file named ```config.json``` with the following content:
+You can change `3000` to a different port which you want the frontend accessible outside the container to.
+
+Inside `config` folder, create a file named `config.json` with the following content:
+
```
{
- "serverEndpoint": "https://localhost:5200"
+ "serverEndpoint": "http://localhost:5200",
+ "sponsorImageUrls": ["/assets/misc/logo.webp"],
+ "sponsorImageRotateSpeed": 5000,
+ "attackerColorPrimary": "#932530",
+ "attackerColorSecondary": "#a30010",
+ "attackerColorShieldCurrency": "#ff838f",
+ "defenderColorPrimary": "#1e8a61",
+ "defenderColorSecondary": "#138c69",
+ "defenderColorShieldCurrency": "#61eab6"
}
```
-Replace ``` https://localhost:5200``` with your Spectra Server address and outcoming port (default is 5200).
-After that you can start the frontend by running ```docker compose up -d``` and the frontend are accessible at port ```3000``` by default.
+For the most up to date version of the available configuration values, check out the `config.ts` file in the `src/app/shared/config.ts` file.
+
+Replace `https://localhost:5200` with your Spectra Server address and outcoming port (default is 5200).
+
+After that you can start the frontend by running `docker compose up -d` and the frontend are accessible at port `3000` by default.
# DISCLAIMER
diff --git a/public/assets/config/config.json b/public/assets/config/config.json
index e8ae04b..9898def 100644
--- a/public/assets/config/config.json
+++ b/public/assets/config/config.json
@@ -1,3 +1,11 @@
{
- "serverEndpoint": "http://localhost:5200"
+ "serverEndpoint": "http://localhost:5200",
+ "sponsorImageUrls": ["/assets/misc/logo.webp"],
+ "sponsorImageRotateSpeed": 5000,
+ "attackerColorPrimary": "#b82e3c",
+ "attackerColorSecondary": "#ff4557",
+ "attackerColorShieldCurrency": "#ff838f",
+ "defenderColorPrimary": "#25ac79",
+ "defenderColorSecondary": "#61eab6",
+ "defenderColorShieldCurrency": "#61eab6"
}
diff --git a/public/assets/shields/HeavyGreen.svg b/public/assets/shields/HeavyGreen.svg
deleted file mode 100644
index 7968ea4..0000000
--- a/public/assets/shields/HeavyGreen.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/public/assets/shields/HeavyRed.svg b/public/assets/shields/HeavyRed.svg
deleted file mode 100644
index 99d573c..0000000
--- a/public/assets/shields/HeavyRed.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/public/assets/shields/LightGreen.svg b/public/assets/shields/LightGreen.svg
deleted file mode 100644
index 3cc8763..0000000
--- a/public/assets/shields/LightGreen.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/public/assets/shields/LightRed.svg b/public/assets/shields/LightRed.svg
deleted file mode 100644
index c1c360b..0000000
--- a/public/assets/shields/LightRed.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/public/assets/shields/NoneGreen.svg b/public/assets/shields/NoneGreen.svg
deleted file mode 100644
index ee41798..0000000
--- a/public/assets/shields/NoneGreen.svg
+++ /dev/null
@@ -1,2 +0,0 @@
-
\ No newline at end of file
diff --git a/public/assets/shields/NoneRed.svg b/public/assets/shields/NoneRed.svg
deleted file mode 100644
index ee41798..0000000
--- a/public/assets/shields/NoneRed.svg
+++ /dev/null
@@ -1,2 +0,0 @@
-
\ No newline at end of file
diff --git a/public/assets/shields/RegenGreen.svg b/public/assets/shields/RegenGreen.svg
deleted file mode 100644
index b4f552b..0000000
--- a/public/assets/shields/RegenGreen.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/public/assets/shields/RegenRed.svg b/public/assets/shields/RegenRed.svg
deleted file mode 100644
index 5467d78..0000000
--- a/public/assets/shields/RegenRed.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
\ No newline at end of file
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 3b24e6a..de4fc3a 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -1,10 +1,74 @@
-import { Component } from "@angular/core";
+import { Component, OnInit } from "@angular/core";
+import { Config } from "./shared/config";
@Component({
selector: "app-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.scss"],
})
-export class AppComponent {
+export class AppComponent implements OnInit {
title = "SpectraFrontend";
+
+ constructor(private config: Config) {}
+
+ ngOnInit(): void {
+ document.documentElement.style.setProperty(
+ "--defender-color",
+ this.config.defenderColorPrimary,
+ );
+ document.documentElement.style.setProperty(
+ "--defender-color-rgb",
+ this.hexToRgb(this.config.defenderColorPrimary).join(", "),
+ );
+ document.documentElement.style.setProperty(
+ "--attacker-color",
+ this.config.attackerColorPrimary,
+ );
+ document.documentElement.style.setProperty(
+ "--attacker-color-rgb",
+ this.hexToRgb(this.config.attackerColorPrimary).join(", "),
+ );
+ document.documentElement.style.setProperty(
+ "--defender-color-secondary",
+ this.config.defenderColorSecondary,
+ );
+ document.documentElement.style.setProperty(
+ "--defender-color-secondary-rgb",
+ this.hexToRgb(this.config.defenderColorSecondary).join(", "),
+ );
+ document.documentElement.style.setProperty(
+ "--attacker-color-secondary",
+ this.config.attackerColorSecondary,
+ );
+ document.documentElement.style.setProperty(
+ "--attacker-color-secondary-rgb",
+ this.hexToRgb(this.config.attackerColorSecondary).join(", "),
+ );
+ document.documentElement.style.setProperty(
+ "--defender-color-shield-currency",
+ this.config.defenderColorShieldCurrency,
+ );
+ document.documentElement.style.setProperty(
+ "--defender-color-shield-currency-rgb",
+ this.hexToRgb(this.config.defenderColorShieldCurrency).join(", "),
+ );
+ document.documentElement.style.setProperty(
+ "--attacker-color-shield-currency",
+ this.config.attackerColorShieldCurrency,
+ );
+ document.documentElement.style.setProperty(
+ "--attacker-color-shield-currency-rgb",
+ this.hexToRgb(this.config.attackerColorShieldCurrency).join(", "),
+ );
+ }
+
+ hexToRgb(hex: string): number[] {
+ hex = hex.replace(/^#/, "");
+
+ const r = parseInt(hex.substring(0, 2), 16);
+ const g = parseInt(hex.substring(2, 4), 16);
+ const b = parseInt(hex.substring(4, 6), 16);
+
+ return [r, g, b];
+ }
}
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 085449a..aa3d1b5 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -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 { ShieldIconComponent } from "./combat/playercard/shield-icon/shield-icon.component";
@NgModule({
declarations: [
@@ -34,6 +35,7 @@ import { TeamControllerComponent } from "./testing/team-controller/team-controll
OverlayComponent,
PlayerControllerComponent,
TeamControllerComponent,
+ ShieldIconComponent,
],
exports: [],
bootstrap: [AppComponent],
diff --git a/src/app/combat/combat.component.html b/src/app/combat/combat.component.html
index c092747..9b08889 100644
--- a/src/app/combat/combat.component.html
+++ b/src/app/combat/combat.component.html
@@ -4,7 +4,7 @@
*ngFor="let player of match.teams[0].players; trackBy: trackByPlayerId"
[match]="match"
[player]="player"
- [color]="match.teams[0].isAttacking ? 'red' : 'green'"
+ [color]="match.teams[0].isAttacking ? 'attacker' : 'defender'"
side="left"
/>
@@ -13,7 +13,7 @@
*ngFor="let player of match.teams[1].players; trackBy: trackByPlayerId"
[match]="match"
[player]="player"
- [color]="match.teams[1].isAttacking ? 'red' : 'green'"
+ [color]="match.teams[1].isAttacking ? 'attacker' : 'defender'"
side="right"
/>
diff --git a/src/app/combat/playercard/playercard.component.html b/src/app/combat/playercard/playercard.component.html
index 17115ea..5a8d96b 100644
--- a/src/app/combat/playercard/playercard.component.html
+++ b/src/app/combat/playercard/playercard.component.html
@@ -25,15 +25,22 @@