Notification Update Bell Animation

by Andrew Holloway

HTML

<main><div class="badge is-visible">8</div></main>

CSS

html, body {
  height: 100%;
}

main {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  background-color: #fc627a;
  color: #fc627a;
  text-align: center;
  font-family: 'Verdana', sans-serif;
  
  font-size: 11px;
  line-height: 16px;
  border-radius: 16px;
  padding: 2px;
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.3);
  
  transform: scale(0);
}

.is-visible {
  animation-name: reveal_badge;
  animation-duration: 1.2s;
  animation-timing-function: ease-out;
  animation-delay: 0s;
  animation-iteration-count: 1;
  animation-fill-mode: forwards;
}

@keyframes reveal_badge {
  0% {
    transform: scale(0);
    color: #fc627a;
  }
  
  20% {
    transform: scale(1.25);
  }
  
  45% {
    transform: scale(0.9);


  }

  65% {
    transform: scale(1);
    color: #fc627a;
  }
  
  100% {
    color: white;
    transform: scale(1);
  }
}