※Please check using Developer tools
.block {
position: relative;
margin: 50px auto 0;
}
.block:before {
content: '';
position: absolute;
right: 0;
bottom: 0;
display: block;
width: 100%;
height: 300px;
transform: translateX(-100%);
transition: transform 1s ease-out;
background: #efefef;
}
.active.block:before {
transform: translateX(0);
}
.img {
position: relative;
width: 600px;
line-height: 0;
margin: 0 auto;
z-index: 1;
}
@media screen and (max-width:640px){
.block {
width: 100%;
}
.block:before {
height: 150px;
}
.img {
width: 80%;
}
}
$(window).on('load', function(){
$(".block").addClass("active");
});