revert: simplify to only resize container, restore image visibility

This commit is contained in:
Ching L 2025-12-04 01:19:46 +08:00
parent 9c5accc503
commit b8ccd29665

View File

@ -97,37 +97,15 @@
height: 50px !important; height: 50px !important;
overflow: hidden; overflow: hidden;
} }
.plyr__preview-thumb__image-container img {
transform: scale(0.35) !important;
transform-origin: top left !important;
}
`; `;
document.head.appendChild(style); document.head.appendChild(style);
console.log('Custom styles added for preview thumb image container'); console.log('Custom styles added for preview thumb image container');
} }
// Function to continuously update image scale to ensure it takes effect
function updateImageScale() {
const images = document.querySelectorAll('.plyr__preview-thumb__image-container img');
images.forEach(img => {
if (!img.style.transform || !img.style.transform.includes('scale(0.35)')) {
img.style.setProperty('transform', 'scale(0.35)', 'important');
img.style.setProperty('transform-origin', 'top left', 'important');
}
});
}
// Run the sort function after the DOM content has loaded // Run the sort function after the DOM content has loaded
window.addEventListener('load', function() { window.addEventListener('load', function() {
addCustomStyles(); addCustomStyles();
addSortButton(); addSortButton();
sortAllVideos(); sortAllVideos();
// Periodically update image scale to ensure it takes effect
setInterval(updateImageScale, 1000);
// Also update immediately
setTimeout(updateImageScale, 100);
setTimeout(updateImageScale, 500);
}) })
})(); })();