Skip to content
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 46 additions & 6 deletions teslausb-www/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,20 @@
color: #000;
z-index:11;
}

.navbar + div {
height: calc(100% - 50px);
}
.videoholder.layout6 {
grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
grid-template-columns: auto auto auto;
justify-content: center;
}
.videoholder.layout6 .videogriditem {
height: 100%;
width: auto;
max-width: 100%;
}
}

/*hide music tab by default */
Expand Down Expand Up @@ -1100,6 +1114,14 @@
var rightpillarview = document.getElementById("rightpillarview");
var backview = document.getElementById("backview");
var videogrid = document.querySelector(".videoholder");

/* Reset flipped status to ensure clean state for non-mirrored layouts (3, 5, 6) */
if (layout == 3 || layout == 5 || layout == 6) {
leftrepeaterview.classList.remove("flipped");
rightrepeaterview.classList.remove("flipped");
backview.classList.remove("flipped");
}

if (layout == 1) {
// mirrorleft-front-mirrorright on top, map-mirrorrear-info on bottom
leftrepeaterview.classList.add("flipped");
Expand All @@ -1120,19 +1142,13 @@
videogrid.classList="videoholder layout4";
} else if (layout == 5) {
// front on top, sides in middle, rear on bottom
leftrepeaterview.classList.remove("flipped");
rightrepeaterview.classList.remove("flipped");
backview.classList.remove("flipped");
videogrid.classList="videoholder layout5";
} else if (layout == 6) {
// map-front-info on top, pillars on the side, repeaters and rear on bottom
videogrid.classList="videoholder layout6";
} else {
layout = 3;
// (default) map-front-info on top, right-rear-left on bottom
leftrepeaterview.classList.remove("flipped");
rightrepeaterview.classList.remove("flipped");
backview.classList.remove("flipped");
videogrid.classList="videoholder layout3";
}
currentLayout = layout;
Expand All @@ -1147,6 +1163,30 @@
item.classList.remove("selected");
}
}

if (typeof currentsequence !== 'undefined') {
setTimeout(function() {
for (var i=0; i < 6;i++) {
var v = videoelems[i];
var c = canvaselems[i];

if (v.clientWidth > 0 && v.clientHeight > 0) {
c.width = v.clientWidth;
c.height = v.clientHeight;
}

if (v.style.visibility == "hidden") {
var ctx = c.getContext("2d");
if (v.classList.contains("flipped")) {
ctx.scale(-1, 1);
ctx.drawImage(v, 0, 0, -c.width, c.height);
} else {
ctx.drawImage(v, 0, 0, c.width, c.height);
}
}
}
}, 50);
}
Comment on lines +1172 to +1194
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is quite similar to the freezeVideoElems function. Could this be a common function or something?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The layout update path intentionally mirrors the existing freezeVideoElems flow so the behavior stays consistent, which is why you’re seeing similar code there.

}

function cycleLayout() {
Expand Down