Add files via upload
This commit is contained in:
parent
df81028205
commit
d855c245a3
41
100_projects/66-type-writer-effect-on-text/css.css
Normal file
41
100_projects/66-type-writer-effect-on-text/css.css
Normal file
@ -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;
|
||||
}
|
16
100_projects/66-type-writer-effect-on-text/index.html
Normal file
16
100_projects/66-type-writer-effect-on-text/index.html
Normal file
@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<link rel="stylesheet" href="css.css">
|
||||
</head>
|
||||
<body>
|
||||
<button id="button">Start write</button>
|
||||
<p id="type"></p>
|
||||
<script src="main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
15
100_projects/66-type-writer-effect-on-text/main.js
Normal file
15
100_projects/66-type-writer-effect-on-text/main.js
Normal file
@ -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);
|
||||
};
|
Loading…
Reference in New Issue
Block a user