-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
42 lines (36 loc) · 1.3 KB
/
script.js
File metadata and controls
42 lines (36 loc) · 1.3 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
document.addEventListener('DOMContentLoaded', function() {
var loadingBar = document.getElementById('loading-bar');
var loadingScreen = document.getElementById('loading-screen');
var content = document.getElementById('content');
// Text to be displayed
var text = "Anna van Wingerden";
var loadingText = document.getElementById('loading-text');
var index = 0;
// Typing effect
function typeText() {
if (index < text.length) {
loadingText.textContent += text.charAt(index);
index++;
setTimeout(typeText, 200);
} else {
// Stop the blinking cursor when the text is fully typed
loadingText.style.borderRight = 'none';
}
}
// Start typing effect
typeText();
// Simulate loading progress
var progress = 0;
var interval = setInterval(function() {
progress += 3;
loadingBar.style.width = progress + '%';
if (progress >= 100) {
clearInterval(interval);
}
}, 100); // Adjust this value to control the speed of the loading bar
// Hide the loading screen after 10 seconds
setTimeout(function() {
loadingScreen.style.display = 'none';
content.style.display = 'block';
}, 5100); // 10000 milliseconds = 10 seconds
});