mirror of
https://github.com/M4X809/list-of-lp.git
synced 2025-12-25 11: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}
|
||||
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={{ color: theme.accent.DEFAULT, fontWeight: 600 }}>Released: </span>
|
||||
{new Date(releaseDate).toLocaleDateString("en-US", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
})}
|
||||
<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">
|
||||
|
|
|
|||
|
|
@ -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={{ color: theme.accent.DEFAULT, fontWeight: 600 }}>Released: </span>
|
||||
{new Date(album.releaseDate).toLocaleDateString("en-US", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
})}
|
||||
<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}
|
||||
|
|
|
|||
Loading…
Reference in a new issue