forked from qegj567-cloud/SullyOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
258 lines (251 loc) · 11.6 KB
/
Copy pathindex.html
File metadata and controls
258 lines (251 loc) · 11.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
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
248
249
250
251
252
253
254
255
256
257
258
<!DOCTYPE html>
<html lang="zh-CN" translate="no">
<head>
<meta charset="utf-8" />
<!-- 关掉浏览器自动翻译:SullyOS 本身就是中文 App,翻译纯属添乱(甚至「中译中」),
还会改动 React 托管的 DOM 触发 insertBefore/removeChild 白屏。translate="no" + 这两个 meta
覆盖 Chrome/Edge/三星 等主流浏览器。utils/translateCrashGuard 作为兜底护栏仍保留。 -->
<meta name="google" content="notranslate" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0, viewport-fit=cover, interactive-widget=resizes-content" />
<title>SullyOS</title>
<!-- PWA Settings -->
<link rel="manifest" href="./manifest.webmanifest" />
<meta name="theme-color" content="#0f1115" />
<meta name="mobile-web-app-capable" content="yes" />
<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="SullyOS" />
<!-- Updated Icons -->
<link rel="icon" type="image/png" href="./icons/icon-192.png" />
<link rel="apple-touch-icon" sizes="180x180" href="./icons/apple-touch-icon.png" />
<!-- KaTeX CSS for Math Rendering -->
<link rel="stylesheet" href="https://unpkg.com/katex@0.16.9/dist/katex.min.css" integrity="sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV" crossorigin="anonymous">
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600&family=Nunito:wght@400;500;600;700;800;900&family=Noto+Sans+SC:wght@400;500;700;900&family=DM+Serif+Display:ital@0;1&family=Caveat:wght@400;500;600;700&family=Shippori+Mincho:wght@400;500;600;700&family=Courier+Prime:ital,wght@0,400;0,700;1,400&family=Ma+Shan+Zheng&family=Long+Cang&family=ZCOOL+KuaiLe&family=ZCOOL+XiaoWei&display=swap" rel="stylesheet">
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
sans: ['var(--app-font)', 'sans-serif'],
},
colors: {
primary: 'hsl(var(--primary-hue), var(--primary-sat), var(--primary-lightness))',
'primary-focus': 'hsl(var(--primary-hue), var(--primary-sat), calc(var(--primary-lightness) - 10%))',
'primary-light': 'hsl(var(--primary-hue), var(--primary-sat), 92%)',
surface: 'rgba(255, 255, 255, 0.75)',
'surface-glass': 'rgba(255, 255, 255, 0.35)',
},
animation: {
'fade-in': 'fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1)',
'slide-up': 'slideUp 0.35s cubic-bezier(0.25, 1, 0.5, 1)',
'slide-down': 'slideDown 0.35s cubic-bezier(0.25, 1, 0.5, 1)',
'pop-in': 'popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275)',
'float-up': 'floatUp 3s ease-out forwards',
'wiggle': 'wiggle 0.5s ease-in-out infinite',
'bounce-slow': 'bounceSlow 2s ease-in-out infinite',
'float': 'floatDrift 4s ease-in-out infinite alternate',
'glow-pulse': 'glowPulse 3s ease-in-out infinite',
'shimmer': 'shimmer 2.5s ease-in-out infinite',
'dot-pulse': 'dotPulse 1.2s ease-in-out infinite',
'app-open': 'appOpen 0.4s cubic-bezier(0.16, 1, 0.3, 1)',
'notif-pop': 'notifPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1)',
},
keyframes: {
fadeIn: {
'0%': { opacity: '0', transform: 'scale(0.97) translateY(4px)' },
'100%': { opacity: '1', transform: 'scale(1) translateY(0)' },
},
slideUp: {
'0%': { transform: 'translateY(100%)', opacity: '0' },
'100%': { transform: 'translateY(0)', opacity: '1' },
},
slideDown: {
'0%': { transform: 'translateY(-100%)', opacity: '0' },
'100%': { transform: 'translateY(0)', opacity: '1' },
},
popIn: {
'0%': { opacity: '0', transform: 'scale(0.5)' },
'60%': { transform: 'scale(1.05)' },
'100%': { opacity: '1', transform: 'scale(1)' },
},
floatUp: {
'0%': { opacity: '1', transform: 'translateY(100vh) scale(1)' },
'50%': { opacity: '1' },
'100%': { opacity: '0', transform: 'translateY(-50px) scale(1.5)' },
},
wiggle: {
'0%, 100%': { transform: 'translate(-50%, -100%) rotate(-3deg)' },
'50%': { transform: 'translate(-50%, -100%) rotate(3deg)' },
},
bounceSlow: {
'0%, 100%': { transform: 'translateY(0)' },
'50%': { transform: 'translateY(-10px)' },
},
floatDrift: {
'0%': { transform: 'translateY(0) scale(1)', opacity: '0.3' },
'100%': { transform: 'translateY(-30px) scale(1.1)', opacity: '0.6' },
},
glowPulse: {
'0%, 100%': { boxShadow: '0 0 15px rgba(139, 92, 246, 0.15)' },
'50%': { boxShadow: '0 0 25px rgba(139, 92, 246, 0.3)' },
},
shimmer: {
'0%': { backgroundPosition: '-200% 0' },
'100%': { backgroundPosition: '200% 0' },
},
dotPulse: {
'0%, 80%, 100%': { opacity: '0.3', transform: 'scale(0.8)' },
'40%': { opacity: '1', transform: 'scale(1.1)' },
},
appOpen: {
'0%': { opacity: '0', transform: 'translateY(8%) scale(0.95)' },
'100%': { opacity: '1', transform: 'translateY(0) scale(1)' },
},
notifPop: {
'0%': { opacity: '0', transform: 'translateY(-130%)' },
'70%': { opacity: '1', transform: 'translateY(6%)' },
'100%': { opacity: '1', transform: 'translateY(0)' },
},
}
}
}
}
</script>
<style>
:root {
--primary-hue: 245;
--primary-sat: 25%;
--primary-lightness: 65%;
/* 安全区单一来源:原生 env 与 JS 探测值 --standalone-safe-area-*(见 utils/iosStandalone.ts)取大,
iOS 全屏 PWA 下原生 env 偶发返回 0 时由探测值兜底。新增 App 一律引用这三个变量。 */
--safe-top: max(env(safe-area-inset-top, 0px), var(--standalone-safe-area-top, 0px));
--safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--standalone-safe-area-bottom, 0px));
/* 全屏界面顶栏让开「安全区 + SullyOS 顶部状态栏(时间/电量, 约 1.5rem)」;背景仍铺满,只挪控件。 */
--chrome-top: calc(var(--safe-top) + 1.5rem);
--app-height: 100lvh;
--keyboard-inset: 0px;
--app-font: 'Quicksand', sans-serif;
}
/* 动森风格皮肤:拉丁/数字用 Nunito(圆润),中文用 ZCOOL KuaiLe(可爱),保留 Noto Sans SC 兜底。
选择 html[data-skin] 而非 :root,优先级更高,能盖过运行时注入的 --app-font。 */
html[data-skin="animalcrossing"] {
--app-font: 'Nunito', 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif;
}
html, body, #root {
width: 100%;
min-height: var(--app-height, 100lvh);
height: var(--app-height, 100lvh);
}
body {
background-color: #0f1115;
margin: 0;
overflow: hidden;
/* Critical: Prevent browser back/forward swipe navigation AND vertical rubber-banding */
overscroll-behavior: none;
/* Prevent text selection to feel like an app */
user-select: none;
-webkit-user-select: none;
height: var(--app-height);
min-height: var(--app-height);
width: 100vw;
font-family: var(--app-font);
}
/* 顶部时钟/电量条被隐藏时(外观开关或平台默认,由 PhoneShell 切换 .sully-statusbar-hidden),
chrome-top 不再需要那 1.5rem 状态栏预留,退化成 safe-top,
避免用 --chrome-top 让位的顶栏(交换日记/彼方/剧场等)顶部多留空白。 */
html.sully-statusbar-hidden {
--chrome-top: var(--safe-top);
}
body.ios-standalone {
min-height: var(--app-height);
height: var(--app-height);
overscroll-behavior-y: auto;
overscroll-behavior-x: none;
}
body.ios-standalone #root {
min-height: var(--app-height);
height: var(--app-height);
}
/* Global scroll behavior fix */
.no-overscroll {
overscroll-behavior: none;
}
.overscroll-contain {
overscroll-behavior: contain;
}
/* Re-enable selection for inputs */
input, textarea {
user-select: text;
-webkit-user-select: text;
}
.no-scrollbar::-webkit-scrollbar {
display: none;
}
.no-scrollbar {
-ms-overflow-style: none;
scrollbar-width: none;
}
/* 阅读器细滚动条(明暗主题通用,半透明) */
.vr-reader-scroll {
scrollbar-width: thin;
scrollbar-color: rgba(140,140,140,0.35) transparent;
}
.vr-reader-scroll::-webkit-scrollbar {
width: 5px;
}
.vr-reader-scroll::-webkit-scrollbar-track {
background: transparent;
}
.vr-reader-scroll::-webkit-scrollbar-thumb {
background: rgba(140,140,140,0.35);
border-radius: 999px;
}
.vr-reader-scroll::-webkit-scrollbar-thumb:hover {
background: rgba(140,140,140,0.55);
}
input:focus, textarea:focus, select:focus {
outline: none;
}
/* Utility for Safe Area —— 统一引用单一来源变量 */
.pb-safe {
padding-bottom: var(--safe-bottom);
}
/* 软键盘弹出时(iosStandalone 在 body 上挂 .ios-keyboard-open),收掉底部给 home 条留的 safe 间隙,
让聊天输入栏直接贴住键盘:① 外壳容器不再把底边钉在 safe 上方,铺到可视区底;② 输入栏收掉自己的 pb-safe 白条。
键盘收起后 class 移除,两者各自回到 safe 让位。app 高度跟随可视区由 utils/iosStandalone.ts 处理。 */
.sully-chat-inputbar {
transition: padding-bottom 0.18s ease-out;
}
body.ios-keyboard-open .sully-shell-content {
bottom: 0 !important;
}
body.ios-keyboard-open .sully-chat-inputbar {
padding-bottom: 0;
}
</style>
<script type="importmap">
{
"imports": {
"react": "https://esm.sh/react@^19.2.3",
"react-dom/": "https://esm.sh/react-dom@^19.2.3/",
"react/": "https://esm.sh/react@^19.2.3/",
"vite": "https://esm.sh/vite@^7.3.0",
"@vitejs/plugin-react": "https://esm.sh/@vitejs/plugin-react@^5.1.2",
"@capacitor/app": "https://esm.sh/@capacitor/app@^8.0.0",
"@capacitor/status-bar": "https://esm.sh/@capacitor/status-bar@^8.0.0",
"@capacitor/core": "https://esm.sh/@capacitor/core@^8.0.0",
"@capacitor/share": "https://esm.sh/@capacitor/share@^8.0.0",
"@capacitor/filesystem": "https://esm.sh/@capacitor/filesystem@^8.0.0",
"@capacitor/local-notifications": "https://esm.sh/@capacitor/local-notifications@^6.0.0",
"pdfjs-dist": "https://esm.sh/pdfjs-dist@3.11.174",
"katex": "https://esm.sh/katex@0.16.9"
}
}
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/index.tsx"></script>
</body>
</html>