more css woop!!

This commit is contained in:
Liam 2022-10-11 14:22:01 +01:00
parent a75d6af882
commit 4af5f462ed
3 changed files with 24 additions and 9 deletions

@ -16,6 +16,7 @@ export default class Overlay extends Component {
this.state = { this.state = {
loading: true, loading: true,
isConnectedToSocket: false,
id: undefined, id: undefined,
isValidSteamId: true, isValidSteamId: true,
websiteType: "ScoreSaber", websiteType: "ScoreSaber",
@ -130,6 +131,7 @@ export default class Overlay extends Component {
} }
if (shouldConnectSocket) { if (shouldConnectSocket) {
if (this.state.isConnectedToSocket) return;
this.connectSocket(params.socketaddress); this.connectSocket(params.socketaddress);
} }
} }
@ -157,13 +159,17 @@ export default class Overlay extends Component {
*/ */
connectSocket(socketAddress) { connectSocket(socketAddress) {
socketAddress = (socketAddress === undefined ? 'ws://localhost' : `ws://${socketAddress}`) + ":6557/socket"; socketAddress = (socketAddress === undefined ? 'ws://localhost' : `ws://${socketAddress}`) + ":6557/socket";
if (this.state.isConnectedToSocket) return;
console.log(`Connecting to ${socketAddress}`); console.log(`Connecting to ${socketAddress}`);
const socket = new WebSocket(socketAddress); const socket = new WebSocket(socketAddress);
socket.addEventListener('open', () => { socket.addEventListener('open', () => {
console.log(`Connected to ${socketAddress}`); console.log(`Connected to ${socketAddress}`);
this.setState({ isConnectedToSocket: true });
}); });
socket.addEventListener('close', () => { socket.addEventListener('close', () => {
console.log("Attempting to re-connect to the HTTP Status socket in 10 seconds."); console.log("Attempting to re-connect to the HTTP Status socket in 10 seconds.");
this.setState({ isConnectedToSocket: false });
setTimeout(() => this.connectSocket(), 10_000); setTimeout(() => this.connectSocket(), 10_000);
}); });
socket.addEventListener('message', (message) => { socket.addEventListener('message', (message) => {
@ -196,7 +202,6 @@ export default class Overlay extends Component {
* @param {boolean} visible Whether to show info other than the player stats * @param {boolean} visible Whether to show info other than the player stats
*/ */
async resetData(visible) { async resetData(visible) {
console.log("Exiting level, resetting data.")
setTimeout(async () => { setTimeout(async () => {
await this.updateData(this.state.id); await this.updateData(this.state.id);
}, 250); }, 250);

@ -8,12 +8,17 @@
} }
.scoreStats p { .scoreStats p {
font-size: xx-large; font-size: 38px;
line-height: 1.2em; line-height: 1.2em;
} }
.scoreStatsLeft {
text-align: right;
}
.scoreStatsRight { .scoreStatsRight {
margin-right: 10px; margin-right: 10px;
text-align: right;
} }
.scoreStatsAverageCut { .scoreStatsAverageCut {
@ -27,7 +32,7 @@
} }
.scoreStatsHands p { .scoreStatsHands p {
min-width: 57px; min-width: 68px;
} }
.scoreStatsHands div { .scoreStatsHands div {

@ -5,7 +5,6 @@
left:0; left:0;
margin-left: 5px; margin-left: 5px;
margin-bottom: 5px; margin-bottom: 5px;
font-size: large !important;
} }
.songInfoContainer img { .songInfoContainer img {
@ -16,16 +15,17 @@
margin-left: 10px; margin-left: 10px;
} }
.songInfoSongName { .songInfoSongName {
font-size: 26px; font-size: 30px;
font-weight: bold; font-weight: bold;
} }
.songInfoSongAuthor { .songInfoSongAuthor {
font-size: large; font-size: 22px;
margin-top: -12px; margin-top: -12px;
margin-bottom: -7px; margin-bottom: -3px;
line-height: 1.2em;
} }
.songInfoSongOtherContainer { .songInfoSongOtherContainer {
@ -39,11 +39,16 @@
width: fit-content; width: fit-content;
border-radius: 5%; border-radius: 5%;
font-weight: bold; font-weight: bold;
margin-bottom: 12px;
line-height: 1.2em;
} }
.songInfoBsr { .songInfoBsr {
font-size: 22px; font-size: 22px;
margin-left: 10px; margin-left: 10px;
line-height: 1.2em;
} }
.songTimeContainer { .songTimeContainer {
@ -69,6 +74,6 @@
} }
.songTimeText { .songTimeText {
margin-top: 2px; margin-top: -10px;
font-size: 20px; font-size: 20px;
} }