File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ title : Typewriter Animation
3
+ description : Adds a typewriter animation + blinking cursor
4
+ author : AlsoKnownAs-Ax
5
+ tags : css,animation
6
+ ---
7
+
8
+ ``` html
9
+ <div class =" typewriter" >
10
+ <div >
11
+ <p >Typerwriter Animation</p >
12
+ </div >
13
+ </div >
14
+ ```
15
+
16
+ ``` css
17
+ .typewriter {
18
+ display : flex ;
19
+ justify-content : center ;
20
+ }
21
+
22
+ .typewriter p {
23
+ overflow : hidden ;
24
+ font-size : 1.5rem ;
25
+ font-family : monospace ;
26
+ border-right : 1px solid ;
27
+ margin-inline : auto ;
28
+ white-space : nowrap ;
29
+ /* Steps: number of chars (better to set directly in js)*/
30
+ animation : typing 3s steps (21 ) forwards ,
31
+ blink 1s step-end infinite ;
32
+ }
33
+
34
+ @keyframes typing {
35
+ from {
36
+ width : 0%
37
+ }
38
+ f
39
+
40
+ to {
41
+ width : 100%
42
+ }
43
+ }
44
+
45
+ @keyframes blink {
46
+ 50% {
47
+ border-color : transparent ;
48
+ }
49
+ }
50
+ ```
You can’t perform that action at this time.
0 commit comments