diff --git a/audience_display.go b/audience_display.go index 6b7af1a..c354c14 100644 --- a/audience_display.go +++ b/audience_display.go @@ -94,10 +94,13 @@ func AudienceDisplayWebsocketHandler(w http.ResponseWriter, r *http.Request) { return } data = struct { - RedScore int - BlueScore int - }{mainArena.redRealtimeScore.Score(mainArena.blueRealtimeScore.CurrentScore.Fouls), - mainArena.blueRealtimeScore.Score(mainArena.redRealtimeScore.CurrentScore.Fouls)} + RedScore *Score + BlueScore *Score + RedScoreSummary *ScoreSummary + BlueScoreSummary *ScoreSummary + }{&mainArena.redRealtimeScore.CurrentScore, &mainArena.blueRealtimeScore.CurrentScore, + mainArena.redRealtimeScore.ScoreSummary(mainArena.blueRealtimeScore.CurrentScore.Fouls), + mainArena.blueRealtimeScore.ScoreSummary(mainArena.redRealtimeScore.CurrentScore.Fouls)} err = websocket.Write("realtimeScore", data) if err != nil { log.Printf("Websocket error: %s", err) @@ -154,10 +157,13 @@ func AudienceDisplayWebsocketHandler(w http.ResponseWriter, r *http.Request) { } messageType = "realtimeScore" message = struct { - RedScore int - BlueScore int - }{mainArena.redRealtimeScore.Score(mainArena.blueRealtimeScore.CurrentScore.Fouls), - mainArena.blueRealtimeScore.Score(mainArena.redRealtimeScore.CurrentScore.Fouls)} + RedScore *Score + BlueScore *Score + RedScoreSummary *ScoreSummary + BlueScoreSummary *ScoreSummary + }{&mainArena.redRealtimeScore.CurrentScore, &mainArena.blueRealtimeScore.CurrentScore, + mainArena.redRealtimeScore.ScoreSummary(mainArena.blueRealtimeScore.CurrentScore.Fouls), + mainArena.blueRealtimeScore.ScoreSummary(mainArena.redRealtimeScore.CurrentScore.Fouls)} case _, ok := <-scorePostedListener: if !ok { return diff --git a/static/audio/match_endgame.wav b/static/audio/match_endgame.wav index 7abd06d..73124d7 100644 Binary files a/static/audio/match_endgame.wav and b/static/audio/match_endgame.wav differ diff --git a/static/css/audience_display.css b/static/css/audience_display.css index cba3255..07efffd 100644 --- a/static/css/audience_display.css +++ b/static/css/audience_display.css @@ -38,13 +38,13 @@ html { vertical-align: middle; } #redTeams { - float: right; - border-left: 1px solid #222; -} -#blueTeams { float: left; border-right: 1px solid #222; } +#blueTeams { + float: right; + border-left: 1px solid #222; +} .score { width: 0px; height: 100%; @@ -99,30 +99,14 @@ html { .score-fields { float: left; width: 20%; - padding-top: 10px; + height: 100%; + line-height: 29px; text-align: center; - opacity: 0; -} -.tower { - font-size: 20px; + display: table; + font-size: 23px; font-family: "FuturaLTBold"; color: #fff; -} -.defense { - font-size: 0; -} -.defense>progress { - width: 20px; - height: 6px; - margin: 2px 0; - -webkit-appearance: none; -} -.defense>progress::-webkit-progress-bar { - background-color: rgba(0, 0, 0, 0); - border: 1px solid white; -} -.defense>progress::-webkit-progress-value { - background-color: #fff; + opacity: 0; } #logo { position: relative; @@ -208,8 +192,8 @@ html { #finalScore { position: fixed; width: 800px; - height: 495px; - top: 0; + height: 550px; + top: 65px; bottom: 0; left: 0; right: 0; @@ -222,7 +206,7 @@ html { .final-score { float: left; width: 50%; - height: 44%; + height: 38%; line-height: 200px; border-bottom: 2px solid #333; color: #fff; @@ -243,7 +227,7 @@ html { .final-teams { float: left; width: 50%; - height: 11%; + height: 9%; line-height: 50px; text-align: center; color: #fff; @@ -262,7 +246,7 @@ html { .final-breakdown { float: left; width: 33%; - height: 34%; + height: 44%; padding: 0px 20px; display: table; text-align: center; @@ -286,7 +270,7 @@ html { #finalEventMatchInfo { clear: both; width: 100%; - height: 11%; + height: 9%; line-height: 50px; padding: 0px 25px; font-family: "FuturaLT"; @@ -409,3 +393,11 @@ html { font-family: "FuturaLTBold"; line-height: 87px; } +.score-icon { + position: relative; + top: -4px; + height: 23px; +} +.score-icon-right { + -webkit-transform: scaleX(-1); +} diff --git a/static/img/pressure.svg b/static/img/pressure.svg new file mode 100644 index 0000000..f9a1756 --- /dev/null +++ b/static/img/pressure.svg @@ -0,0 +1,85 @@ + + + diff --git a/static/img/rotor.svg b/static/img/rotor.svg new file mode 100644 index 0000000..2af8e86 --- /dev/null +++ b/static/img/rotor.svg @@ -0,0 +1,93 @@ + + + diff --git a/static/img/takeoff.svg b/static/img/takeoff.svg new file mode 100644 index 0000000..995cbe4 --- /dev/null +++ b/static/img/takeoff.svg @@ -0,0 +1,92 @@ + + + diff --git a/static/js/audience_display.js b/static/js/audience_display.js index f325ccf..1b486a9 100644 --- a/static/js/audience_display.js +++ b/static/js/audience_display.js @@ -52,14 +52,14 @@ var handleMatchTime = function(data) { // Handles a websocket message to update the match score. var handleRealtimeScore = function(data) { - $("#redScoreNumber").text(data.RedScoreFields.Score); - $("#redTower").text(data.RedScoreFields.TowerStrength); - $("#blueScoreNumber").text(data.BlueScoreFields.Score); - $("#blueTower").text(data.BlueScoreFields.TowerStrength); - for (var i = 0; i < 5; i++) { - $("#redDefense" + (i + 1)).attr("value", data.RedScoreFields.DefensesStrength[i]); - $("#blueDefense" + (i + 1)).attr("value", data.BlueScoreFields.DefensesStrength[i]); - } + $("#redScoreNumber").text(data.RedScoreSummary.Score); + $("#redPressurePoints").text(data.RedScoreSummary.PressurePoints); + $("#redRotors").text(data.RedScoreSummary.Rotors); + $("#redTakeoffs").text(data.RedScore.Takeoffs); + $("#blueScoreNumber").text(data.BlueScoreSummary.Score); + $("#bluePressurePoints").text(data.BlueScoreSummary.PressurePoints); + $("#blueRotors").text(data.BlueScoreSummary.Rotors); + $("#blueTakeoffs").text(data.BlueScore.Takeoffs); }; // Handles a websocket message to populate the final score data. @@ -68,24 +68,28 @@ var handleSetFinalScore = function(data) { $("#redFinalTeam1").text(data.Match.Red1); $("#redFinalTeam2").text(data.Match.Red2); $("#redFinalTeam3").text(data.Match.Red3); - $("#redFinalAuto").text(data.RedScore.AutoPoints); - $("#redFinalTeleop").text(data.RedScore.TeleopPoints); - $("#redFinalFoul").text(data.RedScore.FoulPoints); - $("#redFinalBreached").html(data.RedScore.Breached ? "✔" : "✘"); - $("#redFinalBreached").attr("data-checked", data.RedScore.Breached); - $("#redFinalCaptured").html(data.RedScore.Captured ? "✔" : "✘"); - $("#redFinalCaptured").attr("data-checked", data.RedScore.Captured); + $("#redFinalAutoMobilityPoints").text(data.RedScore.AutoMobilityPoints); + $("#redFinalPressurePoints").text(data.RedScore.PressurePoints); + $("#redFinalRotorPoints").text(data.RedScore.RotorPoints); + $("#redFinalTakeoffPoints").text(data.RedScore.TakeoffPoints); + $("#redFinalFoulPoints").text(data.RedScore.FoulPoints); + $("#redFinalPressureGoalReached").html(data.RedScore.PressureGoalReached ? "✔" : "✘"); + $("#redFinalPressureGoalReached").attr("data-checked", data.RedScore.PressureGoalReached); + $("#redFinalRotorGoalReached").html(data.RedScore.RotorGoalReached ? "✔" : "✘"); + $("#redFinalRotorGoalReached").attr("data-checked", data.RedScore.RotorGoalReached); $("#blueFinalScore").text(data.BlueScore.Score); $("#blueFinalTeam1").text(data.Match.Blue1); $("#blueFinalTeam2").text(data.Match.Blue2); $("#blueFinalTeam3").text(data.Match.Blue3); - $("#blueFinalAuto").text(data.BlueScore.AutoPoints); - $("#blueFinalTeleop").text(data.BlueScore.TeleopPoints); - $("#blueFinalFoul").text(data.BlueScore.FoulPoints); - $("#blueFinalBreached").html(data.BlueScore.Breached ? "✔" : "✘"); - $("#blueFinalBreached").attr("data-checked", data.BlueScore.Breached); - $("#blueFinalCaptured").html(data.BlueScore.Captured ? "✔" : "✘"); - $("#blueFinalCaptured").attr("data-checked", data.BlueScore.Captured); + $("#blueFinalAutoMobilityPoints").text(data.BlueScore.AutoMobilityPoints); + $("#blueFinalPressurePoints").text(data.BlueScore.PressurePoints); + $("#blueFinalRotorPoints").text(data.BlueScore.RotorPoints); + $("#blueFinalTakeoffPoints").text(data.BlueScore.TakeoffPoints); + $("#blueFinalFoulPoints").text(data.BlueScore.FoulPoints); + $("#blueFinalPressureGoalReached").html(data.BlueScore.PressureGoalReached ? "✔" : "✘"); + $("#blueFinalPressureGoalReached").attr("data-checked", data.BlueScore.PressureGoalReached); + $("#blueFinalRotorGoalReached").html(data.BlueScore.RotorGoalReached ? "✔" : "✘"); + $("#blueFinalRotorGoalReached").attr("data-checked", data.BlueScore.RotorGoalReached); $("#finalMatchName").text(data.MatchName + " " + data.Match.DisplayName); }; @@ -324,6 +328,9 @@ var transitionSponsorToScore = function(callback) { // Loads sponsor slide data and builds the slideshow HTML. var initializeSponsorDisplay = function() { $.getJSON("/api/sponsor_slides", function(sponsors) { + if (!sponsors) { + return; + } // Populate Tiles $.each(sponsors, function(index){ diff --git a/templates/audience_display.html b/templates/audience_display.html index f1111b5..93d71da 100644 --- a/templates/audience_display.html +++ b/templates/audience_display.html @@ -16,35 +16,6 @@