mirror of
https://github.com/M4X809/list-of-lp.git
synced 2025-12-25 19:12:48 +00:00
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:
parent
6024cdc442
commit
64cf136850
2 changed files with 18 additions and 18 deletions
|
|
@ -72,26 +72,26 @@ export default function AlbumCard({ album }: { album: Album }) {
|
||||||
fw={700}
|
fw={700}
|
||||||
className="transition-colors"
|
className="transition-colors"
|
||||||
style={{
|
style={{
|
||||||
viewTransitionName: `album-card-title-${album.id}`,
|
|
||||||
color: theme.text.primary,
|
color: theme.text.primary,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{label}
|
<span style={{ viewTransitionName: `album-card-title-${album.id}` }}>{label}</span>
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Text
|
<Text
|
||||||
size="sm"
|
size="sm"
|
||||||
style={{
|
style={{
|
||||||
viewTransitionName: `album-card-release-date-${album.id}`,
|
|
||||||
color: theme.text.secondary,
|
color: theme.text.secondary,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<span style={{ viewTransitionName: `album-card-release-date-${album.id}` }}>
|
||||||
<span style={{ color: theme.accent.DEFAULT, fontWeight: 600 }}>Released: </span>
|
<span style={{ color: theme.accent.DEFAULT, fontWeight: 600 }}>Released: </span>
|
||||||
{new Date(releaseDate).toLocaleDateString("en-US", {
|
{new Date(releaseDate).toLocaleDateString("en-US", {
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
month: "long",
|
month: "long",
|
||||||
day: "numeric",
|
day: "numeric",
|
||||||
})}
|
})}
|
||||||
|
</span>
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Group gap="xs">
|
<Group gap="xs">
|
||||||
|
|
|
||||||
|
|
@ -79,27 +79,27 @@ export default async function AlbumDetail({ params }: { params: Promise<{ albumI
|
||||||
order={1}
|
order={1}
|
||||||
className="mb-3 text-6xl font-bold"
|
className="mb-3 text-6xl font-bold"
|
||||||
style={{
|
style={{
|
||||||
viewTransitionName: `album-card-title-${album.id}`,
|
|
||||||
color: theme.text.primary,
|
color: theme.text.primary,
|
||||||
textShadow: `0 0 20px ${theme.primary.DEFAULT}80`,
|
textShadow: `0 0 20px ${theme.primary.DEFAULT}80`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{album.label}
|
<span style={{ viewTransitionName: `album-card-title-${album.id}` }}>{album.label}</span>
|
||||||
</Title>
|
</Title>
|
||||||
<Text
|
<Text
|
||||||
size="xl"
|
size="xl"
|
||||||
className="mb-4"
|
className="mb-4"
|
||||||
style={{
|
style={{
|
||||||
viewTransitionName: `album-card-release-date-${album.id}`,
|
|
||||||
color: theme.text.secondary,
|
color: theme.text.secondary,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
<span style={{ viewTransitionName: `album-card-release-date-${album.id}` }}>
|
||||||
<span style={{ color: theme.accent.DEFAULT, fontWeight: 600 }}>Released: </span>
|
<span style={{ color: theme.accent.DEFAULT, fontWeight: 600 }}>Released: </span>
|
||||||
{new Date(album.releaseDate).toLocaleDateString("en-US", {
|
{new Date(album.releaseDate).toLocaleDateString("en-US", {
|
||||||
year: "numeric",
|
year: "numeric",
|
||||||
month: "long",
|
month: "long",
|
||||||
day: "numeric",
|
day: "numeric",
|
||||||
})}
|
})}
|
||||||
|
</span>
|
||||||
</Text>
|
</Text>
|
||||||
<Text size="md" style={{ color: theme.text.muted, lineHeight: 1.6 }}>
|
<Text size="md" style={{ color: theme.text.muted, lineHeight: 1.6 }}>
|
||||||
{album.description}
|
{album.description}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue