#31 : Update progress position

This commit is contained in:
Vadim
2021-07-03 00:13:24 +03:00
parent 5f2a4c2d56
commit 6dee586639
2 changed files with 20 additions and 17 deletions

View File

@@ -268,7 +268,6 @@
_duration = 0 _duration = 0
} }
function handleThreshold(event) { function handleThreshold(event) {
// TODO: is it correct?
directionFnDescription[event.detail.direction]() directionFnDescription[event.detail.direction]()
} }
function handleSwipeMove(event) { function handleSwipeMove(event) {
@@ -317,6 +316,11 @@
> >
<slot {loaded}></slot> <slot {loaded}></slot>
</div> </div>
{#if autoplayProgressVisible}
<div class="sc-carousel-progress__container">
<Progress value={progressValue} />
</div>
{/if}
</div> </div>
{#if arrows} {#if arrows}
<slot name="next" {showNextPage}> <slot name="next" {showNextPage}>
@@ -344,8 +348,6 @@
></Dots> ></Dots>
</slot> </slot>
{/if} {/if}
{progressValue}
<Progress value={progressValue} />
</div> </div>
<style> <style>
@@ -365,6 +367,7 @@
display: flex; display: flex;
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
position: relative;
} }
.sc-carousel__pages-container { .sc-carousel__pages-container {
width: 100%; width: 100%;
@@ -378,4 +381,11 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.sc-carousel-progress__container {
width: 100%;
height: 7px;
background-color: lightgray;
position: absolute;
bottom: 0;
}
</style> </style>

View File

@@ -12,21 +12,14 @@
$: width = Math.min(value * MAX_PERCENT, MAX_PERCENT) $: width = Math.min(value * MAX_PERCENT, MAX_PERCENT)
</script> </script>
<div class="sc-carousel-progress__container"> <div
<div
class="sc-carousel-progress__indicator" class="sc-carousel-progress__indicator"
style=" style="
width: {width}%; width: {width}%;
" "
></div> ></div>
</div>
<style> <style>
.sc-carousel-progress__container {
width: 100%;
height: 20px;
background-color: lightgray;
}
.sc-carousel-progress__indicator { .sc-carousel-progress__indicator {
height: 100%; height: 100%;
background-color: gray; background-color: gray;