-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathindex.html
More file actions
161 lines (144 loc) · 4.09 KB
/
index.html
File metadata and controls
161 lines (144 loc) · 4.09 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link rel="icon" type="image/svg+xml" href="/codeforge.svg"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>CodeForge</title>
<style>
/* 预加载样式 */
#app-loading {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #f9fafb;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 9999;
}
.loading-logo {
width: 80px;
height: 80px;
margin-bottom: 2rem;
position: relative;
}
.loading-logo img {
width: 100%;
height: 100%;
animation: pulse 2s infinite;
}
.loading-spinner {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 2px solid transparent;
border-top: 2px solid #3b82f6;
border-radius: 50%;
animation: spin 1s linear infinite;
}
.loading-title {
font-size: 2rem;
font-weight: bold;
color: #1f2937;
margin-bottom: 0.5rem;
}
.loading-subtitle {
color: #6b7280;
margin-bottom: 2rem;
}
.loading-dots {
display: flex;
gap: 0.25rem;
}
.loading-dot {
width: 12px;
height: 12px;
background-color: #3b82f6;
border-radius: 50%;
animation: bounce 1.2s infinite;
}
.loading-dot:nth-child(2) {
animation-delay: 0.1s;
}
.loading-dot:nth-child(3) {
animation-delay: 0.2s;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
@keyframes pulse {
0%, 100% {
opacity: 1;
transform: scale(1);
}
50% {
opacity: 0.8;
transform: scale(1.05);
}
}
@keyframes bounce {
0%, 80%, 100% {
transform: translateY(0);
}
40% {
transform: translateY(-10px);
}
}
</style>
</head>
<body>
<!-- 预加载动画 -->
<div id="app-loading">
<div class="loading-logo">
<img src="/codeforge.svg" alt="CodeForge"/>
<div class="loading-spinner"></div>
</div>
<h1 class="loading-title">CodeForge</h1>
<p class="loading-subtitle">轻量级代码执行器</p>
<div class="loading-dots">
<div class="loading-dot"></div>
<div class="loading-dot"></div>
<div class="loading-dot"></div>
</div>
</div>
<!-- Vue 应用 -->
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<script>
console.log('🎬 页面脚本已加载,等待 app-ready 事件')
// 监听应用准备就绪事件
window.addEventListener('app-ready', function () {
console.log('📡 收到 app-ready 事件,开始隐藏加载动画')
const appLoading = document.getElementById('app-loading');
if (appLoading) {
console.log('🎭 开始淡出动画')
appLoading.style.opacity = '0';
appLoading.style.transition = 'opacity 0.3s ease-out';
setTimeout(() => {
console.log('✨ 预加载动画已移除')
appLoading.remove();
}, 300);
}
else {
console.log('⚠️ 找不到预加载元素')
}
});
// 超时保护,避免永远加载
setTimeout(() => {
console.log('⏰ 超时保护触发,强制隐藏加载动画')
const appLoading = document.getElementById('app-loading');
if (appLoading) {
appLoading.remove();
}
}, 10000); // 10秒超时
</script>
</body>
</html>