Add glow and animation to timeline
This commit is contained in:
@@ -10,11 +10,20 @@ export function TimelineWrapper({ children, className }: TimelineWrapperProps) {
|
||||
const items = Children.toArray(children);
|
||||
return (
|
||||
<div className={clsx('relative pl-8', className)}>
|
||||
<span className="pointer-events-none absolute left-3 top-0 h-full w-[2px] bg-gradient-to-b from-blue-500 via-blue-200 to-slate-200 shadow-[0_0_8px_rgba(59,130,246,0.35)] dark:from-cyan-400 dark:via-cyan-300 dark:to-slate-700" aria-hidden="true" />
|
||||
<span
|
||||
className="pointer-events-none absolute left-3 top-0 h-full w-[2px] rounded-full bg-gradient-to-b from-blue-500 via-blue-200 to-slate-200 shadow-[0_0_10px_rgba(59,130,246,0.45)] dark:from-cyan-400 dark:via-cyan-300 dark:to-slate-700"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<span
|
||||
className="pointer-events-none absolute left-3 top-0 h-full w-[6px] rounded-full bg-gradient-to-b from-blue-500/20 via-blue-200/15 to-transparent blur-[12px]"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<span className="timeline-scroll-dot pointer-events-none absolute left-3 top-0 h-2 w-2 -translate-x-1/2 rounded-full bg-white shadow-[0_0_8px_rgba(96,165,250,0.7)]" aria-hidden="true" />
|
||||
|
||||
<div className="space-y-4">
|
||||
{items.map((child, index) => (
|
||||
<div key={index} className="relative pl-6">
|
||||
<span className="pointer-events-none absolute left-0 top-1/2 h-[2px] w-6 -translate-x-full -translate-y-1/2 bg-gradient-to-r from-blue-400 to-transparent dark:from-cyan-300" aria-hidden="true" />
|
||||
<div key={index} className="relative pl-6 sm:pl-8">
|
||||
<span className="pointer-events-none absolute left-0 top-1/2 h-[2px] w-7 -translate-x-full -translate-y-1/2 bg-gradient-to-r from-blue-400/80 via-blue-300/60 to-transparent dark:from-cyan-300/80 dark:via-cyan-200/60" aria-hidden="true" />
|
||||
{child}
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -29,6 +29,28 @@ body {
|
||||
font-family: var(--font-system-sans);
|
||||
}
|
||||
|
||||
@keyframes timeline-scroll {
|
||||
0% {
|
||||
transform: translate(-50%, -10%);
|
||||
opacity: 0;
|
||||
}
|
||||
15% {
|
||||
opacity: 1;
|
||||
}
|
||||
85% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
transform: translate(-50%, 110%);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.timeline-scroll-dot {
|
||||
animation: timeline-scroll 6s linear infinite;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
|
||||
.toc-target-highlight {
|
||||
@apply bg-yellow-50/60 dark:bg-yellow-900/40 transition-colors duration-500;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user