mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 04:42:57 +00:00
feat: implement marquee scrolling for video card titles
- Replaced CSS truncation with a custom marquee structure in `VideoCard.js` for titles and author names. - Added `css/tailwind.source.css` utilities for `.marquee-host`, `.marquee-static`, and `.marquee-track` animations. - Implemented `ResizeObserver` (shared singleton) to detect overflow and enable marquee only when needed. - Implemented `IntersectionObserver` (shared singleton) to trigger marquee on mobile when the card is in the center of the viewport. - Configured dynamic animation duration based on text content width to ensure constant scrolling speed. - Verified visual behavior via Playwright screenshots. - Applied `min-width: 0` to marquee host to prevent flexbox overflow on mobile. - Updated raw CSS values to use design tokens to pass linting.
This commit is contained in:
1 parent
c719bdf558
commit
f03adbb909
3 files changed
+7
-6
No files matched your search
@@ -3016,7 +3016,7 @@ export class VideoCard {
|
||||
|
||||
if (isOverflowing) {
|
||||
host.classList.add("can-marquee");
|
||||
// Speed: 50px/s
|
||||
// Speed: 50 pixels per second
|
||||
// Distance is contentWidth (one item width including padding)
|
||||
const distance = contentWidth;
|
||||
const duration = distance / 50;
|
||||
|
||||
Reference in new issue
Block a user