【CSS】How to restore the original state while animating the background image tilted up when accessing the page/Animate the background image from the tilted state when accessing the page(Demo page)

※Please check using Developer tools

Sponsored links

CSS

body {
  overflow-x: hidden;
}

.block {
  width: 100%;
  height: 100vh;
  opacity: 0;
  text-align: center;
  transform: rotate(10deg) scale(1.3);
  transform-origin: center center;
  background: url(/img/w03.jpg) no-repeat center;
  background-size: cover;
}

.active.block {
  opacity: 1;
  transition: opacity 1.4s,transform 1s cubic-bezier(.52,.01,.09,1);
  transition-delay: .2s;
  transform: scale(1) rotate(0);
}

@media screen and (max-width:640px){
  .block {
    height: 40vh;
  }
}

JavaScript

$(window).on('load', function(){
  $(".block").addClass("active");
});