Enhance lyrics display: add transition effects, manage opacity, and improve styling for empty state

This commit is contained in:
2025-08-06 15:43:45 -04:00
parent d501272870
commit fbd342c6a7
2 changed files with 16 additions and 2 deletions

View File

@@ -239,11 +239,14 @@ body {
} }
.lrc-text { .lrc-text {
opacity: 1;
pointer-events: auto;
transition: opacity 0.3s ease;
max-height: 125px; /* limit block height */ max-height: 125px; /* limit block height */
max-width: 100%; max-width: 100%;
overflow-y: auto; /* scroll if lyrics exceed height */ overflow-y: auto; /* scroll if lyrics exceed height */
margin-top: 1rem; margin-top: 1rem;
padding: 0 1rem; padding: 0 1rem 1rem;
text-align: center; text-align: center;
font-family: "Mukta", sans-serif; font-family: "Mukta", sans-serif;
font-size: 0.85rem; font-size: 0.85rem;
@@ -256,6 +259,12 @@ body {
box-sizing: border-box; box-sizing: border-box;
scrollbar-width: thin; /* Firefox thinner scrollbar */ scrollbar-width: thin; /* Firefox thinner scrollbar */
scrollbar-color: #999 transparent; scrollbar-color: #999 transparent;
scroll-padding-bottom: 1rem;
}
.lrc-text.empty {
opacity: 0; /* fully transparent */
pointer-events: none; /* disable interaction */
} }
.lrc-text::-webkit-scrollbar { .lrc-text::-webkit-scrollbar {
@@ -296,3 +305,7 @@ body {
color: #4fa2ff; color: #4fa2ff;
text-decoration: dotted underline; text-decoration: dotted underline;
} }
.lrc-line:last-child {
margin-bottom: 0.5rem; /* or 0.75rem */
}

View File

@@ -273,7 +273,7 @@ export function Player() {
style={{ width: `${(elapsedTime / trackDuration) * 100}%` }} style={{ width: `${(elapsedTime / trackDuration) * 100}%` }}
/> />
</div> </div>
<div className="lrc-text"> <div className={`lrc-text ${lyrics.length === 0 ? 'empty' : ''}`}>
{lyrics.map((lyricObj, index) => ( {lyrics.map((lyricObj, index) => (
<p <p
key={index} key={index}
@@ -283,6 +283,7 @@ export function Player() {
</p> </p>
))} ))}
</div> </div>
<div className="music-control"> <div className="music-control">
<div <div
className="music-control__play" className="music-control__play"