-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html
More file actions
247 lines (210 loc) · 9.43 KB
/
index.html
File metadata and controls
247 lines (210 loc) · 9.43 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<!doctype html>
<html lang="en" dir="ltr">
<head>
<!-- 基础元数据 -->
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- 主题色 -->
<meta name="theme-color" content="#6366f1" media="(prefers-color-scheme: light)" />
<meta name="theme-color" content="#1e1b4b" media="(prefers-color-scheme: dark)" />
<!-- 描述和关键词 -->
<meta name="description" content="MetaHuman Engine - Browser-native 3D digital human engine with voice, vision, and dialogue capabilities. Zero-config, offline-ready, production-grade." />
<meta name="keywords" content="digital human, 3D avatar, AI, voice interaction, computer vision, WebGL, Three.js, React, TypeScript" />
<meta name="author" content="LessUp" />
<meta name="robots" content="index, follow" />
<!-- 开放图谱 / Open Graph -->
<meta property="og:type" content="website" />
<meta property="og:site_name" content="MetaHuman Engine" />
<meta property="og:title" content="MetaHuman Engine - 3D Digital Human Platform" />
<meta property="og:description" content="Browser-native 3D digital human engine with voice, vision, and dialogue capabilities" />
<meta property="og:url" content="https://lessup.github.io/meta-human/" />
<meta property="og:image" content="https://lessup.github.io/meta-human/og-image.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:locale" content="en_US" />
<meta property="og:locale:alternate" content="zh_CN" />
<!-- Twitter 卡片 -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@LessUpHQ" />
<meta name="twitter:creator" content="@LessUpHQ" />
<meta name="twitter:title" content="MetaHuman Engine - 3D Digital Human Platform" />
<meta name="twitter:description" content="Browser-native 3D digital human engine with voice, vision, and dialogue capabilities" />
<meta name="twitter:image" content="https://lessup.github.io/meta-human/og-image.png" />
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="MetaHuman" />
<!-- Windows -->
<meta name="msapplication-TileColor" content="#6366f1" />
<meta name="msapplication-config" content="/meta-human/browserconfig.xml" />
<!-- 移动端优化 -->
<meta name="mobile-web-app-capable" content="yes" />
<meta name="format-detection" content="telephone=no" />
<meta name="apple-touch-fullscreen" content="yes" />
<!-- PWA Manifest -->
<link rel="manifest" href="/meta-human/manifest.json" />
<!-- Favicon -->
<link rel="icon" type="image/svg+xml" href="/meta-human/favicon.svg" />
<link rel="apple-touch-icon" href="/meta-human/favicon.svg" />
<link rel="mask-icon" href="/meta-human/favicon.svg" color="#6366f1" />
<!-- DNS 预解析 -->
<link rel="dns-prefetch" href="https://fonts.googleapis.com" />
<link rel="dns-prefetch" href="https://fonts.gstatic.com" />
<link rel="dns-prefetch" href="https://cdn.jsdelivr.net" />
<link rel="dns-prefetch" href="https://unpkg.com" />
<!-- 预连接 -->
<link rel="preconnect" href="https://fonts.googleapis.com" crossorigin />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="preconnect" href="https://api.openai.com" crossorigin />
<!-- 字体预加载 -->
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" as="style" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" media="print" onload="this.media='all'" />
<noscript><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" /></noscript>
<!-- OpenSearch -->
<link rel="search" type="application/opensearchdescription+xml" title="MetaHuman" href="/meta-human/opensearch.xml" />
<!-- Canonical -->
<link rel="canonical" href="https://lessup.github.io/meta-human/" />
<!-- 替代语言 -->
<link rel="alternate" hreflang="en" href="https://lessup.github.io/meta-human/" />
<link rel="alternate" hreflang="zh-CN" href="https://lessup.github.io/meta-human/?lang=zh" />
<link rel="alternate" hreflang="x-default" href="https://lessup.github.io/meta-human/" />
<!-- 安全性 -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com data:; img-src 'self' data: blob: https:; media-src 'self' blob: https:; connect-src 'self' https: wss:; frame-ancestors 'none'; base-uri 'self'; form-action 'self';" />
<!-- 性能优化脚本 -->
<script>
// 检测 WebGL 支持
(function() {
try {
var canvas = document.createElement('canvas');
var gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
window.__WEBGL_SUPPORTED__ = !!gl;
} catch(e) {
window.__WEBGL_SUPPORTED__ = false;
}
})();
// 检测触摸设备
window.__TOUCH_DEVICE__ = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
// 检测偏好减少动画
window.__REDUCE_MOTION__ = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
// 检测深色模式
window.__DARK_MODE__ = window.matchMedia('(prefers-color-scheme: dark)').matches;
</script>
<!-- 关键 CSS 内联 -->
<style>
/* 关键路径 CSS - 首屏渲染必需 */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
font-size: 16px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
scroll-behavior: smooth;
}
body {
min-height: 100vh;
min-height: 100dvh; /* 动态视口高度 */
background: #0a0a0a;
color: #fafafa;
overflow-x: hidden;
}
#root {
min-height: 100vh;
min-height: 100dvh;
}
/* 加载占位符 */
.loading-screen {
position: fixed;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
z-index: 9999;
transition: opacity 0.3s ease, visibility 0.3s ease;
}
.loading-screen.hidden {
opacity: 0;
visibility: hidden;
pointer-events: none;
}
.loading-spinner {
width: 48px;
height: 48px;
border: 3px solid rgba(99, 102, 241, 0.2);
border-top-color: #6366f1;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.loading-text {
margin-top: 1rem;
color: #a1a1aa;
font-size: 0.875rem;
}
/* WebGL 不支持提示 */
.no-webgl {
display: none;
text-align: center;
padding: 2rem;
}
.no-webgl.visible {
display: block;
}
</style>
<title>MetaHuman Engine - 开源 3D 数字人交互引擎</title>
</head>
<body>
<!-- 加载屏幕 -->
<div id="loading-screen" class="loading-screen">
<div class="loading-spinner"></div>
<p class="loading-text">Loading MetaHuman Engine...</p>
<div id="no-webgl" class="no-webgl">
<h2>WebGL Not Supported</h2>
<p>Your browser doesn't support WebGL, which is required for 3D rendering.</p>
<p>Please use a modern browser like Chrome, Firefox, or Safari.</p>
</div>
</div>
<!-- React 挂载点 -->
<div id="root"></div>
<!-- 隐藏加载屏幕脚本 -->
<script>
window.addEventListener('load', function() {
if (!window.__WEBGL_SUPPORTED__) {
document.getElementById('no-webgl').classList.add('visible');
}
// 延迟隐藏加载屏幕,确保 React 已挂载
setTimeout(function() {
var loader = document.getElementById('loading-screen');
if (loader) {
loader.classList.add('hidden');
setTimeout(function() {
loader.remove();
}, 300);
}
}, 500);
});
// 加载超时处理
setTimeout(function() {
var loader = document.getElementById('loading-screen');
if (loader && !loader.classList.contains('hidden')) {
var text = loader.querySelector('.loading-text');
if (text) {
text.textContent = 'Taking longer than expected...';
}
}
}, 10000);
</script>
<!-- 主应用脚本 -->
<script type="module" src="/src/main.tsx"></script>
</body>
</html>