Анимация css кнопки

введите сюда описание изображения

Как сделать анимацию этих кругов, чтобы от ширины кнопки расширялись до размеров на картинке?


Ответы (1 шт):

Автор решения: ᅠhᅠ

body {
  display: flex;
  align-items: center;
  justify-content: center;
  
  height: 100vh;
  margin: 0;
}

div {
  position: relative;
  
  width: min(calc(9vw + 9vh), 130px);
  height: min(calc(9vw + 9vh), 130px);
  
  display: flex;
  align-items: center;
  justify-content: center;
}

div::after,
div::before {
  content: '';
  position: absolute;
  
  width: inherit;
  height: inherit;
  
  border: 1px solid rgba(0,0,0, 0.4);
  border-radius: 50%;
  
  animation: waves 2s both linear infinite;
}

div::after {
  animation-delay: 1s;
}

button {
  width: inherit;
  height: inherit;
  
  border-radius: 50%;
  background: black;
  color: white;
  border: none;
  outline: none;
  cursor: pointer;
  
  transition: 0.2s;
  
  z-index: 1;
}

button:active {
  transform: scale(0.9);
}

div:hover::after,
div:hover::before {
  display: none;
}

@keyframes waves {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  
  40% {
    opacity: 0.8;
  }
  
  to {
    opacity: 0;
    transform: scale(2.5);
  }
}
<div>
  <button>Hypno Button</button>
</div>

→ Ссылка