Refine timeline visuals and apply to blog list

This commit is contained in:
2025-11-19 00:58:13 +08:00
parent fe191752da
commit 287c0d72a8
3 changed files with 10 additions and 6 deletions

View File

@@ -18,8 +18,10 @@ export function PostListItem({ post }: Props) {
post.description || post.custom_excerpt || post.body?.raw?.slice(0, 120);
return (
<li className="relative pl-6">
<span className="pointer-events-none absolute left-0 top-6 z-10 h-3 w-3 rounded-full border-2 border-white bg-gradient-to-br from-blue-500 via-sky-400 to-indigo-400 shadow-md dark:border-slate-900" aria-hidden="true" />
<div className="timeline-entry group relative pl-6" role="listitem">
<span className="pointer-events-none absolute left-0 top-6 z-10 flex h-4 w-4 items-center justify-center rounded-full bg-white shadow ring-2 ring-white dark:bg-slate-900 dark:shadow-slate-900/50 dark:ring-slate-900" aria-hidden="true">
<span className="block h-2 w-2 rounded-full bg-gradient-to-br from-blue-500 via-sky-400 to-indigo-400 transition-transform duration-300 ease-out group-hover:scale-125" />
</span>
<article className="motion-card group relative flex gap-4 rounded-lg border border-slate-200/70 bg-white/90 p-4 shadow-sm dark:border-slate-800 dark:bg-slate-900/80">
<div className="pointer-events-none absolute inset-x-0 top-0 h-0.5 origin-left scale-x-0 bg-gradient-to-r from-blue-500 via-sky-400 to-indigo-500 opacity-80 transition-transform duration-300 ease-out group-hover:scale-x-100 dark:from-blue-400 dark:via-sky-300 dark:to-indigo-400" />
{cover && (
@@ -57,6 +59,6 @@ export function PostListItem({ post }: Props) {
)}
</div>
</article>
</li>
</div>
);
}

View File

@@ -11,6 +11,7 @@ import {
} from '@fortawesome/free-solid-svg-icons';
import { siteConfig } from '@/lib/config';
import { PostListItem } from './post-list-item';
import { TimelineWrapper } from './timeline-wrapper';
interface Props {
posts: Post[];
@@ -151,11 +152,11 @@ export function PostListWithControls({ posts, pageSize }: Props) {
</div>
) : (
<div className="space-y-3">
<TimelineWrapper className="space-y-3">
{currentPosts.map((post) => (
<PostListItem key={post._id} post={post} />
))}
</div>
</TimelineWrapper>
)}
{totalPages > 1 && currentPosts.length > 0 && (

View File

@@ -9,7 +9,8 @@ interface TimelineWrapperProps {
export function TimelineWrapper({ children, className }: TimelineWrapperProps) {
return (
<div className={clsx('relative pl-8', className)}>
<div className="pointer-events-none absolute left-3 top-0 h-full w-px bg-gradient-to-b from-transparent via-slate-200 to-transparent dark:via-slate-700" aria-hidden="true" />
<div className="pointer-events-none absolute left-3 top-0 h-full w-px bg-gradient-to-b from-transparent via-blue-200/70 to-transparent dark:via-blue-900/30" aria-hidden="true" />
<div className="pointer-events-none absolute left-[10px] top-0 h-full w-px bg-gradient-to-b from-blue-500/20 via-blue-400/30 to-transparent blur-[1px] dark:from-blue-300/15 dark:via-blue-400/20" aria-hidden="true" />
<div className="space-y-4">
{children}
</div>