Fix typewriter against secondary print sections
This commit is contained in:
parent
b1e5a1f359
commit
e479f21fe9
@ -1,7 +1,10 @@
|
||||
{{ define "main" }}
|
||||
<div class="centered top-fade">
|
||||
<div class="intro-content">
|
||||
{{ .Content }}
|
||||
<h1 data-value="Hi, I'm Tyler" data-show="intro-tagline" class="typewriter"></h1>
|
||||
<div id="intro-tagline">
|
||||
<p data-value="Software engineer, postmath"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepage-card">
|
||||
@ -22,6 +25,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="homepage-card">
|
||||
<h1 to-show="about-description" data-value="uname -a" class="typewriter">~ $ </h1>
|
||||
<div class="about-grid">
|
||||
@ -38,4 +42,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
{{ end }}
|
||||
|
@ -82,10 +82,12 @@ async function typeWriter(element) {
|
||||
let hiddenElementText = p.getAttribute("data-value");
|
||||
//hiddenElementText = replaceSpacesWithNbsp(hiddenElementText);
|
||||
p.innerHtml = "";
|
||||
output = "";
|
||||
|
||||
for (let i = 0; i < hiddenElementText.length; ++i){
|
||||
p.innerText += hiddenElementText.charAt(i);
|
||||
output += hiddenElementText.charAt(i);
|
||||
await sleep(hiddenElementSpeed);
|
||||
p.innerText = output;
|
||||
}
|
||||
|
||||
await sleep(50);
|
||||
|
Loading…
Reference in New Issue
Block a user