.wraper {
  width: 400px;
  height: 400px;
  background-color: lightblue;
  position: relative;
  transition: all 3s;
}
.box {
  width: 150px;
  height: 150px;
  background-color: yellow;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  transition: all 5s;
}
.wraper:hover {
  background-color: lightgreen;
}
.box:hover {
  background-color: red;
  width: 250px;
  transform: translate(-50%, -50%) rotate(0deg);
}

/* car animation styles */
.car-image {
  height: 100px;
  position: absolute;
  animation: carmove 4s infinite ease-out 3s alternate;
  /* animation-direction: alternate; */
}
.image-wraper {
  position: relative;
  height: 150px;
}

@keyframes carmove {
  from {
    left: 0px;
  }
  to {
    left: 800px;
  }
}

/* new animation styles */
.image-new {
  height: 120px;
  animation: carnew 4s infinite alternate;
}

@keyframes carnew {
  from {
    transform: translateX(0px);
  }
  to {
    transform: translateX(600px);
  }
}

/* bg image styles */
.bg-image {
  background-image: url("../images/MainBefore.jpg");
  height: 500px;
  width: 100%;
  background-repeat: no-repeat;
  background-size: cover;
}
