Skip to content

Commit 1228741

Browse files
committed
Fix typewriter: use underscore cursor, hide previous cursors, allow bio text to wrap
1 parent f592c5f commit 1228741

File tree

1 file changed

+37
-29
lines changed

1 file changed

+37
-29
lines changed

index.html

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -95,41 +95,48 @@ <h3>Connect</h3>
9595
/* CSS-based typewriter effect */
9696
.typewriter {
9797
overflow: hidden;
98-
border-right: 2px solid var(--gold-primary);
9998
white-space: nowrap;
10099
margin: 0 auto;
101100
letter-spacing: 0.05em;
102-
animation:
103-
typing 2s steps(30, end),
104-
blink-caret 0.75s step-end infinite;
105-
animation-fill-mode: forwards;
101+
animation: typing 2s steps(30, end) forwards;
102+
width: 0;
103+
}
104+
105+
.typewriter::after {
106+
content: '_';
107+
color: var(--gold-primary);
108+
animation: blink-caret 0.75s step-end infinite;
106109
}
107110

108111
.typewriter-delay-1 {
109112
overflow: hidden;
110-
border-right: 2px solid var(--gold-primary);
111113
white-space: nowrap;
112114
margin: 0 auto;
113115
letter-spacing: 0.05em;
114116
width: 0;
115-
animation:
116-
typing 1.5s steps(40, end) 2.2s,
117-
blink-caret 0.75s step-end infinite 2.2s;
118-
animation-fill-mode: forwards;
117+
animation: typing 1.5s steps(40, end) 2.2s forwards;
118+
}
119+
120+
.typewriter-delay-1::after {
121+
content: '_';
122+
color: var(--gold-primary);
123+
animation: blink-caret 0.75s step-end infinite 2.2s;
119124
}
120125

121126
.typewriter-delay-2 {
122-
overflow: hidden;
123-
border-right: 2px solid var(--gold-primary);
124-
white-space: nowrap;
125-
margin: 0 auto;
126-
letter-spacing: 0.05em;
127-
width: 0;
127+
overflow: visible;
128+
white-space: normal;
129+
max-width: 600px;
130+
animation: fade-in 0.5s 4s forwards;
131+
opacity: 0;
132+
}
133+
134+
.typewriter-delay-2::after {
135+
content: '_';
136+
color: var(--gold-primary);
128137
animation:
129-
typing 3s steps(60, end) 4s,
130-
blink-caret 0.75s step-end infinite 4s,
131-
remove-caret 0s 7s forwards;
132-
animation-fill-mode: forwards;
138+
blink-caret 0.75s step-end 4s,
139+
hide-cursor 0s 6s forwards;
133140
}
134141

135142
@keyframes typing {
@@ -138,22 +145,23 @@ <h3>Connect</h3>
138145
}
139146

140147
@keyframes blink-caret {
141-
from, to { border-color: transparent; }
142-
50% { border-color: var(--gold-primary); }
148+
from, to { opacity: 0; }
149+
50% { opacity: 1; }
143150
}
144151

145-
@keyframes remove-caret {
146-
to { border-right: none; }
147-
}
148-
149-
.fade-in-after-typing {
150-
opacity: 0;
151-
animation: fade-in 0.5s ease-in 7.2s forwards;
152+
@keyframes hide-cursor {
153+
to { content: ''; }
152154
}
153155

154156
@keyframes fade-in {
157+
from { opacity: 0; }
155158
to { opacity: 1; }
156159
}
160+
161+
.fade-in-after-typing {
162+
opacity: 0;
163+
animation: fade-in 0.5s ease-in 6.5s forwards;
164+
}
157165
</style>
158166

159167
<script>

0 commit comments

Comments
 (0)