I'm trying to create a little intro animation for a website. I want it to smoothly transition to a white BW logo after the animation plays out.
What i'm struggling with is once the full word is removed, I want the B and W letters to come slide together to form a small BW after the rest of the word fades out. right now I can't seem to get the container to shrink down smoothly and force the BW right next to eachother.
I have a codepen started for reference. https://codepen.io/patstantpen/pen/eYExopN
$(document).ready(function () {
$(".title").click(function () {
$(".letter").css("color", "white");
setTimeout(function () {
$(".reak, .orld").css("opacity", "0");
}, 1400);
});
});
* {
font-family: "Montserrat";
font-weight: bold;
font-size: 35px;
height: 100%;
}
body {
text-align: Center;
height: 100%;
background-color: #f7a21b;
}
.wrapper {
display: flex;
justify-content: center;
height: 100%;
}
.title {
height: 100px;
align-self: center;
color: #a71e29;
height: 50px;
transition: width 1.4s ease;
}
.letter {
transition: color 1.4s ease;
}
.reak,
.orld {
transition: opacity 1.4s ease;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,400i,700">
<body>
<div class='wrapper'>
<div class='title'>
<span class='letter'>B</span><span class='reak'>REAKFAST</span> <span class='letter'>W</span><span class='orld'>ORLDWIDE</span>
</div>
</div>
</body>
I guess another more broad question is would this be better made as a mp4 or gif and played instead of doing it with js?