コピペOK!

Webコーディング帳

どくんどくん動くボタン

Button

HTML

            
<div class="btn anime-dokundokun">
  <span>Button</span>
</div>          
        

CSS

            
.anime-dokundokun {
  animation: dokundokun 1000ms ease infinite;
}
@keyframes dokundokun {
  0% {
    transform: scale(1);
  }
  20% {
    transform: scale(1.2);
  }
  40% {
    transform: scale(1);
  }
  70% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}
// ボタンのスタイル
.btn {
  background-color: #eb6100;
  width: 240px;
  height: 54px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  margin: 0 auto;
  box-shadow: 0px 4px 4px rgba($color: #000000, $alpha: .16);
  cursor: pointer;
  color: #fff;
}