Refactor AlbumCard and AlbumDetail components to enhance view transitions

- Wrapped album title and release date in span elements to apply view transition names, improving animation consistency.
- Updated styling for album title and release date to maintain visual integrity with dynamic theming.
This commit is contained in:
m4x809 2025-10-25 01:41:23 +02:00
parent 6024cdc442
commit 64cf136850
Signed by: m4x809
SSH key fingerprint: SHA256:YCoFF78p2DUP94EnCScqLwldjkKDwdKSZq3r8p/6EiU
2 changed files with 18 additions and 18 deletions

View file

@ -72,26 +72,26 @@ export default function AlbumCard({ album }: { album: Album }) {
fw={700}
className="transition-colors"
style={{
viewTransitionName: `album-card-title-${album.id}`,
color: theme.text.primary,
}}
>
{label}
<span style={{ viewTransitionName: `album-card-title-${album.id}` }}>{label}</span>
</Text>
<Text
size="sm"
style={{
viewTransitionName: `album-card-release-date-${album.id}`,
color: theme.text.secondary,
}}
>
<span style={{ viewTransitionName: `album-card-release-date-${album.id}` }}>
<span style={{ color: theme.accent.DEFAULT, fontWeight: 600 }}>Released: </span>
{new Date(releaseDate).toLocaleDateString("en-US", {
year: "numeric",
month: "long",
day: "numeric",
})}
</span>
</Text>
<Group gap="xs">

View file

@ -79,27 +79,27 @@ export default async function AlbumDetail({ params }: { params: Promise<{ albumI
order={1}
className="mb-3 text-6xl font-bold"
style={{
viewTransitionName: `album-card-title-${album.id}`,
color: theme.text.primary,
textShadow: `0 0 20px ${theme.primary.DEFAULT}80`,
}}
>
{album.label}
<span style={{ viewTransitionName: `album-card-title-${album.id}` }}>{album.label}</span>
</Title>
<Text
size="xl"
className="mb-4"
style={{
viewTransitionName: `album-card-release-date-${album.id}`,
color: theme.text.secondary,
}}
>
<span style={{ viewTransitionName: `album-card-release-date-${album.id}` }}>
<span style={{ color: theme.accent.DEFAULT, fontWeight: 600 }}>Released: </span>
{new Date(album.releaseDate).toLocaleDateString("en-US", {
year: "numeric",
month: "long",
day: "numeric",
})}
</span>
</Text>
<Text size="md" style={{ color: theme.text.muted, lineHeight: 1.6 }}>
{album.description}