JSFiddle - React, Tailwind, and code Playground
by Ben Clayton
HTML
<div class="fifth">
<div class="third">
<div class="first"></div>
<div class="second"></div>
</div>
<div class="fourth">S Helen's<div class="sixth"></div></div>
</div>
CSS
body {
background-color: #000;
transition: all 1s ease-in;
opacity: 1;
}
body.fade {
opacity: 0;
}
.first {
position: absolute;
display: block;
width: 10px;
height: 0px;
background-color: white;
border-radius: 5px;
transition: all 400ms ease-in;
top: 20px;
left: 300px;
}
.first.start {
height: 200px;
}
.first.mid {
width:30px;
left: 95px;
}
.second {
position: absolute;
display: block;
width: 0px;
height: 10px;
background-color: white;
border-radius: 5px;
transition: all 200ms ease-in;
top: 50px;
left: 260px;
}
.second.start {
width: 90px;
}
.second.mid {
height: 30px;
left: 65px;
}
.third {
display: block;
width: 200px;
height: 200px;
position: absolute;
transition: all 300ms ease-in;
transform: scale(1) translateY(0px);
}
.third.start {
transform: scale(0.35) translateY(175px);
}
.fourth {
color:white;
font-size: 7rem;
display: block;
top:100px;
left:30px;
width: 600px;
height: 200px;
position: absolute;
transition: all 300ms ease-in;
transform-origin: 20% 100%;
transform: rotate3d(0, 1, 0, -90deg);
}
.fourth > span {
font-size:4rem;
}
.fourth.start {
transform: rotate3d(0, 1, 0, 0deg);
}
.fifth {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
transform: scale(1) translate(0, 0);
transition: transform 500ms ease;
}
.fifth.start {
transform: scale(0.4) translate(0, 150px);
}
.sixth {
display: inline-block;
background-color: white;
width: 10px;
height: 10px;
border-radius: 50%;
transform: scale(1) translate(0, 0);
transition: all 500ms ease;
}
.sixth.start {
transform: scale(50) translate(-5px, -7px);
}
JavaScript
function next(step) {
var d;
switch (step) {
case 1:
d = 2000;
break;
case 2:
$('.first').addClass('start');
d = 400;
break;
case 3:
$('.second').addClass('start');
d = 600;
break;
case 4:
$('.first').addClass('mid');
$('.second').addClass('mid');
$('.third').addClass('start');
d = 300;
break;
case 5:
$('.fourth').addClass('start');
d = 400;
break;
case 6:
$('.fifth').addClass('start');
d = 200;
break;
case 7:
$('.sixth').addClass('start');
d = 1000;
break;
case 8:
$('body').addClass("fade");
d = 0;
break;
}
if (d) setTimeout(function() {
next(step + 1)
}, d);
}
next(1);