Skip to content

[Help]: Is there an action/store that I can use to track the duration of a slide with the AutoPlay Plugin? #745

Closed Answered by SergkeiM
shyakadavis asked this question in Help
Discussion options

You must be logged in to vote

Hi @shyakadavis

I think you can achive this with CSS only:

Just change --delay to your delay in Embla

If delay is dynamic you can set it directly on the element: <div class="pills" style="--delay: ${MyDelayVar}s">

<div class="pills">
  <div class="pill">
    <div class="in active"></div>
  </div>
  <div class="pill">
    <div class="in"></div>
  </div>
  <div class="pill">
    <div class="in"></div>
  </div>
</div>
:root{
  --delay: 7s
}
.pills{
  display: flex;
}
.pill {
    border-radius: 6px;
    height: 10px;
    width: 30px;
    background-color: black;
    margin: 0 3px;
    overflow: hidden;
  
    .in.active {
        animation: fill var(--delay) linear 1;
        height: 100%;
  …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@shyakadavis
Comment options

@davidjerleke
Comment options

Answer selected by shyakadavis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
resolved This issue is resolved question Question about how to achieve something svelte Issue is related to Svelte
3 participants