Skip to content

Commit

Permalink
Refine animation of moving names
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshikouki committed Aug 31, 2024
1 parent f7ff3df commit f835a06
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/app/activities/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ export default async function ActivitiesPage({
return (
<main className="flex flex-col items-center justify-center gap-10 py-10">
<div className="flex flex-col gap-5">
<h1 className="font-bold text-2xl">{activity.name}</h1>
<h1
className="font-bold text-2xl"
style={{
viewTransitionName: `activity-${activity.id}`,
}}
>
{activity.name}
</h1>
<div className="text-gray-500">
{activity.latestLog.loggedAt} days ago
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export default async function HomePage() {
<AnimatedLink
href={url.activity(activity.id)}
className="font-bold text-lg"
style={{
viewTransitionName: `activity-${activity.id}`,
}}
>
{activity.name}
</AnimatedLink>
Expand Down

0 comments on commit f835a06

Please sign in to comment.