-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
49 lines (45 loc) · 1.25 KB
/
script.js
File metadata and controls
49 lines (45 loc) · 1.25 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
var i = 0;
var txt = 'Lorem ipsum typing effect!';
var speed = 50;
/*
function typeWriter() {
if (i < txt.length) {
document.getElementById("typeWriter").innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
}
typeWriter();
*/
document.addEventListener('DOMContentLoaded', function() {
// the very first phrase is already placed in the HTML
// (<span id="typeWriter">productivity supertool.</span>), so
// we do not include it in the array. Typed.js will erase the
// existing text once the animation begins, then cycle through the
// list below indefinitely.
// typed.js btw lol
var typed = new Typed('#typeWriter', {
strings: [
'idea inbox.',
'focus frontier.',
'study space.',
'creativity catalyst.',
'productivity supertool.'
],
typeSpeed: 50,
backSpeed: 25,
backDelay: 3000,
/* startDelay: 1000, // keeps the HTML text visible briefly */
loop: true,
showCursor: true,
cursorChar: '|'
});
});
document.addEventListener("DOMContentLoaded", () => {
fetch('./navbar.html')
.then(res => res.text())
.then(data => {
document.getElementById('nav-placeholder').innerHTML = data;
})
.catch(err => console.error("Failed to load navbar:", err));
});