forked from tarunsinghofficial/HacktoberFest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFade-In-Text-Effect.html
114 lines (104 loc) · 2 KB
/
Fade-In-Text-Effect.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!Doctype html>
<html>
<head>
<style>
@import url("https://fonts.googleapis.com/css?family=Roboto&display=swap");
body{
background: black;
}
.main-text {
color: white;
font-size: 4rem;
font-family: Roboto, sans-serif;
text-align: left;
margin-left: 25%;
margin-right: 10%;
animation: fadein 4s;
animation-timing-function: ease-in;
-moz-animation: fadein 4s; /* Firefox */
-webkit-animation: fadein 4s; /* Safari and Chrome */
-o-animation: fadein 4s; /* Opera */
}
.jobs {
color: white;
font-size: 4rem;
font-family: Roboto, sans-serif;
text-align: left;
animation: fadein 4s;
animation-timing-function: ease-in;
-moz-animation: fadein 4s; /* Firefox */
-webkit-animation: fadein 4s; /* Safari and Chrome */
-o-animation: fadein 4s; /* Opera */
}
@keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-moz-keyframes fadein {
/* Firefox */
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-webkit-keyframes fadein {
/* Safari and Chrome */
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-o-keyframes fadein {
/* Opera */
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>
</head>
<body>
<h1 class="main-text">
</h1>
<script type="text/javascript">
const text = document.querySelector(".main-text");
var n = 0;
let timer = setInterval(onTick, 2500);
function onTick() {
if (n === 0) {
text.innerHTML = " Hi there! I'm <span >Shashi</span>";
n = 1;
return;
}
if (n === 4) {
text.innerHTML = ' Hi there! I\'m <span class="jobs" ">Shashi</span>';
n = 1;
return;
} else if (n == 1) {
text.innerHTML = ' Hi there! I\'m <span class="jobs">a Developer</span>';
n = 2;
return;
} else if (n == 2) {
text.innerHTML =
' Hi there! I\'m <span class="jobs">a Software Developer</span>';
n = 3;
return;
} else if (n == 3) {
text.innerHTML = ' Hi there! I\'m <span class="jobs">a Full-Stack-Developer</span>';
n = 4;
return;
}
}
</script>
</body>
</html>