Slide Up & Slide Down Effect | Animated Text - Pure CSS

Syiainfoku make a Slide Up & Slide Down Effect in HTML
Slide Up & Slide Down Effect | Animated Text - Pure CSS

Hello !

Welcome back, with me the founder of Syiainfoku. You will learn together on the Syiainfoku blog how to make a Slide Up & Slide Down Effect

Ok, let's get started.

Preview Slide Up & Slide Down Effect

Preview Slide Up & Slide Down Effect

More or less the result will be like in the picture above

Source Code and Brief Explanation

To make this program [Slide Up & Slide Down Effect]. First you need to create two Files, one HTML File and one CSS File. After creating these files, just paste the following code into your file. You can also download the source code file of this Slide Up & Slide Down Effect from the given download button.

First, create an HTML file with the name index.html and paste the given code in your HTML file. Remember, you must create a file with an .html extension.

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Youtube | hitori coding</title>
<link rel="stylesheet" href="./assets/style.css">
</head>

<body>
<div class="animated-title">
<div class="text-top">
<div>
<span>Welcome</span>
<span>to my channel</span>
</div>
</div>
<div class="text-bottom">
<div>hitori coding</div>
</div>
</div>
</body>

</html>

Finally, create a CSS file with the name style.css and paste the given code in your CSS file. Remember, you must create a file with a .css extension.

@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@700&family=Roboto:wght@700&display=swap');

@keyframes showTopText {
0% {
transform: translate3d(0, 100%, 0);
}

40%,
60% {
transform: translate3d(0, 50%, 0);
}

100% {
transform: translate3d(0, 0, 0);
}
}

@keyframes showBottomText {
0% {
transform: translate3d(0, -100%, 0);
}

100% {
transform: translate3d(0, 0, 0);
}
}

body {
background: #0a102c;
}

.animated-title {
color: #f9f9f9d8;
font-family: 'Roboto', sans-serif;
height: 90vmin;
left: 50%;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
width: 90vmin;
}

.animated-title>div {
height: 50%;
overflow: hidden;
position: absolute;
width: 100%;
}

.animated-title>div div {
font-size: 12vmin;
padding: 2vmin 0;
position: absolute;
}

.animated-title>div div span {
display: block;
}

.animated-title>div.text-top {
border-bottom: 1vmin solid #00ffff;
top: 0;
}

.animated-title>div.text-top div {
animation: showTopText 1s;
animation-delay: 0.5s;
animation-fill-mode: forwards;
bottom: 0;
transform: translate(0, 100%);
}

.animated-title>div.text-top div span:first-child {
color: #767676;
}

.animated-title>div.text-bottom {
bottom: 0;
color: #f9f9f9;
font-family: 'Inconsolata', monospace;
}

.animated-title>div.text-bottom div {
animation: showBottomText 0.5s;
animation-delay: 1.75s;
animation-fill-mode: forwards;
top: 0;
transform: translate(0, -100%);
}

That's it, now you have successfully created a Slide Up & Slide Down Effect, If your code is not working or you are facing any error/problem, please download the source code file from the given download button. It's free and a .zip file will be downloaded then you have to extract it.

Closing

Thank you for those of you who have read and downloaded this source code, hopefully it can be useful and add to your insight.

If you found this article useful, you can share it. That's all from me, and THANK YOU