L oop анимация для css - PullRequest
1 голос
/ 26 мая 2020

Пожалуйста, как мне получить приведенную ниже анимацию для продолжения цикла без javascript, только CSS и HTML. Так что, когда он дойдет до 7, все начнется снова с единицы и будет продолжаться до тех пор, пока страница не будет закрыта. Я занимаюсь этим более 3 часов. Буду признателен, если кто-нибудь сможет помочь мне в этом.

Заранее спасибо.

.merry {
  font-family: "Georgia", serif;
  font-style: italic;
  font-size: 18px;
  text-align: center;
}

.merry-text {
  left: 0;
  margin-bottom: 0;
  margin-top: 50px;
  opacity: 0;
  position: absolute;
  right: 0;
  text-align: center;
  top: 0;
}

.merry-text:nth-of-type(1) {
  animation-name: rotate;
  animation-duration: 2.5s;
  animation-delay: 1s;

}

.merry-text:nth-of-type(2) {
  animation-name: rotate;
  animation-duration: 2.5s;
  animation-delay: 3s;

}

.merry-text:nth-of-type(3) {
  animation-name: rotate;
  animation-duration: 2.5s;
  animation-delay: 5s;

}
.merry-text:nth-of-type(4) {
  animation-name: rotate;
  animation-duration: 2.5s;
  animation-delay: 7s;
  animation-fill-mode: forwards;
}
.merry-text:nth-of-type(5) {
  animation-name: rotate;
  animation-duration: 2.5s;
  animation-delay: 9s;
}
.merry-text:nth-of-type(6) {
  animation-name: rotate;
  animation-duration: 2.5s;
  animation-delay: 11s;
}
.merry-text:nth-of-type(7) {
  animation-name: rotate;
  animation-duration: 2.5s;
  animation-delay: 13s;
}
@keyframes rotate {
  0% {
    opacity: 0;
    transform: translate3d(0, 50px, 0);
  }
  
  20%, 80% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  
  100% {
    opacity: 0;
    transform: translate3d(0, -25px, 0);
  }
}
<p class="merry">
  <span class="merry-text">circle 1</span>
  <span class="merry-text">circle 2</span>
  <span class="merry-text">circle 3 </span>
    <span class="merry-text">circle 4</span>
    <span class="merry-text">circle 5</span>
    <span class="merry-text">circle 6</span>  
<span class="merry-text">circle 7</span>
</p>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...