fix: resolve progressbar issues

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2346>
This commit is contained in:
Kasper Seweryn 2023-03-03 09:52:03 +01:00 committed by Marge
parent 8ce20c5621
commit 47b3bfd2c0
4 changed files with 16 additions and 30 deletions

View File

@ -346,39 +346,16 @@ if (!isWebGLSupported) {
</button>
</div>
<div class="progress-wrapper">
<div
v-if="currentTrack && !errored"
class="progress-area"
>
<div class="progress-area">
<div
ref="progressBar"
:class="['ui', 'small', 'vibrant', {'indicating': isLoadingAudio}, 'progress']"
:class="['ui', 'small', 'vibrant', {'indicating': isLoadingAudio && !errored}, 'progress']"
@click="touchProgress"
>
<div
class="buffer bar"
:style="{ 'transform': `translateX(${bufferProgress - 100}%)` }"
/>
<div
class="position bar"
:style="{
animationDuration: duration + 's',
animationPlayState: isPlaying
? 'running'
: 'paused'
}"
/>
</div>
</div>
<div
v-else
class="progress-area"
>
<div
ref="progress"
:class="['ui', 'small', 'vibrant', 'progress']"
>
<div class="buffer bar" />
<div class="position bar" />
</div>
</div>

View File

@ -146,9 +146,7 @@ const hideArtist = () => {
class="buffer bar"
:style="{ 'transform': `translateX(${bufferProgress - 100}%)` }"
/>
<div
class="position bar"
/>
<div class="position bar" />
<div
class="seek bar"
:style="{ 'transform': `translateX(${x / screenWidth * 100 - 100}%)` }"

View File

@ -48,7 +48,6 @@
.ui.progress .bar {
transition: none;
width: 100%;
transform: translateX(calc(var(--fw-track-progress) - 100%));
transform-origin: top left;
will-change: transform;
position: absolute;
@ -59,6 +58,10 @@
transition: opacity .2s ease;
mix-blend-mode: overlay;
}
&.position {
transform: translate3d(calc(var(--fw-track-progress) - 100%), 0, 0);
}
}
.ui.progress:hover .bar.seek {
opacity: 0.4;

View File

@ -160,10 +160,14 @@
.ui.progress .bar {
transition: none;
width: 100%;
transform: translateX(calc(var(--fw-track-progress) - 100%));
transform-origin: top left;
will-change: transform;
&.position {
transform: translate3d(calc(var(--fw-track-progress) - 100%), 0, 0);
}
}
.ui.progress .buffer.bar {
position: absolute;
background-color: rgba(255, 255, 255, 0.15);
@ -189,6 +193,10 @@
animation-duration: 2s;
animation-timing-function: linear;
animation-iteration-count: infinite;
&:not(.buffer) {
background: transparent !important;
}
}
.ui.progress {
margin: 0.5rem 0;