Ховер эффект

by Denis Tverdokhlebov

HTML

<div class='badge'>
  <div class='text'>’Hallo!</div>
</div>

CSS

@import url(https://fonts.googleapis.com/css?family=Raleway:300);
html {
  height: 100%;
}
@media (max-width: 32rem) {
  html {
    font-size: 12px;
  }
}

body {
  background: linear-gradient(#333, #111);
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge {
  display: block;
  position: relative;
  width: 20rem;
  height: 20rem;
  cursor: pointer;
  background: url(https://source.unsplash.com/random/1000x1000) no-repeat 100% 50%;
  background-size: 120%;
  border-radius: 50%;
  transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
  box-shadow: 0px 0.5rem 1rem rgba(0, 0, 0, 0.75);
}
.badge:hover {
  box-shadow: 0px 0.5rem 2rem rgba(0, 0, 0, 0.75);
  background-position: 0% 50%;
}
.badge:hover .text {
  -webkit-transform: rotate(-45deg) translate(0px) rotate(-315deg);
          transform: rotate(-45deg) translate(0px) rotate(-315deg);
  background: rgba(102, 51, 153, 0.5);
  width: 20rem;
  letter-spacing: 1rem;
  line-height: 20rem;
  height: 20rem;
  margin-top: -10rem;
  margin-left: -10rem;
  transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1), letter-spacing 1.5s ease-out;
}
.badge .text {
  display: block;
  position: absolute;
  width: 10rem;
  height: 10rem;
  line-height: 10rem;
  left: 50%;
  top: 50%;
  margin-top: -5rem;
  margin-left: -5rem;
  font-size: 2rem;
  font-family: Raleway, sans-serif;
  text-align: center;
  color: #fff;
  border-radius: 50%;
  background: rebeccapurple;
  -webkit-transform: rotate(-180deg) translate(-10rem) rotate(180deg);
          transform: rotate(-180deg) translate(-10rem) rotate(180deg);
  box-shadow: 0px 0.5rem 1rem rgba(0, 0, 0, 0.5);
  transition: all 0.5s cubic-bezier(0.55, 0, 0.1, 1);
}