some more features and fixes (title and show info)
This commit is contained in:
@@ -159,26 +159,11 @@ App.feed = App.feed || {};
|
||||
slide.classList.remove('is-loaded');
|
||||
};
|
||||
|
||||
// Single-line feed title that scrolls horizontally when it overflows.
|
||||
// Driven off the overflow distance so every title scrolls at the same
|
||||
// gentle speed, matching the grid-card marquee (see App.videos.measureTitle).
|
||||
// Single-line slide title that scrolls when it overflows. Only the active
|
||||
// slide's title is measured, so like the player it always scrolls.
|
||||
const measureFeedTitle = function(slide) {
|
||||
if (!slide) return;
|
||||
const wrap = slide.querySelector('.feed-title');
|
||||
const text = slide.querySelector('.feed-title-text');
|
||||
if (!wrap || !text) return;
|
||||
const overflow = text.scrollWidth - wrap.clientWidth;
|
||||
if (overflow > 4) {
|
||||
const distance = overflow + 16;
|
||||
const MARQUEE_SPEED = 28; // px per second
|
||||
const duration = Math.max(6, distance / MARQUEE_SPEED);
|
||||
text.style.setProperty('--marquee-distance', `${distance}px`);
|
||||
text.style.setProperty('--marquee-duration', `${duration.toFixed(2)}s`);
|
||||
wrap.classList.add('is-marquee');
|
||||
} else {
|
||||
wrap.classList.remove('is-marquee');
|
||||
text.style.removeProperty('--marquee-distance');
|
||||
}
|
||||
App.marquee.measure(slide.querySelector('.feed-title'), slide.querySelector('.feed-title-text'));
|
||||
};
|
||||
|
||||
const setTimelinePosition = function(slide, ratio) {
|
||||
|
||||
Reference in New Issue
Block a user