-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathoffline.html
More file actions
executable file
·128 lines (117 loc) · 3.6 KB
/
Copy pathoffline.html
File metadata and controls
executable file
·128 lines (117 loc) · 3.6 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
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="theme-color" content="#2d89ef" />
<title>离线中 | AI Sandbox Game</title>
<style>
:root {
color-scheme: light;
--bg: #eceff1;
--card: #ffffff;
--text: #1a1a1a;
--muted: #4b5563;
--primary: #2d89ef;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
min-height: 100dvh;
display: grid;
place-items: center;
background: linear-gradient(180deg, #f5f7fa 0%, var(--bg) 100%);
color: var(--text);
font-family: 'Open Sans', 'Noto Sans SC', 'Segoe UI', sans-serif;
padding: 24px;
}
.offline-card {
width: min(520px, 100%);
background: var(--card);
border-radius: 16px;
padding: 28px;
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.08);
border: 1px solid rgba(0, 0, 0, 0.06);
text-align: center;
}
.offline-icon {
font-size: 34px;
margin-bottom: 10px;
}
h1 {
margin: 0 0 10px;
font-size: 26px;
line-height: 1.3;
font-weight: 700;
}
p {
margin: 0 0 22px;
color: var(--muted);
font-size: 16px;
line-height: 1.6;
}
button {
border: 0;
border-radius: 10px;
padding: 11px 18px;
background: var(--primary);
color: #fff;
font-size: 15px;
font-weight: 600;
cursor: pointer;
}
button:hover {
filter: brightness(0.96);
}
</style>
</head>
<body>
<main class="offline-card">
<div class="offline-icon" aria-hidden="true">📡</div>
<h1 id="offline-title">信号中断,世界暂时静止</h1>
<p id="offline-body">网络恢复后即可继续冒险。</p>
<button id="offline-reload-btn" type="button" onclick="location.reload()">重新连接</button>
</main>
<script>
(function () {
var locale = 'zh-CN';
try {
var raw = localStorage.getItem('ai_adventure_settings');
if (raw) {
var parsed = JSON.parse(raw);
if (parsed && (parsed.uiLanguage === 'zh-CN' || parsed.uiLanguage === 'en')) {
locale = parsed.uiLanguage;
} else {
locale = /^en/i.test(navigator.language || '') ? 'en' : 'zh-CN';
}
} else {
locale = /^en/i.test(navigator.language || '') ? 'en' : 'zh-CN';
}
} catch (_) {
locale = /^en/i.test(navigator.language || '') ? 'en' : 'zh-CN';
}
var copy =
locale === 'en'
? {
title: 'Offline | AI Sandbox Game',
heading: 'Connection Lost, World Paused',
body: 'Reconnect to continue your adventure.',
button: 'Reconnect',
}
: {
title: '离线中 | AI Sandbox Game',
heading: '信号中断,世界暂时静止',
body: '网络恢复后即可继续冒险。',
button: '重新连接',
};
document.documentElement.lang = locale;
document.title = copy.title;
document.getElementById('offline-title').textContent = copy.heading;
document.getElementById('offline-body').textContent = copy.body;
document.getElementById('offline-reload-btn').textContent = copy.button;
})();
</script>
</body>
</html>