-
Notifications
You must be signed in to change notification settings - Fork 0
/
intro.css
84 lines (75 loc) · 1.51 KB
/
intro.css
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
:root {
--bg-color: hsl(49 37% 94%);
--typewriterSpeed: 6s;
--typewriterCharacters: 24;
}
body {
margin: 0;
font-family: "Source Sans Pro", sans-serif;
min-height: 100vh;
place-content: center;
text-align: center;
}
h1 {
font-size: clamp(1rem, 3vw + 1rem, 4rem);
position: relative;
font-family: "Source Code Pro", monospace;
position: relative;
width: max-content;
}
h1::before,
h1::after {
content: "";
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
h1::before {
background-color: skyblue;
animation: typewriter var(--typewriterSpeed)
steps(var(--typewriterCharacters)) 1s forwards;
}
h1::after {
width: 0.125em;
background: black;
animation: typewriter var(--typewriterSpeed)
steps(var(--typewriterCharacters)) 1s forwards,
blink 750ms steps(var(--typewriterCharacters)) infinite;
}
.subtitle {
color: hsl(0 0% 0% / 0.7);
font-size: 2rem;
font-weight: 400;
opacity: 0;
transform: translateY(3rem);
animation: fadeInUp 2s ease calc(var(--typewriterSpeed) + 2s) forwards;
}
@keyframes typewriter {
to {
left: 100%;
}
}
@keyframes blink {
to {
background: transparent;
}
}
@keyframes fadeInUp {
to {
opacity: 1;
transform: translateY(0);
}
}
.intro {
display: grid;
place-content: center;
margin: 0;
padding: 0;
text-align: center;
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
}