小编zub*_*rha的帖子

当球经过时如何使戒指/篮筐翻转?

我正在尝试做这样的事情:

穿过铁环的球的动画

但是球似乎并没有通过环,而是越过了环。如何解决此问题?

body {
  height: 50em;
}

.ring {
  position: relative;
  width: 200px;
  height: 100px;
  border-radius: 50%;
  border: 10px solid #ffcf82;
  z-index: 9
}

@keyframes spinner {
  0% {
    transform: rotateZ(0deg);
  }
  30% {
    transform: rotateZ(0deg);
  }
  60% {
    transform: rotateZ(180deg);
  }
}

@keyframes translate {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-370px);
  }
}

.ring {
  animation-name: spinner;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-duration: 5s;
  transform-style: preserve-3d;
}

.ball {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #14e78e; …
Run Code Online (Sandbox Code Playgroud)

html css css3 css-transforms css-animations

15
推荐指数
2
解决办法
1060
查看次数

标签 统计

css ×1

css-animations ×1

css-transforms ×1

css3 ×1

html ×1