From e479f21fe9be90bce51ea2e915da397c47f0a0df Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Sun, 30 Jul 2023 18:48:53 -0400 Subject: [PATCH] Fix typewriter against secondary print sections --- layouts/index.html | 7 ++++++- themes/clortox/static/js/script.js | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index ad2634e..84ef6ab 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,7 +1,10 @@ {{ define "main" }}
- {{ .Content }} +

+
+

+
@@ -22,6 +25,7 @@
+ {{ end }} diff --git a/themes/clortox/static/js/script.js b/themes/clortox/static/js/script.js index 8a714e1..01b8693 100644 --- a/themes/clortox/static/js/script.js +++ b/themes/clortox/static/js/script.js @@ -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);