-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a configurable, optional timer to the alliance selection audience…
… overlay.
- Loading branch information
Showing
11 changed files
with
239 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2024 Team 254. All Rights Reserved. | ||
// Author: [email protected] (Patrick Fairbank) | ||
// | ||
// Client-side logic for the alliance selection page. | ||
|
||
var websocket; | ||
|
||
// Sends a websocket message to show the timer. | ||
const showTimer = function() { | ||
websocket.send("showTimer"); | ||
}; | ||
|
||
// Sends a websocket message to hide the timer. | ||
const hideTimer = function() { | ||
websocket.send("hideTimer"); | ||
} | ||
|
||
// Handles a websocket message to update the alliance selection status. | ||
const handleAllianceSelection = function(data) { | ||
$("#timer").text(getCountdownString(data.TimeRemainingSec)); | ||
}; | ||
|
||
$(function() { | ||
// Activate playoff tournament datetime picker. | ||
const startTime = moment(new Date()).hour(13).minute(0).second(0); | ||
newDateTimePicker("startTimePicker", startTime.toDate()); | ||
|
||
// Set up the websocket back to the server. | ||
websocket = new CheesyWebsocket("/alliance_selection/websocket", { | ||
allianceSelection: function(event) { handleAllianceSelection(event.data); }, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.