diff --git a/main_controller.py b/main_controller.py index ddcd3b6..c8a6d1e 100644 --- a/main_controller.py +++ b/main_controller.py @@ -44,6 +44,8 @@ def update_loop(): state["update_text"] = "Play blall!" #they also need a timestamp state["delay"] -= 1 + state["display_top_of_inning"] = state["top_of_inning"] + if state["delay"] <= 0: if this_game.top_of_inning != state["top_of_inning"]: state["update_pause"] = 2 @@ -51,6 +53,7 @@ def update_loop(): state["batter"] = "-" if not state["top_of_inning"]: state["display_inning"] -= 1 + state["display_top_of_inning"] = False if state["update_pause"] == 1: state["update_emoji"] = "🍿" @@ -90,7 +93,7 @@ def update_loop(): state["bases"] = this_game.named_bases() - state["top_of_inning"] = this_game.top_of_inning + state["top_of_inning"] = this_game.top_of_inning states_to_send[game_time] = state @@ -100,4 +103,4 @@ def update_loop(): state["update_pause"] -= 1 socketio.emit("states_update", states_to_send) - time.sleep(1) \ No newline at end of file + time.sleep(3) \ No newline at end of file diff --git a/sql scripts/batting average leaders.sql b/sql scripts/batting average leaders.sql new file mode 100644 index 0000000..e731e6d --- /dev/null +++ b/sql scripts/batting average leaders.sql @@ -0,0 +1,8 @@ +SELECT name, + plate_appearances - (walks_taken + sacrifices) as atbats, + ROUND(hits*1.0 / (plate_appearances - (walks_taken + sacrifices)*1.0),3) as average, + ROUND(total_bases*1.0 / (plate_appearances - (walks_taken + sacrifices)*1.0),3) as slg, + ROUND((walks_taken + hits)*1.0/plate_appearances*1.0,3) as obp, + ROUND((walks_taken + hits)*1.0/plate_appearances*1.0,3) + ROUND(total_bases*1.0 / (plate_appearances - (walks_taken + sacrifices)*1.0),3) as ops +FROM stats WHERE plate_appearances > 50 +ORDER BY ops DESC; \ No newline at end of file diff --git a/sql scripts/pitching leaders.sql b/sql scripts/pitching leaders.sql new file mode 100644 index 0000000..d4885fb --- /dev/null +++ b/sql scripts/pitching leaders.sql @@ -0,0 +1,9 @@ +SELECT name, + outs_pitched, + ROUND(runs_allowed*27.0/(outs_pitched*1.0),3) as era, + ROUND((walks_allowed+hits_allowed)*3.0/(outs_pitched*1.0),3) as whip, + ROUND(walks_allowed*27.0/(outs_pitched*1.0),3) as bbper9, + ROUND(strikeouts_given*27.0/(outs_pitched*1.0),3) as kper9, + ROUND(strikeouts_given*1.0/walks_allowed*1.0,3) as kperbb +FROM stats WHERE outs_pitched > 150 +ORDER BY bbper9 ASC; \ No newline at end of file diff --git a/static/discord.png b/static/discord.png new file mode 100644 index 0000000..49dde81 Binary files /dev/null and b/static/discord.png differ diff --git a/static/games_page.css b/static/games_page.css index 10fe41b..f37bc70 100644 --- a/static/games_page.css +++ b/static/games_page.css @@ -1,4 +1,5 @@ @import url('https://fonts.googleapis.com/css2?family=Alegreya&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Goldman:wght@700&display=swap'); body { background-image: url("prism.png"); } @@ -21,12 +22,23 @@ body { grid-row: 1; } +.link{ + position: relative; + top: 10px; +} + .h1 { margin: auto; width: 45%; + color: white; font-family: 'Alegreya', serif; } +.page_header { + color: white; + font-family: 'Goldman', cursive; +} + .emptyslot { border: 2px dashed white; border-radius: 15px; diff --git a/static/loader.js b/static/loader.js index ffd0035..da8fd50 100644 --- a/static/loader.js +++ b/static/loader.js @@ -54,7 +54,7 @@ $(document).ready(function (){ const updateGame = (gamediv, gamestate) => { gamediv.id = "updateTarget"; - $('#updateTarget .inning').html("Inning: " + (gamestate.top_of_inning ? "🔼" : "🔽") + " " + gamestate.display_inning + "/" + gamestate.max_innings); + $('#updateTarget .inning').html("Inning: " + (gamestate.display_top_of_inning ? "🔼" : "🔽") + " " + gamestate.display_inning + "/" + gamestate.max_innings); $('#updateTarget .weather').html(gamestate.weather_emoji + " " + gamestate.weather_text); $('#updateTarget .away_name').html(gamestate.away_name); diff --git a/templates/index.html b/templates/index.html index af42576..6adf449 100644 --- a/templates/index.html +++ b/templates/index.html @@ -11,8 +11,9 @@
-
-

game page ahoy

+
+ +
diff --git a/the-prestige.pyproj b/the-prestige.pyproj index 5f782b1..2b928ed 100644 --- a/the-prestige.pyproj +++ b/the-prestige.pyproj @@ -57,6 +57,7 @@ +