feat: calendar strip smooth pause and fade edges
This commit is contained in:
@@ -133,17 +133,45 @@ export default function CalendarStrip() {
|
|||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
borderTop: `1px solid rgba(232,168,73,0.25)`,
|
borderTop: `1px solid rgba(232,168,73,0.25)`,
|
||||||
borderBottom: `1px solid rgba(232,168,73,0.25)`,
|
borderBottom: `1px solid rgba(232,168,73,0.25)`,
|
||||||
|
position: 'relative',
|
||||||
}}
|
}}
|
||||||
onMouseEnter={() => setPaused(true)}
|
onMouseEnter={() => setPaused(true)}
|
||||||
onMouseLeave={() => setPaused(false)}
|
onMouseLeave={() => setPaused(false)}
|
||||||
>
|
>
|
||||||
|
{/* Left fade mask */}
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
left: 0,
|
||||||
|
top: 0,
|
||||||
|
bottom: 0,
|
||||||
|
width: '80px',
|
||||||
|
background: `linear-gradient(to right, ${navy} 0%, transparent 100%)`,
|
||||||
|
pointerEvents: 'none',
|
||||||
|
zIndex: 10,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{/* Right fade mask */}
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
right: 0,
|
||||||
|
top: 0,
|
||||||
|
bottom: 0,
|
||||||
|
width: '80px',
|
||||||
|
background: `linear-gradient(to left, ${navy} 0%, transparent 100%)`,
|
||||||
|
pointerEvents: 'none',
|
||||||
|
zIndex: 10,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
gap: '1rem',
|
gap: '1rem',
|
||||||
padding: '0 1rem',
|
padding: '0 1rem',
|
||||||
width: 'max-content',
|
width: 'max-content',
|
||||||
animation: paused ? 'none' : 'marquee 38s linear infinite',
|
animation: 'marquee 60s linear infinite',
|
||||||
|
animationPlayState: paused ? 'paused' : 'running',
|
||||||
}}
|
}}
|
||||||
ref={trackRef}
|
ref={trackRef}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user