diff --git a/100_projects/66-type-writer-effect-on-text/css.css b/100_projects/66-type-writer-effect-on-text/css.css new file mode 100644 index 0000000..f759225 --- /dev/null +++ b/100_projects/66-type-writer-effect-on-text/css.css @@ -0,0 +1,41 @@ +*{ + box-sizing: border-box; + margin: 0; + padding: 0; +} +body{ + font-size: 18px; + display: flex; + justify-content: center; + align-items: center; + text-align: center; + flex-direction: column; + height: 100vh; + background: #E9BF8B; +} +#button{ + text-transform: uppercase; + font-size: 18px; + padding: 10px 15px; + color: #2C2D2A; + background: transparent; + border: 1px solid #2C2D2A; + border-radius: 3px; + transition: .2s; + cursor:pointer; +} +#button:hover{ + background:#2C2D2A; + color: #E9BF8B; + box-shadow: 1px 1px 1px #2C2D2A; +} +#type{ + color: #2C2D2A; + font-size: 24px; + margin-top: 20px; + transition: .2s; +} +#type:hover{ + background: #2C2D2A; + color: #E9BF8B; +} \ No newline at end of file diff --git a/100_projects/66-type-writer-effect-on-text/index.html b/100_projects/66-type-writer-effect-on-text/index.html new file mode 100644 index 0000000..8664bb7 --- /dev/null +++ b/100_projects/66-type-writer-effect-on-text/index.html @@ -0,0 +1,16 @@ + + + + + + + Document + + + + +

+ + + + diff --git a/100_projects/66-type-writer-effect-on-text/main.js b/100_projects/66-type-writer-effect-on-text/main.js new file mode 100644 index 0000000..47bcfc5 --- /dev/null +++ b/100_projects/66-type-writer-effect-on-text/main.js @@ -0,0 +1,15 @@ +let myText = 'Hello Everyone My Name Is Essam, I Love Programming', + i = 0, + myButton = document.getElementById('button'); + +myButton.onclick = function(){ + 'use strict'; + + const typeWriter = setInterval(function(){ + document.getElementById('type').textContent += myText[i]; + i = i + 1; + if (i > myText.length - 1) { + clearInterval(typeWriter); + } + },200); +}; \ No newline at end of file