Skip to content
This repository was archived by the owner on Dec 15, 2020. It is now read-only.

add type writer effect to header #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

<div class="panel">
<div class="container">
<h1>I will be accepting up to one pull&nbsp;request per day on <a href="https://github.com/thepracticaldev/1pr">this&nbsp;project</a></h1>
<h1 id="header"><a href="https://github.com/thepracticaldev/1pr"></a></h1>

<div id="intro">

Expand Down
17 changes: 17 additions & 0 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,20 @@
document.getElementById('sidebar-toggle').style.display = 'block';

})();

//---TYPEWRITER EFFECT---//
let i = 0;
let txt = 'I will be accepting up to one pull request per day on this project';
let speed = 60;

function typeWriter() {
if (i < txt.length) {
document.getElementById("header").innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
}

window.onload = function () {
typeWriter();
};