fix glitchy song title animation
This commit is contained in:
+23
-10
@@ -2,16 +2,6 @@
|
||||
|
||||
@theme {
|
||||
--breakpoint-xs: 400px;
|
||||
--animate-scroll-left: scroll-left 10s linear infinite;
|
||||
|
||||
@keyframes scroll-left {
|
||||
0% {
|
||||
transform: translateX(50%);
|
||||
}
|
||||
100% {
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
@@ -29,3 +19,26 @@ body {
|
||||
border-radius: var(--radius-lg);
|
||||
}
|
||||
}
|
||||
|
||||
.marquee {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.marquee-content {
|
||||
display: inline-block;
|
||||
animation: scroll 10s linear infinite;
|
||||
}
|
||||
|
||||
.marquee-content span {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@keyframes scroll {
|
||||
0% {
|
||||
transform: translateX(0);
|
||||
}
|
||||
100% {
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
@@ -32,9 +32,10 @@ export default function MusicComponent() {
|
||||
<div className="flex align-middle">
|
||||
<img width="50" src={music.images[1]?.url} />
|
||||
<div className="pl-2 max-w-25">
|
||||
<div className="overflow-hidden whitespace-nowrap">
|
||||
<div className="inline-block animate-scroll-left">
|
||||
<p>{music.title}</p>
|
||||
<div className="marquee">
|
||||
<div className="marquee-content">
|
||||
<span>{music.title} </span>
|
||||
<span>{music.title} </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user