I'm still really new to HTML and CSS so a lot of my code is bad. I need help figuring out how to combine the two animations that I have created. I would like for the first animation (which is currently on the top) to play out completely and then after about 3 seconds the second animation where it scrolls to the left slow would playout and stay hidden afterward.
Here's my code
body {
font-family: 'Aldrich', sans-serif;
position: relative;
line-height: 22px;
font-size: 18px;
width: 1200px;
/* color: ##FFFFFF ;
background: #000000; */
overflow: hidden;
}
.text {
font-family: 'Aldrich', sans-serif;
position: relative;
line-height: 20px;
font-size: 18px;
width: 900px;
}
.fadingEffect {
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 100%;
background: white;
animation: show 5s ease-in;
animation-fill-mode: forwards;
/* animation-delay: 1s; */
}
.item {
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 100%;
background: white;
animation-duration: 12s;
animation-timing-function: ease-in-out;
animation-fill-mode: forwards;
}
.item {
animation-name: anim-1;
}
@keyframes show {
0% {width:100%}
100% {width:0%;}
}
@keyframes anim-1 {
0%,50% { left: 0%; opacity: 1; }
50%,90% { left: 0%; opacity: 1; }
90%, 100% { left: -100%; opacity: 0; }
}
<div class="text">
<link href="https://fonts.googleapis.com/css2?family=Aldrich&display=swap" rel="stylesheet">
<link href="faded.css" rel="stylesheet" type="text/css">
<link href="slide.css" rel="stylesheet" type="text/css"> Defeat all of the enemies!
<p class="item">Defeat all of the enemies!</p>
<div class="fadingEffect"></div>
</div>