-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
37 lines (30 loc) · 1.51 KB
/
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
34
35
36
37
document.addEventListener("DOMContentLoaded", function () {
const algorithmsContainer = document.getElementById("algorithms-container");
// Add a class to disable hover and transition effects during intro
algorithmsContainer.classList.add("disable-hover-transition");
// Delay the display of the intro
setTimeout(function () {
document.getElementById("intro-container").style.display = "none";
// Remove the class to enable hover and transition after intro
algorithmsContainer.classList.remove("disable-hover-transition");
}, 3000); // Display for 2 seconds
// Delay the display of title and opacity of body
setTimeout(function () {
document.getElementById("title").style.display = "block";
document.body.style.opacity = 1;
}, 2000);
algorithms.forEach(function (algorithm, index) {
// Create a div element for each algorithm
const algorithmDiv = document.createElement("div");
algorithmDiv.className = "algorithm";
algorithmDiv.textContent = algorithm;
// Add a class to trigger the CSS transition
algorithmDiv.classList.add("fade-in");
// Append the algorithm div to the container
algorithmsContainer.appendChild(algorithmDiv);
// Use a timeout to delay the appearance of each algorithm
setTimeout(function () {
algorithmDiv.style.opacity = 1;
}, (index + 1) * 3000); // Delay each algorithm by 1 second
});
});