I'm currently developing an intro animation for a website, where the children are supposed to slide up from the bottom (margin-top: 80px). The container is set with a fixed height and overflow:hidden to create a smooth appearance.
Each child has a transition-delay applied to show them one after another, but unfortunately, all the elements are appearing together.
If anyone could provide assistance with this code, it would be greatly appreciated.
setTimeout(function() {
$('.anim_line').addClass('show');
}, 1400);
.container {
height: 100%;
width: 100%;
background: #121212;
}
.anim_container {
margin: 80px;
}
.anim_inner_container {
position: relative;
background-color: hsla(260, 91%, 84%, 1);
background-image:
radial-gradient(at 67% 61%, hsla(250, 67%, 53%, 1) 0px, transparent 40%),
radial-gradient(at 34% -33%, hsla(249, 67%, 53%, 1) 0px, transparent 40%),
radial-gradient(at 44% -15%, hsla(249, 67%, 53%, 1) 0px, transparent 40%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-family: 'Calibri';
font-size: 64px;
line-height: 96px;
}
.anim_line {
height: 96px;
width: 100%;
overflow: hidden;
text-overflow: clip;
}
.anim_word {
display: inline-block;
margin-top: 100%;
transition: all 1.15s cubic-bezier(0.62, 0.05, 0.01, 0.99) 0s;
-webkit-transition: all 1.15s cubic-bezier(0.62, 0.05, 0.01, 0.99) 0s;
-moz-transition: all 1.15s cubic-bezier(0.62, 0.05, 0.01, 0.99) 0s;
-ms-transition: all 1.15s cubic-bezier(0.62, 0.05, 0.01, 0.99) 0s;
-o-transition: all 1.15s cubic-bezier(0.62, 0.05, 0.01, 0.99) 0s;
}
.anim_word span {}
.anim_line.show .anim_word {
margin-top: 0%;
}
.anim_line:nth-child(1) .anim_word:nth-child(2) {
transition-delay: .15s;
-webkit-transition-delay: .15s;
}
.anim_line:nth-child(1) .anim_word:nth-child(3) {
transition-delay: .25s;
-webkit-transition-delay: .25s;
}
.anim_line:nth-child(1) .anim_word:nth-child(4) {
transition-delay: .35s;
-webkit-transition-delay: .35s;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<div class="container">
<div class="anim_container">
<div class="anim_inner_container">
<div class="anim_line">
<div class="anim_word">A</div>
<div class="anim_word">product</div>
<div class="anim_word">designer</div>
<div class="anim_word">helping</div>
</div>
<div class="anim_line">
<div class="anim_word">design</div>
<div class="anim_word">beautiful,</div>
<div class="anim_word"> user</div>
<div class="anim_word">centered</div>
</div>
<div class="anim_line">
<div class="anim_word">products</div>
</div>
</div>
</div>
</div>
I've experimented with various display properties for the children, but haven't had any success so far.