JSFiddle - React, Tailwind, and code Playground

by levchenko_d

HTML

<button>
  <span class="handle-active-state-hide">😛</span>
  <span class="handle-active-state-show">😝</span>
</button>

CSS

button{
  position: relative;
  margin: 100px;
  width: 70px;
  height: 70px;
  background: none;
  text-align: center;
  line-height: 70px;
  font-size: 24px;
  border: none;
  z-index: 2;
  cursor: pointer;
}

button:before{
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  margin: auto;
  border-radius: 50%;
  background: #feb823;
  transition: 0.2s cubic-bezier(0, 0.41, 0, 1.15);
  transform: scale(0.5);
  z-index: -1;
}

button:focus{
  outline: none;
}
button:hover:before{
  transform: scale(0.7);
}

button:active:before{
   transform: scale(1);
   background: #e62ab2;
}

button:not(:active) .handle-active-state-show,
button:active .handle-active-state-hide{
  display: none;
}