Make required segments thicker in preview bar

This commit is contained in:
Ajay
2022-09-01 21:35:58 -04:00
parent 1f68f512fa
commit 2b5a02e068
3 changed files with 8 additions and 0 deletions

View File

@@ -39,6 +39,10 @@
height: 100%; height: 100%;
} }
.previewbar.requiredSegment {
transform: scaleY(3)
}
/* Make sure settings are upfront */ /* Make sure settings are upfront */
.ytp-settings-menu { .ytp-settings-menu {
z-index: 6000 !important; z-index: 6000 !important;

View File

@@ -1227,6 +1227,7 @@ function updatePreviewBar(): void {
if (video === null) return; if (video === null) return;
const hashParams = getHashParams();
const previewBarSegments: PreviewBarSegment[] = []; const previewBarSegments: PreviewBarSegment[] = [];
if (sponsorTimes) { if (sponsorTimes) {
sponsorTimes.forEach((segment) => { sponsorTimes.forEach((segment) => {
@@ -1240,6 +1241,7 @@ function updatePreviewBar(): void {
showLarger: segment.actionType === ActionType.Poi, showLarger: segment.actionType === ActionType.Poi,
description: segment.description, description: segment.description,
source: segment.source, source: segment.source,
requiredSegment: hashParams.requiredSegment && segment.UUID === hashParams.requiredSegment
}); });
}); });
} }

View File

@@ -23,6 +23,7 @@ export interface PreviewBarSegment {
showLarger: boolean; showLarger: boolean;
description: string; description: string;
source: SponsorSourceType; source: SponsorSourceType;
requiredSegment?: boolean;
} }
interface ChapterGroup extends SegmentContainer { interface ChapterGroup extends SegmentContainer {
@@ -251,6 +252,7 @@ class PreviewBar {
const bar = document.createElement('li'); const bar = document.createElement('li');
bar.classList.add('previewbar'); bar.classList.add('previewbar');
if (barSegment.requiredSegment) bar.classList.add("requiredSegment");
bar.innerHTML = showLarger ? '  ' : ' '; bar.innerHTML = showLarger ? '  ' : ' ';
const fullCategoryName = (unsubmitted ? 'preview-' : '') + category; const fullCategoryName = (unsubmitted ? 'preview-' : '') + category;