body {
  margin: 0;
  padding: 0;
}

.box-1 {
  grid-area: box-1;
}

.box-2 {
  grid-area: box-2;
}

.box-3 {
  grid-area: box-3;
}

.box-4 {
  grid-area: box-4;
}

.box-5 {
  grid-area: box-5;
}

.box-6 {
  grid-area: box-6;
}

.box-7 {
  grid-area: box-7;
}

.box-8 {
  grid-area: box-8;
}

.box-9 {
  grid-area: box-9;
}

.box-10 {
  grid-area: box-10;
}

.box-11 {
  grid-area: box-11;
}

.box-12 {
  grid-area: box-12;
}

.grid-container {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  width: 50px;
  margin: auto;
  grid-template-rows: auto;
  grid-template-areas: "box-1" "box-2" "box-3" "box-4" "box-5" "box-6" "box-7" "box-8" "box-9" "box-10" "box-11" "box-12"
}

.box {
  border: 3px solid pink;
  background: linear-gradient(160deg, #00f6ff, #89dfdc, #b4c7ba, #d0ae99, #e29379, #f0765a, #f9513b, #ff001b);
  border-radius: 4px;
  box-shadow: 0 7px 8px 0;
  min-height: 50px;
  width: 50px;
  transition: 3s;
}

.grid-container:hover>.box:nth-of-type(odd) {
  transform: scale(2) translate(280px) rotate(180deg);
  transition: 3s;
}

.grid-container:hover>.box:nth-of-type(even) {
  transform: scale(0.5) translate(-800px) rotate(-180deg);
  transition: 1s;
}