mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Make gradiant display for chapter seek bar follow the same UI as YouTube
This commit is contained in:
@@ -651,10 +651,15 @@ class PreviewBar {
|
|||||||
customChangedElement.style.transform =
|
customChangedElement.style.transform =
|
||||||
`scaleX(${scale})`;
|
`scaleX(${scale})`;
|
||||||
if (customChangedElement.style.backgroundSize) {
|
if (customChangedElement.style.backgroundSize) {
|
||||||
const backgroundSize = progressBar.clientWidth;
|
const backgroundSize = Math.max(changedData.scale / scale, fullSectionWidth * progressBar.clientWidth);
|
||||||
customChangedElement.style.backgroundSize = `${backgroundSize}px`;
|
customChangedElement.style.backgroundSize = `${backgroundSize}px`;
|
||||||
|
|
||||||
customChangedElement.style.backgroundPosition = `${-(cursor * progressBar.clientWidth)}px`;
|
if (changedData.scale < (cursor + fullSectionWidth) * progressBar.clientWidth) {
|
||||||
|
customChangedElement.style.backgroundPosition = `-${backgroundSize - fullSectionWidth * progressBar.clientWidth}px`;
|
||||||
|
} else {
|
||||||
|
// Passed this section
|
||||||
|
customChangedElement.style.backgroundPosition = `-${cursor * progressBar.clientWidth}px`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstUpdate) {
|
if (firstUpdate) {
|
||||||
|
|||||||
Reference in New Issue
Block a user