perf(lyrics): GPU-accelerated underline animation
Replace expensive properties with GPU-accelerated ones: - transform: scaleX() instead of width (no layout recalc) - Solid color instead of gradient - Removed box-shadow blur (very expensive) - Added will-change: transform hint This runs entirely on GPU compositor thread.
This commit is contained in:
1 parent
06469aeaa3
commit
dbd706fc64
1 file changed
+11
-17
@@ -282,7 +282,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* CSS-only karaoke animation in immersive mode */
|
/* CSS-only karaoke animation in immersive mode */
|
||||||
/* Glowing underline that sweeps left to right - keeps text bright white */
|
/* GPU-accelerated underline using transform instead of width */
|
||||||
.lyrics-lines.immersive .lyrics-line.active .line-text {
|
.lyrics-lines.immersive .lyrics-line.active .line-text {
|
||||||
--duration: var(--line-duration, 3000ms);
|
--duration: var(--line-duration, 3000ms);
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -290,36 +290,30 @@
|
|||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Glowing underline that sweeps left to right */
|
/* Underline using scaleX transform (GPU accelerated, no layout recalc) */
|
||||||
.lyrics-lines.immersive .lyrics-line.active .line-text::after {
|
.lyrics-lines.immersive .lyrics-line.active .line-text::after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -2px;
|
bottom: -2px;
|
||||||
left: 0;
|
left: 0;
|
||||||
height: 3px;
|
height: 3px;
|
||||||
width: 0%;
|
width: 100%;
|
||||||
/* QBZ blue gradient */
|
/* QBZ blue - solid color, no gradient */
|
||||||
background: linear-gradient(
|
background: #5281ff;
|
||||||
90deg,
|
|
||||||
transparent 0%,
|
|
||||||
#5281ff 20%,
|
|
||||||
#7ba3ff 50%,
|
|
||||||
#5281ff 80%,
|
|
||||||
transparent 100%
|
|
||||||
);
|
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
box-shadow:
|
/* GPU accelerated properties only */
|
||||||
0 0 8px #5281ff,
|
transform: scaleX(0);
|
||||||
0 0 16px rgba(82, 129, 255, 0.5);
|
transform-origin: left center;
|
||||||
|
will-change: transform;
|
||||||
animation: karaoke-underline var(--duration) linear forwards;
|
animation: karaoke-underline var(--duration) linear forwards;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes karaoke-underline {
|
@keyframes karaoke-underline {
|
||||||
0% {
|
0% {
|
||||||
width: 0%;
|
transform: scaleX(0);
|
||||||
}
|
}
|
||||||
100% {
|
100% {
|
||||||
width: 100%;
|
transform: scaleX(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user