【问题标题】:I want to reduce the speed of animation我想降低动画的速度
【发布时间】:2017-12-01 19:53:42
【问题描述】:

这是我为简单 div 设置动画的代码。但问题是,当 X 增长到全尺寸时,我想放慢速度,因为你可以看到它突然闪烁和缩小。

谁能帮帮我。

html {
  background: black;
  overflow: hidden;
  height: 100%;
}

.loader {
  height: 40px;
  width: 40px;
  position: absolute;
  left: 50%;
  margin-left: -20px;
  top: 50%;
  margin-top: -20px;
}

.loader:before,
.loader:after {
  content: "";
  height: 40px;
  width: 40px;
  border: 8px solid black;
  border-radius: 10px;
  position: absolute;
  top: 0;
  background-color: red;
}

.loader:before {
  animation: animate 5s infinite ease-in-out;
}

.loader:after {
  animation: animate2 5s infinite ease-in-out;
}

@keyframes animate {
  100% {
    transform: rotate(180deg) skew(360deg);
  }
}

@keyframes animate2 {
  100% {
    transform: rotate(-180deg) skew(-360deg);
  }
}
<div class="loader">
</div>

【问题讨论】:

    标签: html css css-animations keyframe


    【解决方案1】:

    试着在最后减慢动画速度

        animation: animate 5s infinite ease-out;
    

    【讨论】:

    • 没有缓出会在 x 最后第二次缩小时变慢
    猜你喜欢
    • 2020-09-23
    • 1970-01-01
    • 1970-01-01
    • 2015-07-28
    • 2011-09-17
    • 1970-01-01
    • 2022-08-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多