-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
107 lines (94 loc) · 3.04 KB
/
App.tsx
File metadata and controls
107 lines (94 loc) · 3.04 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import React, { useState, useEffect } from 'react';
import { ThemeProvider } from './context/ThemeContext';
import { ConfigProvider } from './context/ConfigContext';
import MainLayout from './components/MainLayout';
import { THEMES } from '../shared/constants';
const App: React.FC = () => {
const [initialized, setInitialized] = useState(false);
// 模拟启动动画
useEffect(() => {
// 在实际应用中,这里可以加载配置、检查系统等
const timer = setTimeout(() => {
setInitialized(true);
}, 2000);
return () => clearTimeout(timer);
}, []);
return (
<ConfigProvider>
<ThemeProvider initialTheme={THEMES.GREEN}>
{!initialized ? (
<BootScreen />
) : (
<MainLayout />
)}
</ThemeProvider>
</ConfigProvider>
);
};
// 启动画面组件
const BootScreen: React.FC = () => {
const [bootText, setBootText] = useState('INITIALIZING ROBCO INDUSTRIES UNIFIED OPERATING SYSTEM');
const [dots, setDots] = useState('');
useEffect(() => {
const interval = setInterval(() => {
setDots(prev => prev.length < 3 ? prev + '.' : '');
}, 300);
const textInterval = setInterval(() => {
setBootText(prev => {
if (prev === 'INITIALIZING ROBCO INDUSTRIES UNIFIED OPERATING SYSTEM') {
return 'CHECKING SYSTEM INTEGRITY';
} else if (prev === 'CHECKING SYSTEM INTEGRITY') {
return 'LOADING MODULES';
} else if (prev === 'LOADING MODULES') {
return 'ESTABLISHING CONNECTION TO VAULT-TEC NETWORK';
} else {
return 'LAUNCHING PIP-BOY INTERFACE';
}
});
}, 500);
return () => {
clearInterval(interval);
clearInterval(textInterval);
};
}, []);
return (
<div className="boot-screen" style={{
backgroundColor: '#1A1A1A',
color: '#30FF50',
height: '100vh',
width: '100vw',
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
fontFamily: 'Share Tech Mono, monospace',
textAlign: 'center',
padding: '20px'
}}>
<div style={{ marginBottom: '30px' }}>
<h1 style={{ fontSize: '24px', marginBottom: '10px' }}>ROBCO INDUSTRIES UNIFIED OPERATING SYSTEM</h1>
<h2 style={{ fontSize: '18px' }}>COPYRIGHT 2075-2077 ROBCO INDUSTRIES</h2>
</div>
<div style={{ width: '80%', maxWidth: '600px' }}>
<div style={{
border: '2px solid #30FF50',
padding: '20px',
marginBottom: '20px',
textAlign: 'left'
}}>
<p>-PIP-OS(R) V7.1.0.8-</p>
<p>-64K RAM SYSTEM-</p>
<p>-38911 BYTES FREE-</p>
<p>-NO HOLOTAPE FOUND-</p>
<p>-LOAD ROM(1): DEITRIX 303-</p>
</div>
<div style={{ textAlign: 'left', height: '100px' }}>
<p>{bootText}{dots}</p>
</div>
</div>
<div className="scanlines" style={{ opacity: 0.1 }}></div>
<div className="crt-effect"></div>
</div>
);
};
export default App;