Adjust thumbnail positioning offsets for improved visual alignment

This commit is contained in:
Sebastiaan de Schaetzen 2025-06-17 18:15:50 +02:00
parent 8103839e72
commit 371b3be5fd

View File

@ -348,15 +348,16 @@
} }
selectedThumbnailIndex = index; selectedThumbnailIndex = index;
videoInfo[selectedThumbnailIndex].thumbnail.classList.add("focussed"); videoInfo[selectedThumbnailIndex].thumbnail.classList.add("focussed");
const offset = 12;
for (let i = 0; i < videoInfo.length; i++) { for (let i = 0; i < videoInfo.length; i++) {
if (i < selectedThumbnailIndex - 1) { if (i < selectedThumbnailIndex - 1) {
videoInfo[i].thumbnail.style.left = "-20%"; videoInfo[i].thumbnail.style.left = "-20%";
} else if (i === selectedThumbnailIndex - 1) { } else if (i === selectedThumbnailIndex - 1) {
videoInfo[i].thumbnail.style.left = "15%"; videoInfo[i].thumbnail.style.left = offset + "%";
} else if (i === selectedThumbnailIndex) { } else if (i === selectedThumbnailIndex) {
videoInfo[i].thumbnail.style.left = "50%"; videoInfo[i].thumbnail.style.left = "50%";
} else if (i === selectedThumbnailIndex + 1) { } else if (i === selectedThumbnailIndex + 1) {
videoInfo[i].thumbnail.style.left = "85%"; videoInfo[i].thumbnail.style.left = (100 - offset) + "%";
} else { } else {
videoInfo[i].thumbnail.style.left = "120%"; videoInfo[i].thumbnail.style.left = "120%";
} }