From 468a03e6461d5b17d74397afe2d90592ce72396a Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Mon, 19 Feb 2024 16:20:21 -0500 Subject: [PATCH 1/3] fix: live game state and time spacing and size --- app/static/styles.css | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/static/styles.css b/app/static/styles.css index 06e4327..f782ef0 100644 --- a/app/static/styles.css +++ b/app/static/styles.css @@ -134,6 +134,7 @@ h1 { color: #fff; /* White text color for live state */ font-weight: bolder; /* Bold text for live state */ z-index: 1; /* Ensure the live state box is above other content */ + width: 18px; } .live-state-intermission { @@ -147,6 +148,7 @@ h1 { color: #fff; /* White text color for live state */ font-weight: bolder; /* Bold text for live state */ z-index: 1; /* Ensure the live state box is above other content */ + width: 40px; } .live-time { @@ -159,18 +161,26 @@ h1 { font-size: 12px; color: #ddd; /* Lighter text color for time box */ z-index: 1; /* Ensure the time box is above other content */ + width: 30px; + display: flex; /* Use flexbox */ + justify-content: space-evenly; /* Center content horizontally */ + align-items: center; /* Center content vertically */ } .live-time-intermission { position: absolute; top: 10px; - left: 60px; /* Adjusted left position */ + left: 65px; /* Adjusted left position */ background-color: #444; /* Darker background color for time box */ padding: 5px; border-radius: 5px; font-size: 12px; color: #ddd; /* Lighter text color for time box */ z-index: 1; /* Ensure the time box is above other content */ + width: 30px; + display: flex; /* Use flexbox */ + justify-content: space-evenly; /* Center content horizontally */ + align-items: center; /* Center content vertically */ } #live-games-section { From 9fe94057ff6c6ee9fdb5f9e71e339faba2d832a0 Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Mon, 19 Feb 2024 16:23:34 -0500 Subject: [PATCH 2/3] fix: shootout is period 5 and gets top priority --- app/scoreboard/process_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scoreboard/process_data.py b/app/scoreboard/process_data.py index 0d3dd0a..2c8dedd 100644 --- a/app/scoreboard/process_data.py +++ b/app/scoreboard/process_data.py @@ -99,7 +99,7 @@ def calculate_game_priority(game): score_total = (home_score + away_score) * 20 # Calculate the base priority based on period - base_priority = {4: 400, 3: 300, 2: 200}.get(period, 100) + base_priority = {5: 450, 4: 400, 3: 300, 2: 200}.get(period, 100) # Adjust base priority based on score difference if score_difference > 3: From f17e221ad33e810a67dad1b26d67fa8c2e9f29b6 Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Mon, 19 Feb 2024 16:31:15 -0500 Subject: [PATCH 3/3] fix: game priority update --- app/scoreboard/process_data.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/scoreboard/process_data.py b/app/scoreboard/process_data.py index 2c8dedd..b55ba6d 100644 --- a/app/scoreboard/process_data.py +++ b/app/scoreboard/process_data.py @@ -96,7 +96,7 @@ def calculate_game_priority(game): home_score = game["homeTeam"]["score"] away_score = game["awayTeam"]["score"] score_difference = abs(home_score - away_score) - score_total = (home_score + away_score) * 20 + score_total = (home_score + away_score) * 25 # Calculate the base priority based on period base_priority = {5: 450, 4: 400, 3: 300, 2: 200}.get(period, 100) @@ -114,7 +114,9 @@ def calculate_game_priority(game): base_priority += 100 # Calculate time priority - time_priority = (1200 - time_remaining) / 20 + time_multiplier = {4: 2, 3: 2, 2: 1.5}.get(period, 0.75) + + time_priority = ((1200 - time_remaining) / 20) * time_multiplier # Calculate the final priority final_priority = int(base_priority + time_priority - matchup_adjustment + score_total)