<div class="p-anima-10 __anima" id="js-anima-10">
        <div class="p-anima-10__content">
          <div class="p-mv">
            <div class="p-mv__title">The best of <br>both worlds</div>
          </div>
        </div>
      </div>

<button type="button" data-reload="js-anima-10" id="js-reload">リロード</button>
.p-anima-10 {
  position: relative;
  overflow: hidden;
}
.p-anima-10::before {
  content: "";
  display: block;
  background-color: #333;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}
.p-anima-10.__anima::before {
  animation: anima_musk_10 0.5s cubic-bezier(0.46, 0.26, 0.15, 0.89) 1 forwards;
}

.p-anima-10__content {
  transform: scale(1.2);
}
.p-anima-10.__anima .p-anima-10__content {
  animation: anima_scale_10 0.9s cubic-bezier(0.46, 0.26, 0.15, 0.89) 1 forwards;
}

@keyframes anima_scale_10 {
  0% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes anima_musk_10 {
  0% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}


/* アニメーションとは関係のないスタイル(ボタンの見た目など) */
body {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-direction: column;
	height: 100vh;
}
button {
	margin-top: 40px;
}
.p-mv {
  display: flex;
	align-items: center;
  background-image: url("https://picsum.photos/900/600");
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: cover;
  padding: 40px;
	width: 600px;
  height: 200px;
  position: relative;
}

@media screen and (max-width: 640px) {
  .p-mv {
    width: 100%;
  }
}
.p-mv::before {
  content: "";
  display: block;
  background-color: rgba(51, 51, 51, 0.5);
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.p-mv__title {
  color: #fff;
  font-size: 56px;
  font-weight: bold;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}
@media screen and (max-width: 640px) {
  .p-mv__title {
    font-size: 24px;
  }
}
document.querySelector('#js-reload').addEventListener('click', (_ev) => {
	const target = _ev.target.getAttribute('data-reload');
	document.querySelector(`#${target}`).classList.remove('__anima');
	setTimeout(() => {
		document.querySelector(`#${target}`).classList.add('__anima');
	}, 500);
});
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.