Y
Y
Yarik2020-04-27 23:59:09
css
Yarik, 2020-04-27 23:59:09

Shift elements during animation?

When animating, the elements move all the time, I need the dimensions to change, but the distance between them does not.

.backdrop {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 30px;
  width: 50px;
  /*background: linear-gradient(45deg, #6200ea, #d500f9);*/
}

.loader {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dot {
  border-radius: 50%;
  background: white;
  margin: 2px;
  animation-name: loader;
  animation-duration: 0.45s;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.dot:nth-child(1) {
  animation-delay: 0.2s;

}
.dot:nth-child(2) {
  animation-delay: 0.4s;
}
.dot:nth-child(3) {
  animation-delay: 0.6s;
}


@keyframes loader {
  from {
    width: 6px;
    height: 6px;

  }
  to {
    width: 8px;
    height: 8px;
  
  }
}

<div class="backdrop2">
                            <div class="loader">
                                <div class="dot"></div>
                                <div class="dot"></div>
                                <div class="dot"></div>
                            </div>
                        </div>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question