body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: sans-serif;
  flex-direction: column;
}
.back {
  position: absolute;
  color: #fff;
  top: 10px;
  text-decoration: none;
  font-size: 25px;
  background: crimson;
  padding: 15px 15px;
  border-radius: 15px 20px;
  box-shadow: 2px 2px 8px #000;
}
.back:hover {
  transform: scale(0.9);
  transition: transform 1s;
}
.container {
  width: 30rem;
  height: 30rem;
  position: relative;
  overflow: hidden;
}

.container img {
  width: 100%;
  transition: all 1s;
}

.content {
  position: absolute;
  top: 0;
  left: 0;
  border: solid 1px;
  height: 100%;
  width: 100%;
  /* center the text */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #fff;
  transition: all 1s;
  background: rgb(23, 23, 23);
  transform: translatex(-100%);
}

.container:hover .content {
  transform: translatex(0);
}

.container:hover img {
  transform: translateX(100%);
}
