CSSアニメーション点滅サンプル

foo

foo2

bar

bar2

/* CSSアニメーションで1秒間隔で点滅 */
.foo {
  animation: foo 2s infinite;
}
.foo2 {
  animation: foo2 1s infinite alternate;
}
.bar {
  animation: bar 2s infinite;
}
.bar2 {
  animation: bar 1s infinite alternate;
}
@keyframes foo {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  50.01% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes foo2 {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  50.01% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes bar {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1);
  }
  50.01% {
    transform: scale(0);
  }
  100% {
    transform: scale(0);
  }
}
@keyframes bar2 {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1);
  }
  50.01% {
    transform: scale(0);
  }
  100% {
    transform: scale(0);
  }
}