Decouple lower third from audience display mode so that it can be shown on top of other elements.

This commit is contained in:
Patrick Fairbank
2020-03-28 14:37:26 -07:00
parent 5a5f9ca366
commit 244ddce9e4
5 changed files with 32 additions and 38 deletions

View File

@@ -155,20 +155,29 @@ var handleAllianceSelection = function(alliances) {
// Handles a websocket message to populate and/or show/hide a lower third.
var handleLowerThird = function(data) {
if (data === null) {
return;
if (data.LowerThird !== null) {
if (data.LowerThird.BottomText === "") {
$("#lowerThirdTop").hide();
$("#lowerThirdBottom").hide();
$("#lowerThirdSingle").text(data.LowerThird.TopText);
$("#lowerThirdSingle").show();
} else {
$("#lowerThirdSingle").hide();
$("#lowerThirdTop").text(data.LowerThird.TopText);
$("#lowerThirdBottom").text(data.LowerThird.BottomText);
$("#lowerThirdTop").show();
$("#lowerThirdBottom").show();
}
}
if (data.BottomText === "") {
$("#lowerThirdTop").hide();
$("#lowerThirdBottom").hide();
$("#lowerThirdSingle").text(data.TopText);
$("#lowerThirdSingle").show();
} else {
$("#lowerThirdSingle").hide();
$("#lowerThirdTop").text(data.TopText);
$("#lowerThirdBottom").text(data.BottomText);
$("#lowerThirdTop").show();
$("#lowerThirdBottom").show();
var lowerThirdElement = $("#lowerThird");
if (data.ShowLowerThird && !lowerThirdElement.is(":visible")) {
lowerThirdElement.show();
lowerThirdElement.transition({queue: false, left: "150px"}, 750, "ease");
} else if (!data.ShowLowerThird && lowerThirdElement.is(":visible")) {
lowerThirdElement.transition({queue: false, left: "-1000px"}, 1000, "ease", function () {
lowerThirdElement.hide();
});
}
};
@@ -316,20 +325,6 @@ var transitionAllianceSelectionToBlank = function(callback) {
$('#allianceSelectionCentering').transition({queue: false, right: "-60em"}, 500, "ease", callback);
};
var transitionBlankToLowerThird = function(callback) {
$("#lowerThird").show();
$("#lowerThird").transition({queue: false, left: "150px"}, 750, "ease", callback);
};
var transitionLowerThirdToBlank = function(callback) {
$("#lowerThird").transition({queue: false, left: "-1000px"}, 1000, "ease", function() {
$("#lowerThird").hide();
if (callback) {
callback();
}
});
};
var transitionBlankToSponsor = function(callback) {
$(".blindsCenter.blank").css({rotateY: "90deg"});
$(".blinds.right").transition({queue: false, right: 0}, 1000, "ease");
@@ -547,7 +542,6 @@ $(function() {
logo: transitionBlankToLogo,
sponsor: transitionBlankToSponsor,
allianceSelection: transitionBlankToAllianceSelection,
lowerThird: transitionBlankToLowerThird,
timeout: transitionBlankToTimeout
},
intro: {
@@ -577,9 +571,6 @@ $(function() {
allianceSelection: {
blank: transitionAllianceSelectionToBlank
},
lowerThird: {
blank: transitionLowerThirdToBlank
},
timeout: {
blank: transitionTimeoutToBlank,
intro: transitionTimeoutToIntro