style: polish blog landing and cards

This commit is contained in:
OpenCode Worker
2026-06-03 11:06:03 -05:00
parent 755a65d9a6
commit 72f2e88673
5 changed files with 130 additions and 29 deletions

View File

@@ -1,6 +1,6 @@
"use client";
import { m } from "motion/react";
import { m, useReducedMotion } from "motion/react";
import { PostCard } from "./PostCard";
import type { PostMeta } from "@/lib/posts";
@@ -19,11 +19,18 @@ interface PostListProps {
}
export function PostList({ posts }: PostListProps) {
const shouldReduceMotion = useReducedMotion();
return (
<m.ul variants={listVariants} initial="hidden" animate="visible" className="space-y-8">
{posts.map((post) => (
<m.ul
variants={shouldReduceMotion ? undefined : listVariants}
initial={shouldReduceMotion ? false : "hidden"}
animate="visible"
className="space-y-6"
>
{posts.map((post, index) => (
<li key={post.slug}>
<PostCard {...post} index={posts.indexOf(post)} />
<PostCard {...post} index={index} />
</li>
))}
</m.ul>