-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypewriter.html
135 lines (109 loc) · 2.75 KB
/
typewriter.html
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
<!DOCTYPE html>
<html lang="ja">
<head>
</head>
<body>
<style scoped>
section {
background-color: #55c500;
color: ivory;
}
body {
background: #182028;
display: flex;
flex-direction: column;
justify-content: center;
height: 100vh;
margin: 0;
}
h1 {
font-size: 9vmin;
color: #8bf;
text-align: left;
font-family: Lato, sans-serif;
font-weight: 700;
margin: 1rem 0 1rem 2rem;
}
/* Typewriter effect 1 */
@keyframes typing {
0.0000%, 27.3488% { content: ""; }
1.1395%, 26.2093% { content: "d"; }
2.2791%, 25.0698% { content: "de"; }
3.4186%, 23.9302% { content: "dev"; }
4.5581%, 22.7907% { content: "deve"; }
5.6977%, 21.6512% { content: "devel"; }
6.8372%, 20.5116% { content: "develo"; }
7.9767%, 19.3721% { content: "develop"; }
9.1163%, 18.2326% { content: "develope"; }
10.2558%, 17.0930% { content: "developer"; }
30.7674%, 51.2791% { content: ""; }
31.9070%, 50.1395% { content: "w"; }
33.0465%, 49.0000% { content: "wr"; }
34.1860%, 47.8605% { content: "wri"; }
35.3256%, 46.7209% { content: "writ"; }
36.4651%, 45.5814% { content: "write"; }
37.6047%, 44.4419% { content: "writer"; }
54.6977%, 75.2093% { content: ""; }
55.8372%, 74.0698% { content: "r"; }
56.9767%, 72.9302% { content: "re"; }
58.1163%, 71.7907% { content: "rea"; }
59.2558%, 70.6512% { content: "read"; }
60.3953%, 69.5116% { content: "reade"; }
61.5349%, 68.3721% { content: "reader"; }
78.6279%, 96.8605% { content: ""; }
79.7674%, 95.7209% { content: "h"; }
80.9070%, 94.5814% { content: "hu"; }
82.0465%, 93.4419% { content: "hum"; }
83.1860%, 92.3023% { content: "huma"; }
84.3256%, 91.1628% { content: "human"; }
}
@keyframes blink {
0%, 100% { opacity: 1; }
50% { opacity: 0; }
}
.typewriter {
--caret: currentcolor;
}
.typewriter::before {
content: "";
animation: typing 13.5s infinite;
}
.typewriter::after {
content: "";
border-right: 1px solid var(--caret);
animation: blink 0.5s linear infinite;
}
.typewriter.thick::after {
border-right: 1ch solid var(--caret);
}
.typewriter.nocaret::after {
border-right: 0;
}
@media (prefers-reduced-motion) {
.typewriter::after {
animation: none;
}
@keyframes sequencePopup {
0%, 100% { content: "developer"; }
25% { content: "writer"; }
50% { content: "reader"; }
75% { content: "human"; }
}
.typewriter::before {
content: "developer";
animation: sequencePopup 12s linear infinite;
}
}
/**/
</style>
<h1 aria-label="Hi! I'm a developer">
Hi! I'm a <span class="typewriter"></span>
</h1>
<h1 aria-label="Hi! I'm a developer">
Hi! I'm a <span class="typewriter thick"></span>
</h1>
<h1 aria-label="Hi! I'm a developer">
Hi! I'm a <span class="typewriter nocaret"></span>
</h1>
</body>
</html>