From dc14e23700f0e1fa6d5e60bdb29f92dc67d9ab6b Mon Sep 17 00:00:00 2001 From: Biniam Date: Tue, 3 Apr 2018 02:37:27 -0400 Subject: [PATCH 1/2] Changed happend b/n the script lines Updated Version --- index.html | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/index.html b/index.html index b3625db..3af5380 100644 --- a/index.html +++ b/index.html @@ -24,31 +24,28 @@ Coding is
+ var words = ["fun", "exciting", "about\u00A0not\u00A0giving\u00A0up", + "being\u00A0helpful", + "being\u00A0open", + "what\u00A0I\u00A0learned\u00A0at\u00A0CodingDojo!"], + el = document.getElementById('magic'), + word_counter = 0, + character_counter = 0; + function updateText() + { + el.innerHTML = el.innerHTML+words[word_counter][character_counter++]; + if(character_counter == words[word_counter].length+1) + { + word_counter++; //choose a different word + character_counter = 0; //start over with the first character of the word + el.innerHTML = ''; //set the html to be blank + //if we're displaying the last word, go back to the first word + if(word_counter == words.length) + word_counter = 0; + } + } + setInterval(updateText,600); + From d92f39d4873bbebd5ef29e52c7f77a681b547e46 Mon Sep 17 00:00:00 2001 From: Biniam Date: Tue, 3 Apr 2018 02:47:55 -0400 Subject: [PATCH 2/2] Changed lines b/n the script tags --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 3af5380..a66ac85 100644 --- a/index.html +++ b/index.html @@ -36,7 +36,7 @@ el.innerHTML = el.innerHTML+words[word_counter][character_counter++]; if(character_counter == words[word_counter].length+1) { - word_counter++; //choose a different word + word_counter++; //choose a different word character_counter = 0; //start over with the first character of the word el.innerHTML = ''; //set the html to be blank //if we're displaying the last word, go back to the first word