forked from DigitalShadowcom/digitalshadowcom.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
50 lines (44 loc) · 1.1 KB
/
Copy pathscript.js
File metadata and controls
50 lines (44 loc) · 1.1 KB
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
/* Typewriter */
const texts = [
"Merhaba.",
"Ben Mehmet.",
"Web Developer.",
"Security Meraklısı."
];
let textIndex = 0;
let charIndex = 0;
const speed = 80;
const target = document.getElementById("type");
function typeEffect() {
if (charIndex < texts[textIndex].length) {
target.textContent += texts[textIndex].charAt(charIndex);
charIndex++;
setTimeout(typeEffect, speed);
} else {
setTimeout(() => {
target.textContent = "";
charIndex = 0;
textIndex = (textIndex + 1) % texts.length;
typeEffect();
}, 1200);
}
}
typeEffect();
/* Section Navigation */
let step = 0;
const sections = [
document.getElementById("about"),
document.getElementById("work"),
document.getElementById("project")
];
function nextSection() {
document.querySelector(".hero").classList.add("hidden");
if (step < sections.length) {
sections[step].classList.remove("hidden");
step++;
}
}
/* External Project */
function goGame() {
window.open("http://oyun.archever.qzz.io", "_blank");
}