Skip to content

Commit

Permalink
Update final score screen for 2024.
Browse files Browse the repository at this point in the history
  • Loading branch information
patfair committed May 16, 2024
1 parent fad1a63 commit 689a3bf
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 54 deletions.
71 changes: 35 additions & 36 deletions static/js/audience_display.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const scoreIn = $(".score").css("width");
const scoreMid = "185px";
const scoreOut = "400px";
const scoreFieldsOut = "180px";
const scoreLogoTop = "-450px";
const scoreLogoTop = "-470px";
const bracketLogoTop = "-780px";
const bracketLogoScale = 0.75;
const timeoutDetailsIn = $("#timeoutDetails").css("width");
Expand Down Expand Up @@ -227,7 +227,6 @@ const handleRealtimeScore = function(data) {

// Handles a websocket message to populate the final score data.
const handleScorePosted = function(data) {
// TODO(pat): Update for 2024.
$(`#${redSide}FinalScore`).text(data.RedScoreSummary.Score);
$(`#${redSide}FinalAlliance`).text("Alliance " + data.Match.PlayoffRedAlliance);
setTeamInfo(redSide, 1, data.Match.Red1, data.RedRankings);
Expand All @@ -238,23 +237,23 @@ const handleScorePosted = function(data) {
} else {
setTeamInfo(redSide, 4, 0, data.RedRankings);
}
// $(`#${redSide}FinalMobilityPoints").text(data.RedScoreSummary.MobilityPoints);
// $(`#${redSide}FinalGridPoints").text(data.RedScoreSummary.GridPoints);
// $(`#${redSide}FinalChargeStationPoints").text(data.RedScoreSummary.ChargeStationPoints);
// $(`#${redSide}FinalParkPoints").text(data.RedScoreSummary.ParkPoints);
// $(`#${redSide}FinalFoulPoints").text(data.RedScoreSummary.FoulPoints);
// $(`#${redSide}FinalSustainabilityBonusRankingPoint").html(
// data.RedScoreSummary.SustainabilityBonusRankingPoint ? "✔" : "✘"
// );
// $(`#${redSide}FinalSustainabilityBonusRankingPoint").attr(
// "data-checked", data.RedScoreSummary.SustainabilityBonusRankingPoint
// );
// $(`#${redSide}FinalActivationBonusRankingPoint").html(
// data.RedScoreSummary.ActivationBonusRankingPoint ? "✔" : "✘"
// );
// $(`#${redSide}FinalActivationBonusRankingPoint").attr(
// "data-checked", data.RedScoreSummary.ActivationBonusRankingPoint
// );
$(`#${redSide}FinalLeavePoints`).text(data.RedScoreSummary.LeavePoints);
$(`#${redSide}FinalSpeakerPoints`).text(data.RedScoreSummary.SpeakerPoints);
$(`#${redSide}FinalAmpPoints`).text(data.RedScoreSummary.AmpPoints);
$(`#${redSide}FinalStagePoints`).text(data.RedScoreSummary.StagePoints);
$(`#${redSide}FinalFoulPoints`).text(data.RedScoreSummary.FoulPoints);
$(`#${redSide}FinalMelodyBonusRankingPoint`).html(
data.RedScoreSummary.MelodyBonusRankingPoint ? "✔" : "✘"
);
$(`#${redSide}FinalMelodyBonusRankingPoint`).attr(
"data-checked", data.RedScoreSummary.MelodyBonusRankingPoint
);
$(`#${redSide}FinalEnsembleBonusRankingPoint`).html(
data.RedScoreSummary.EnsembleBonusRankingPoint ? "✔" : "✘"
);
$(`#${redSide}FinalEnsembleBonusRankingPoint`).attr(
"data-checked", data.RedScoreSummary.EnsembleBonusRankingPoint
);
$(`#${redSide}FinalRankingPoints`).html(data.RedRankingPoints);
$(`#${redSide}FinalWins`).text(data.RedWins);
const redFinalDestination = $(`#${redSide}FinalDestination`);
Expand All @@ -272,23 +271,23 @@ const handleScorePosted = function(data) {
} else {
setTeamInfo(blueSide, 4, 0, data.BlueRankings);
}
// $(`#${blueSide}FinalMobilityPoints`).text(data.BlueScoreSummary.MobilityPoints);
// $(`#${blueSide}FinalGridPoints`).text(data.BlueScoreSummary.GridPoints);
// $(`#${blueSide}FinalChargeStationPoints`).text(data.BlueScoreSummary.ChargeStationPoints);
// $(`#${blueSide}FinalParkPoints`).text(data.BlueScoreSummary.ParkPoints);
// $(`#${blueSide}FinalFoulPoints`).text(data.BlueScoreSummary.FoulPoints);
// $(`#${blueSide}FinalSustainabilityBonusRankingPoint`).html(
// data.BlueScoreSummary.SustainabilityBonusRankingPoint ? "✔" : "✘"
// );
// $(`#${blueSide}FinalSustainabilityBonusRankingPoint`).attr(
// "data-checked", data.BlueScoreSummary.SustainabilityBonusRankingPoint
// );
// $(`#${blueSide}FinalActivationBonusRankingPoint`).html(
// data.BlueScoreSummary.ActivationBonusRankingPoint ? "✔" : "✘"
// );
// $(`#${blueSide}FinalActivationBonusRankingPoint`).attr(
// "data-checked", data.BlueScoreSummary.ActivationBonusRankingPoint
// );
$(`#${blueSide}FinalLeavePoints`).text(data.BlueScoreSummary.LeavePoints);
$(`#${blueSide}FinalSpeakerPoints`).text(data.BlueScoreSummary.SpeakerPoints);
$(`#${blueSide}FinalAmpPoints`).text(data.BlueScoreSummary.AmpPoints);
$(`#${blueSide}FinalStagePoints`).text(data.BlueScoreSummary.StagePoints);
$(`#${blueSide}FinalFoulPoints`).text(data.BlueScoreSummary.FoulPoints);
$(`#${blueSide}FinalMelodyBonusRankingPoint`).html(
data.BlueScoreSummary.MelodyBonusRankingPoint ? "✔" : "✘"
);
$(`#${blueSide}FinalMelodyBonusRankingPoint`).attr(
"data-checked", data.BlueScoreSummary.MelodyBonusRankingPoint
);
$(`#${blueSide}FinalEnsembleBonusRankingPoint`).html(
data.BlueScoreSummary.EnsembleBonusRankingPoint ? "✔" : "✘"
);
$(`#${blueSide}FinalEnsembleBonusRankingPoint`).attr(
"data-checked", data.BlueScoreSummary.EnsembleBonusRankingPoint
);
$(`#${blueSide}FinalRankingPoints`).html(data.BlueRankingPoints);
$(`#${blueSide}FinalWins`).text(data.BlueWins);
const blueFinalDestination = $(`#${blueSide}FinalDestination`);
Expand Down
36 changes: 18 additions & 18 deletions templates/audience_display.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@
</div>
</div>
<div class="final-breakdown" id="leftFinalBreakdown">
<div id="leftFinalMobilityPoints"></div>
<div id="leftFinalGridPoints"></div>
<div id="leftFinalChargeStationPoints"></div>
<div id="leftFinalParkPoints"></div>
<div id="leftFinalLeavePoints"></div>
<div id="leftFinalSpeakerPoints"></div>
<div id="leftFinalAmpPoints"></div>
<div id="leftFinalStagePoints"></div>
<div id="leftFinalFoulPoints"></div>
<div class="playoff-hidden-field">
<div id="leftFinalSustainabilityBonusRankingPoint"></div>
<div id="leftFinalActivationBonusRankingPoint"></div>
<div id="leftFinalMelodyBonusRankingPoint"></div>
<div id="leftFinalEnsembleBonusRankingPoint"></div>
<div id="leftFinalRankingPoints"></div>
</div>
<div class="playoff-only-field">
Expand All @@ -169,14 +169,14 @@
</div>
</div>
<div class="final-breakdown" id="centerFinalBreakdown">
<div>Mobility</div>
<div>Grid</div>
<div>Charge Station</div>
<div>Park</div>
<div>Leave</div>
<div>Speaker</div>
<div>Amp</div>
<div>Stage</div>
<div>Foul</div>
<div class="playoff-hidden-field">
<div>Sustainability Bonus</div>
<div>Activation Bonus</div>
<div>Melody Bonus</div>
<div>Ensemble Bonus</div>
<div>Ranking Points</div>
</div>
<div class="playoff-only-field">
Expand All @@ -185,14 +185,14 @@
</div>
</div>
<div class="final-breakdown" id="rightFinalBreakdown">
<div id="rightFinalMobilityPoints"></div>
<div id="rightFinalGridPoints"></div>
<div id="rightFinalChargeStationPoints"></div>
<div id="rightFinalParkPoints"></div>
<div id="rightFinalLeavePoints"></div>
<div id="rightFinalSpeakerPoints"></div>
<div id="rightFinalAmpPoints"></div>
<div id="rightFinalStagePoints"></div>
<div id="rightFinalFoulPoints"></div>
<div class="playoff-hidden-field">
<div id="rightFinalSustainabilityBonusRankingPoint"></div>
<div id="rightFinalActivationBonusRankingPoint"></div>
<div id="rightFinalMelodyBonusRankingPoint"></div>
<div id="rightFinalEnsembleBonusRankingPoint"></div>
<div id="rightFinalRankingPoints"></div>
</div>
<div class="playoff-only-field">
Expand Down

0 comments on commit 689a3bf

Please sign in to comment.