-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
33 lines (30 loc) · 930 Bytes
/
script.js
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
var currentChar = 0,
currentText = 0;
var endOfWord = false;
var dynamicText = "";
var text = ["web applications.", "corporate websites.", "landing pages.", "user interfaces."];
var dynamicTextTag = $(".dynamicText");
function start() {
var sumarLetra = setInterval(() => {
dynamicText += text[currentText].charAt(currentChar);
currentChar++;
dynamicTextTag.html(dynamicText);
if (currentChar == text[currentText].length) {
currentChar = 0;
dynamicText = "";
endOfWord = true;
clearInterval(sumarLetra);
setTimeout(() => {
currentText++
if (currentText == text.length) currentText = 0;
start();
}, 2000);
}
}, 100);
}
start();
$(".seeProjects").click(function () {
$("html,body").animate({
scrollTop: $(".projectsDiv").offset().top
});
});