Update track progress bars with css transitions

1381-progress-bars
Georg Krause 2021-09-20 11:08:31 +02:00
rodzic e9de6863c8
commit 9bef230499
5 zmienionych plików z 9 dodań i 4 usunięć

Wyświetl plik

@ -57,7 +57,7 @@
:class="['ui', 'small', 'vibrant', {'indicating': isLoadingAudio}, 'progress']"
@click="touchProgress">
<div class="buffer bar" :data-percent="bufferProgress" :style="{ 'width': bufferProgress + '%' }"></div>
<div class="position bar" :data-percent="progress" :style="{ 'width': progress + '%' }"></div>
<div class="position bar" :data-percent="progress" :style="{ 'transform': 'scale(' + progress + ', 1)' }"></div>
</div>
</div>
<div class="progress-area" v-else>

Wyświetl plik

@ -7,7 +7,7 @@
<div
:class="['ui', 'top attached', 'small', 'inverted', {'indicating': isLoadingAudio}, 'progress']">
<div class="buffer bar" :data-percent="bufferProgress" :style="{ 'width': bufferProgress + '%' }"></div>
<div class="position bar" :data-percent="progress" :style="{ 'width': progress + '%' }"></div>
<div class="position bar" :data-percent="progress" :style="{ 'transform': 'scale(' + progress + ', 1)' }"></div>
</div>
<div class="controls-row">

Wyświetl plik

@ -88,7 +88,7 @@ export default {
return time.parse(Math.round(state.currentTime))
},
progress: state => {
return Math.round((state.currentTime / state.duration * 100) * 10) / 10
return state.currentTime / state.duration
}
},
actions: {

Wyświetl plik

@ -75,7 +75,9 @@
.ui.progress:not([data-percent]):not(.indeterminate)
.bar.position:not(.buffer) {
background: var(--vibrant-color);
min-width: 0;
width: 100%;
transition: transform 1.1s linear 0s;
transform-origin: left center 0px;
}
.track-controls {

Wyświetl plik

@ -174,6 +174,9 @@
.ui.progress:not([data-percent]):not(.indeterminate)
.bar.position:not(.buffer) {
background: var(--vibrant-color);
width: 100%;
transition: transform 1.1s linear 0s;
transform-origin: left center 0px;
}
.indicating.progress .bar {