|
1 | 1 | document.addEventListener("DOMContentLoaded", () => { |
2 | | - // Hide hero content initially |
3 | | - const heroContent = document.querySelector('.hero-content'); |
4 | | - if (heroContent) { |
5 | | - heroContent.style.opacity = '0'; |
6 | | - heroContent.style.visibility = 'hidden'; |
7 | | - } |
| 2 | + // Hide hero content initially |
| 3 | + const heroContent = document.querySelector(".hero-content"); |
| 4 | + if (heroContent) { |
| 5 | + heroContent.style.opacity = "0"; |
| 6 | + heroContent.style.visibility = "hidden"; |
| 7 | + } |
8 | 8 |
|
9 | | - // Create the boot overlay container |
10 | | - const bootOverlay = document.createElement('div'); |
11 | | - bootOverlay.className = 'boot-overlay'; |
| 9 | + // Create the boot overlay container |
| 10 | + const bootOverlay = document.createElement("div"); |
| 11 | + bootOverlay.className = "boot-overlay"; |
12 | 12 |
|
13 | | - // Create an inner wrapper to center the text block |
14 | | - const bootInner = document.createElement('div'); |
15 | | - bootInner.className = 'boot-inner'; |
16 | | - bootOverlay.appendChild(bootInner); |
| 13 | + // Create an inner wrapper to center the text block |
| 14 | + const bootInner = document.createElement("div"); |
| 15 | + bootInner.className = "boot-inner"; |
| 16 | + bootOverlay.appendChild(bootInner); |
17 | 17 |
|
18 | | - document.body.appendChild(bootOverlay); |
| 18 | + document.body.appendChild(bootOverlay); |
19 | 19 |
|
20 | | - const bootLines = [ |
21 | | - "CodePVG_OS v2.4.1 (tty1)", |
22 | | - "", |
23 | | - "[ 0.041] initializing kernel...", |
24 | | - "[ 0.089] loading core modules.............. [OK]", |
25 | | - "[ 0.124] mounting file systems............. [OK]", |
26 | | - "[ 0.201] establishing secure connection.... [OK]", |
27 | | - "[ 0.345] fetching leetcode user data....... [OK]", |
28 | | - "[ 0.412] resolving rank algorithms......... [OK]", |
29 | | - "[ 0.589] loading matrix_rain.sh............ [OK]", |
30 | | - "[ 0.640] starting UI service............... [OK]", |
31 | | - "", |
32 | | - "system ready.", |
33 | | - "$ exec dashboard" |
34 | | - ]; |
| 20 | + const bootLines = [ |
| 21 | + "CodePVG_OS v2.4.1 (tty1)", |
| 22 | + "", |
| 23 | + "[ 0.041] initializing kernel...", |
| 24 | + "[ 0.089] loading core modules.............. [OK]", |
| 25 | + "[ 0.124] mounting file systems............. [OK]", |
| 26 | + "[ 0.201] establishing secure connection.... [OK]", |
| 27 | + "[ 0.345] fetching leetcode user data....... [OK]", |
| 28 | + "[ 0.412] resolving rank algorithms......... [OK]", |
| 29 | + "[ 0.589] loading matrix_rain.sh............ [OK]", |
| 30 | + "[ 0.640] starting UI service............... [OK]", |
| 31 | + "", |
| 32 | + "system ready.", |
| 33 | + "$ exec dashboard", |
| 34 | + ]; |
35 | 35 |
|
36 | | - let currentLine = 0; |
| 36 | + let currentLine = 0; |
37 | 37 |
|
38 | | - // Function to rapidly print lines |
39 | | - function printNextLine() { |
40 | | - if (currentLine < bootLines.length) { |
41 | | - const line = document.createElement('div'); |
42 | | - line.className = 'boot-line'; |
| 38 | + // Function to rapidly print lines |
| 39 | + function printNextLine() { |
| 40 | + if (currentLine < bootLines.length) { |
| 41 | + const line = document.createElement("div"); |
| 42 | + line.className = "boot-line"; |
43 | 43 |
|
44 | | - // Highlight [OK] in green |
45 | | - let text = bootLines[currentLine]; |
46 | | - if (text.includes('[OK]')) { |
47 | | - text = text.replace('[OK]', '<span class="boot-ok">[OK]</span>'); |
48 | | - } |
| 44 | + // Highlight [OK] in green |
| 45 | + let text = bootLines[currentLine]; |
| 46 | + if (text.includes("[OK]")) { |
| 47 | + text = text.replace("[OK]", '<span class="boot-ok">[OK]</span>'); |
| 48 | + } |
49 | 49 |
|
50 | | - line.innerHTML = text; |
51 | | - bootInner.appendChild(line); |
| 50 | + line.innerHTML = text; |
| 51 | + bootInner.appendChild(line); |
52 | 52 |
|
53 | | - // Auto scroll to bottom |
54 | | - bootOverlay.scrollTop = bootOverlay.scrollHeight; |
| 53 | + // Auto scroll to bottom |
| 54 | + bootOverlay.scrollTop = bootOverlay.scrollHeight; |
55 | 55 |
|
56 | | - currentLine++; |
| 56 | + currentLine++; |
57 | 57 |
|
58 | | - // Random slower delay between 80ms and 250ms |
59 | | - const delay = Math.random() * 170 + 80; |
60 | | - setTimeout(printNextLine, delay); |
61 | | - } else { |
62 | | - // Finish sequence |
63 | | - setTimeout(() => { |
64 | | - bootOverlay.classList.add('fade-out'); |
| 58 | + // Random slower delay between 80ms and 250ms |
| 59 | + const delay = Math.random() * 170 + 80; |
| 60 | + setTimeout(printNextLine, delay); |
| 61 | + } else { |
| 62 | + // Finish sequence |
| 63 | + setTimeout(() => { |
| 64 | + bootOverlay.classList.add("fade-out"); |
65 | 65 |
|
66 | | - setTimeout(() => { |
67 | | - bootOverlay.remove(); |
68 | | - if (heroContent) { |
69 | | - heroContent.style.visibility = 'visible'; |
70 | | - heroContent.style.animation = 'fadeIn 0.8s ease-out forwards'; |
71 | | - document.dispatchEvent(new Event('bootSequenceComplete')); |
72 | | - } |
73 | | - }, 400); // Wait for fade out |
74 | | - }, 400); // Short pause before fading out |
75 | | - } |
| 66 | + setTimeout(() => { |
| 67 | + bootOverlay.remove(); |
| 68 | + if (heroContent) { |
| 69 | + heroContent.style.visibility = "visible"; |
| 70 | + heroContent.style.animation = "fadeIn 0.8s ease-out forwards"; |
| 71 | + document.dispatchEvent(new Event("bootSequenceComplete")); |
| 72 | + } |
| 73 | + }, 400); // Wait for fade out |
| 74 | + }, 400); // Short pause before fading out |
76 | 75 | } |
| 76 | + } |
77 | 77 |
|
78 | | - // Start boot sequence |
79 | | - setTimeout(printNextLine, 200); // Initial small delay |
| 78 | + // Start boot sequence |
| 79 | + setTimeout(printNextLine, 200); // Initial small delay |
80 | 80 | }); |
0 commit comments