From cd406a3e74dc478a6afc49dba48ab8b0bf71d85f Mon Sep 17 00:00:00 2001 From: Liam <67254223+RealFascinated@users.noreply.github.com> Date: Mon, 10 Oct 2022 19:50:02 +0100 Subject: [PATCH] Fixed text color on preview --- pages/index.js | 2 +- pages/overlay.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/index.js b/pages/index.js index fbe75f7..58aa46f 100644 --- a/pages/index.js +++ b/pages/index.js @@ -65,7 +65,7 @@ export default class Home extends Component { values += `&${value[0]}=${value[1]}`; }); - return window.location.origin + "/overlay?id=" + this.state.steamId + values + (withTc ? "&tc=black" : ""); + return window.location.origin + "/overlay?id=" + this.state.steamId + values + (withTc ? "&textColor=black" : ""); } updateValue(key, value) { diff --git a/pages/overlay.js b/pages/overlay.js index 58176a8..3d4272c 100644 --- a/pages/overlay.js +++ b/pages/overlay.js @@ -23,7 +23,7 @@ export default class Overlay extends Component { showPlayerStats: true, showScore: false, showSongInfo: false, - backgroundColor: undefined, + textColor: undefined, socket: undefined, isVisible: false, @@ -124,8 +124,8 @@ export default class Overlay extends Component { } // Mainly used for the preview - if (params.withTc) { - this.setState({ backgroundColor: params.withTc }); + if (params.textColor) { + this.setState({ textColor: params.textColor }); } if (shouldConnectSocket) { @@ -316,9 +316,9 @@ export default class Overlay extends Component { body.style.backgroundColor = "#181a1b"; } - if (this.state.backgroundColor !== undefined) { - const body = document.body; - body.style.color = "#" + this.state.backgroundColor; + if (this.state.textColor !== undefined) { + const element = document.querySelector("." + styles.main); + element.style.color = this.state.textColor } return