mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 21:56:50 -04:00
Merge pull request #5 from team751/allianceStationAnimation
Add animate.css and add rubberband animation to alliance display
This commit is contained in:
3158
static/css/animate.css
vendored
Normal file
3158
static/css/animate.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@
|
||||
var allianceStation = "";
|
||||
var blinkInterval;
|
||||
var currentScreen = "blank";
|
||||
var animationName = "rubberBand"; // See https://github.com/daneden/animate.css for more
|
||||
var websocket;
|
||||
|
||||
// Handles a websocket message to change which screen is displayed.
|
||||
@@ -49,11 +50,20 @@ var handleSetMatch = function(data) {
|
||||
$("#teamNumber").text("");
|
||||
$("#teamName").attr("data-alliance-bg", allianceStation[0]).text("");
|
||||
}
|
||||
|
||||
animateTeamNumber();
|
||||
} else {
|
||||
$("body").attr("data-mode", "displayId");
|
||||
}
|
||||
};
|
||||
|
||||
function animateTeamNumber() {
|
||||
$("#teamNumber").addClass(animationName);
|
||||
setTimeout(function() {
|
||||
$("#teamNumber").removeClass(animationName);
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
// Handles a websocket message to update the team connection status.
|
||||
var handleStatus = function(data) {
|
||||
stationStatus = data.AllianceStations[allianceStation];
|
||||
@@ -117,7 +127,7 @@ $(function() {
|
||||
window.location = "/displays/alliance_station?displayId=" + displayId;
|
||||
}
|
||||
$("#displayId").text(displayId);
|
||||
|
||||
|
||||
// Set up the websocket back to the server.
|
||||
websocket = new CheesyWebsocket("/displays/alliance_station/websocket?displayId=" + displayId, {
|
||||
setAllianceStationDisplay: function(event) { handleSetAllianceStationDisplay(event.data); },
|
||||
|
||||
@@ -11,13 +11,14 @@
|
||||
<link rel="shortcut icon" href="/static/img/favicon32.png">
|
||||
<link rel="stylesheet" href="/static/css/lib/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="/static/css/cheesy-arena.css" />
|
||||
<link rel="stylesheet" href="/static/css/animate.css" />
|
||||
<link rel="stylesheet" href="/static/css/alliance_station_display.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="displayId" class="mode"></div>
|
||||
<div id="match" class="mode">
|
||||
<div id="preMatch">
|
||||
<div id="teamNumber"></div>
|
||||
<div id="teamNumber" class="animated"></div>
|
||||
<div id="teamName" class='databar'></div>
|
||||
<div id="disabled" class='databar'>DISABLED</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user