feat: add images logo's

spoil in the description :
netflix logo, Glyph White Bear logo and  P.A.C.S. logo are now chosable instead of text
This commit is contained in:
EL-R1 2023-06-19 21:09:01 +02:00
parent 9772a6dfb1
commit 6dacda6dbd

View file

@ -174,13 +174,23 @@ function newList(id) {
return ul; return ul;
} }
function addItem(ul, text, url) { function addItem(ul, text, url, TheChoice) {
var li = document.createElement("li"); var li = document.createElement("li");
var a = document.createElement("a"); var a = document.createElement("a");
a.textContent = text;
a.setAttribute('href', url); console.log("THE CHOICE", TheChoice, TheChoice.image)
li.appendChild(a); if (TheChoice && TheChoice.image){
ul.appendChild(li); a.style.backgroundImage = TheChoice.image.styles.backgroundImage;
a.style.backgroundPosition = "center center";
a.style.backgroundSize = "10rem";
a.style.backgroundRepeat = TheChoice.image.styles.backgroundRepeat;
}else{
a.textContent = text;
}
a.setAttribute('href', url);
li.appendChild(a);
ul.appendChild(li);
} }
var nextChoice = -1; var nextChoice = -1;
@ -189,7 +199,7 @@ var nextSegment = null;
function addZones(segmentId) { function addZones(segmentId) {
var ul = newList("interactionZones"); var ul = newList("interactionZones");
let caption = 'currentSegment(' + segmentId + ')'; let caption = 'currentSegment(' + segmentId + ')';
addItem(ul, caption, 'javascript:playSegment("' + segmentId + '")'); addItem(ul, caption, 'javascript:playSegment("' + segmentId + '")', false);
var segment = segmentMap.segments[segmentId]; var segment = segmentMap.segments[segmentId];
if (segment && segment.ui && segment.ui.interactionZones) { if (segment && segment.ui && segment.ui.interactionZones) {
@ -198,7 +208,7 @@ function addZones(segmentId) {
var startMs = z[0]; var startMs = z[0];
var stopMs = z[1]; var stopMs = z[1];
let caption = segmentId + ' interactionZone ' + index; let caption = segmentId + ' interactionZone ' + index;
addItem(ul, caption, 'javascript:seek(' + startMs + ')'); addItem(ul, caption, 'javascript:seek(' + startMs + ')', false);
index++; index++;
} }
} }
@ -209,7 +219,7 @@ function addZones(segmentId) {
let caption = k; let caption = k;
if (segment.defaultNext == k) if (segment.defaultNext == k)
caption = '[' + caption + ']'; caption = '[' + caption + ']';
addItem(ul, caption, 'javascript:playSegment("' + k + '")'); addItem(ul, caption, 'javascript:playSegment("' + k + '")', false);
} }
} }
} }