How we can create multiple text animation using pure CSS? Solution: See these CSS Text Animations With Multiple Effects, 7 Different Animation List.
Previously I have shared text related programs, but this is about text animations we can create using only HTML CSS. Basically, Text animation is an effect about how text appears on the webpage. There can be a lot of things in the animation like motion, direction, color, size, etc. The transformation of any word or sentence is text animation.
Today you will learn to create 7 Different Animation With Text. Basically there are 7 different types of text running animation effects, which are placed list-wise one after one. The animations you can see on load or reload but there is also a separate button for reloading on each text line. You can replay the animation effect of each element separately.
So, Today I am sharing CSS Text Animations With Multiple Effects. This all effects are completely created using pure CSS, but there is also JavaScript for reloading feature. Let me tell you all the animation are not depending on JS but the only reload action is based on it, you can remove JavaScript if you do not want to keep reload function.
If you are thinking now how these animations actually are, see the preview given below.
Preview Of 7 Different Animation List-Wise
See this video preview to getting an idea of how these text animations look like.
Now you can see this visually, you also can see it live by pressing the button given above. If you like this, then get the source code of its.
You May Also Like:
- CSS Text Shimmer Effect
- 13 Different Button Hover Effects
- Custom Cursor Pointer Icons
- HTML CSS Navigation Bar
CSS Text Animations With Multiple Effects Source Code
Before sharing source code, let’s talk about it. First I have placed text in the HTML file inside the main div, all the alphabets I have put separately in the span tag. For animation, this is important to put each alphabet put on each span, it divides the word into alphabets. I have placed words like this: <span>t</span><span>e</span><span>x</span><span>t</span> .
Now using CSS first I have placed all the elements on the right place, as you can see in the preview. For creating the animation effect I have used CSS @keyframe property completely (info). Inside the keyframe, I have used CSS transform property for animating and scaling text. And used JavaScript for reloading function, which is based on jQuery.
Left all other things you will understand after getting the codes, I can’t explain all in writing. For creating this program, you have to create 3 files fo that. First file for HTML, second for CSS, and the third for JavaScript. Follow the steps given below for creating this without any error.
index.html
Create an HTML file named ‘index.html‘ and put these codes given below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
<!DOCTYPE html> <!--Code By Webdevtrick ( https://webdevtrick.com )--> <html lang="en" > <head> <meta charset="UTF-8"> <title>CSS Text Animation | Webdevtrick.com</title> <link rel="stylesheet" href="style.css"> </head> <body> <div class="container"> <div class="textANI one"> <span>t</span><span>e</span><span>x</span><span>t</span> <span>a</span><span>n</span><span>i</span><span>m</span><span>a</span><span>t</span><span>i</span><span>o</span><span>n</span><span>s</span> <a class="repeat" href="javascript:void(0);">Repeat Animation</a> </div> <div class="textANI two"> <span>t</span><span>e</span><span>x</span><span>t</span> <span>a</span><span>n</span><span>i</span><span>m</span><span>a</span><span>t</span><span>i</span><span>o</span><span>n</span><span>s</span> <a class="repeat" href="javascript:void(0);">Repeat Animation</a> </div> <div class="textANI three"> <span>t</span><span>e</span><span>x</span><span>t</span> <span>a</span><span>n</span><span>i</span><span>m</span><span>a</span><span>t</span><span>i</span><span>o</span><span>n</span><span>s</span> <a class="repeat" href="javascript:void(0);">Repeat Animation</a> </div> <div class="textANI four"> <span>t</span><span>e</span><span>x</span><span>t</span> <span>a</span><span>n</span><span>i</span><span>m</span><span>a</span><span>t</span><span>i</span><span>o</span><span>n</span><span>s</span> <a class="repeat" href="javascript:void(0);">Repeat Animation</a> </div> <div class="textANI five"> <span>t</span><span>e</span><span>x</span><span>t</span> <span>a</span><span>n</span><span>i</span><span>m</span><span>a</span><span>t</span><span>i</span><span>o</span><span>n</span><span>s</span> <a class="repeat" href="javascript:void(0);">Repeat Animation</a> </div> <div class="textANI six"> <span>t</span><span>e</span><span>x</span><span>t</span> <span>a</span><span>n</span><span>i</span><span>m</span><span>a</span><span>t</span><span>i</span><span>o</span><span>n</span><span>s</span> <a class="repeat" href="javascript:void(0);">Repeat Animation</a> </div> <div class="textANI seven"> <span>t</span><span>e</span><span>x</span><span>t</span> <span>a</span><span>n</span><span>i</span><span>m</span><span>a</span><span>t</span><span>i</span><span>o</span><span>n</span><span>s</span> <a class="repeat" href="javascript:void(0);">Repeat Animation</a> </div> </div> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script> <script src="function.js"></script> </body> </html> |
style.css
Now create a CSS file named ‘style.css‘ and put these codes given here.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
/* Code By Webdevtrick ( https://webdevtrick.com ) */ @import url('https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i'); * { margin: 0; padding: 0; } body { font-family: 'Lato', sans-serif; font-size: 14px; color: #fafafa; word-wrap:break-word; } p { margin: 0 0 10px; } ul { list-style: none; } .container { width: 100%; margin: auto; font-weight: 900; text-transform: uppercase; text-align: center; padding: 0 0 200px; } .textANI { font-size: 50px; margin: 80px 0 0; border-bottom: 2px solid #212121; } .textANI span { display: inline-block; } a.repeat { display: inline-block; font-size: 12px; text-transform: none; text-decoration: none; color: #f59500; padding: 5px 12px; border: 1px solid rgba(0, 0, 0, 0.15); font-weight: normal; margin: 0 0 0 50px; border-radius: 3px; position: relative; bottom: 15px; } a.repeat:hover { background: rgba(0, 0, 0, 0.7); color: white; } .textANI span:nth-of-type(2) { animation-delay: .05s; } .textANI span:nth-of-type(3) { animation-delay: .1s; } .textANI span:nth-of-type(4) { animation-delay: .15s; } .textANI span:nth-of-type(5) { animation-delay: .2s; } .textANI span:nth-of-type(6) { animation-delay: .25s; } .textANI span:nth-of-type(7) { animation-delay: .3s; } .textANI span:nth-of-type(8) { animation-delay: .35s; } .textANI span:nth-of-type(9) { animation-delay: .4s; } .textANI span:nth-of-type(10) { animation-delay: .45s; } .textANI span:nth-of-type(11) { animation-delay: .5s; } .textANI span:nth-of-type(12) { animation-delay: .55s; } .textANI span:nth-of-type(13) { animation-delay: .6s; } .textANI span:nth-of-type(14) { animation-delay: .65s; } .textANI span:nth-of-type(15) { animation-delay: .7s; } .textANI span:nth-of-type(16) { animation-delay: .75s; } .textANI span:nth-of-type(17) { animation-delay: .8s; } .textANI span:nth-of-type(18) { animation-delay: .85s; } .textANI span:nth-of-type(19) { animation-delay: .9s; } .textANI span:nth-of-type(20) { animation-delay: .95s; } .one span { color: #2ab1ce; opacity: 0; transform: translate(-150px, -50px) rotate(-180deg) scale(3); animation: revolveScale .4s forwards; } @keyframes revolveScale { 60% { transform: translate(20px, 20px) rotate(30deg) scale(.3); } 100% { transform: translate(0) rotate(0) scale(1); opacity: 1; } } .two span { color: #ff3f3f; opacity: 0; transform: translate(200px, -100px) scale(2); animation: ballDrop .3s forwards; } @keyframes ballDrop { 60% { transform: translate(0, 20px) rotate(-180deg) scale(.5); } 100% { transform: translate(0) rotate(0deg) scale(1); opacity: 1; } } .three span { color: #3dcfa1; opacity: 0; transform: translate(-300px, 0) scale(0); animation: sideSlide .5s forwards; } @keyframes sideSlide { 60% { transform: translate(20px, 0) scale(1); color: #3dcfa1; } 80% { transform: translate(20px, 0) scale(1); color: #3dcfa1; } 99% { transform: translate(0) scale(1.2); color: #ff3f3f; } 100% { transform: translate(0) scale(1); opacity: 1; color: #3dcfa1; } } .four span { color: #fd9d08; opacity: 0; transform: translate(0, -100px) rotate(360deg) scale(0); animation: revolveDrop .3s forwards; } @keyframes revolveDrop { 30% { transform: translate(0, -50px) rotate(180deg) scale(1); } 60% { transform: translate(0, 20px) scale(.8) rotate(0deg); } 100% { transform: translate(0) scale(1) rotate(0deg); opacity: 1; } } .five span { color: #5cb85c; opacity: 0; transform: translate(0, -100px) rotate(360deg) scale(0); animation: dropVanish .5s forwards; } @keyframes dropVanish { 30% { transform: translate(0, -50px) rotate(180deg) scale(1); } 50% { transform: translate(0, 20px) scale(.8) rotate(0deg); opacity: 1; } 80% { transform: translate(-100px, -100px) scale(1.5) rotate(-180deg); opacity: 0; } 100% { transform: translate(0) scale(1) rotate(0deg); opacity: 1; } } .six span { color: #4267b2; opacity: 0; transform: rotate(-180deg) translate(150px, 0); animation: twister .5s forwards; } @keyframes twister { 10% { opacity: 1; } 100% { transform: rotate(0deg) translate(0); opacity: 1; } } .seven span { color: #0080ff; opacity: 0; transform: translate(-150px, 0) scale(.3); animation: leftRight .5s forwards; } @keyframes leftRight { 40% { transform: translate(50px, 0) scale(.7); opacity: 1; color: #0080ff; } 60% { color: #fd9d08; } 80% { transform: translate(0) scale(2); opacity: 0; } 100% { transform: translate(0) scale(1); opacity: 1; } } |
function.js
The final step, create a JavaScript file named ‘function.js‘ and put the codes.
1 2 3 4 5 6 7 8 9 10 11 12 |
// Code By Webdevtrick ( https://webdevtrick.com ) // Only for repeat $(function(){ $('.repeat').click(function(){ var classes = $(this).parent().attr('class'); $(this).parent().attr('class', 'textANI'); var indicator = $(this); setTimeout(function(){ $(indicator).parent().addClass(classes); }, 20); }); }); |
That’s It. Now you have successfully created CSS Text Animations With Multiple Effects, 7 Different Animation List. If you have any doubt or question comment down below.
Thanks For Visiting, Keep Visiting.
woAh theRe