setting.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>设置中心</title>
  7. <!-- Ionic 组件库 -->
  8. <link href="https://cdn.jsdelivr.net/npm/@ionic/core/css/ionic.bundle.css" rel="stylesheet">
  9. <script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.esm.js"></script>
  10. <script nomodule src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.js"></script>
  11. <style>
  12. :root {
  13. /* 基础中性色 */
  14. --bg-light: #FAFAFA;
  15. --surface: #FFFFFF;
  16. --border: #E0E0E0;
  17. /* 文本颜色 */
  18. --text-primary: #212121;
  19. --text-secondary: #424242;
  20. /* 主辅点缀色 */
  21. --primary: #6200EE;
  22. --secondary: #018786;
  23. --accent: #FFB300;
  24. /* 年度色彩 */
  25. --pantone-2025: #BFA6A0; /* Mocha Mousse */
  26. --bm-2025: #8E5F56; /* Cinnamon Slate */
  27. /* 额外点缀色 */
  28. --accent-alt: #FF6F61; /* 活力暖粉 */
  29. /* 圆角和间距 */
  30. --radius: 8px;
  31. --gap: 20px;
  32. --ion-font-family: "MiSans", system-ui;
  33. }
  34. body {
  35. background: var(--bg-light);
  36. color: var(--text-primary);
  37. font-family: var(--ion-font-family);
  38. display: grid;
  39. grid-template-columns: 220px 1fr;
  40. min-height: 100vh;
  41. margin: 0;
  42. }
  43. /* 优化后的侧边导航 */
  44. .sidebar {
  45. width: 220px;
  46. background: var(--surface);
  47. padding: 16px 12px;
  48. box-shadow: 2px 0 12px rgba(0,0,0,0.05);
  49. }
  50. .nav-group {
  51. margin-bottom: 2.5rem;
  52. }
  53. .nav-group-title {
  54. font-size: 0.85rem;
  55. color: var(--text-secondary);
  56. margin: 8px 0;
  57. text-transform: uppercase;
  58. letter-spacing: 0.5px;
  59. }
  60. ion-item.nav-item {
  61. --background: transparent;
  62. --border-color: transparent;
  63. --padding-start: 14px;
  64. --min-height: 44px;
  65. margin: 6px 0;
  66. border-radius: var(--radius);
  67. transition: background-color 0.2s ease, transform 0.1s ease;
  68. }
  69. ion-item.nav-item ion-icon {
  70. font-size: 1.2rem;
  71. margin-right: 12px;
  72. color: var(--primary);
  73. transition: color 0.2s ease;
  74. }
  75. ion-item.nav-item:hover {
  76. background-color: rgba(98,0,238,0.1);
  77. transform: translateX(4px);
  78. }
  79. ion-item.nav-item[aria-selected="true"] {
  80. --background: rgba(98,0,238,0.2);
  81. }
  82. /* 主内容区 */
  83. .main-content {
  84. padding: 2rem;
  85. display: flex;
  86. flex-direction: column;
  87. gap: var(--gap);
  88. max-width: 1200px;
  89. }
  90. .settings-card {
  91. background: var(--surface);
  92. border-radius: var(--radius);
  93. padding: 1.5rem;
  94. box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  95. border: 1px solid var(--border);
  96. }
  97. .settings-card-header {
  98. display: flex;
  99. justify-content: space-between;
  100. align-items: center;
  101. margin-bottom: 1.5rem;
  102. }
  103. .settings-card-title {
  104. font-size: 1.25rem;
  105. font-weight: 500;
  106. color: var(--primary);
  107. }
  108. .settings-grid {
  109. display: grid;
  110. grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  111. gap: 1.5rem;
  112. }
  113. /* 自定义Ionic组件样式 */
  114. ion-toggle::part(track) {
  115. background: var(--border);
  116. height: 24px;
  117. width: 48px;
  118. border-radius: 12px;
  119. transition: background-color 0.2s ease;
  120. }
  121. ion-toggle::part(handle) {
  122. width: 20px;
  123. height: 20px;
  124. top: 2px;
  125. }
  126. ion-button::part(native) {
  127. text-transform: none;
  128. letter-spacing: normal;
  129. background-color: var(--accent);
  130. color: var(--surface);
  131. border-radius: var(--radius);
  132. box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  133. transition: background-color 0.2s ease, box-shadow 0.2s ease;
  134. }
  135. ion-button::part(native):hover {
  136. background-color: var(--accent-alt);
  137. box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  138. }
  139. ion-range::part(bar) {
  140. background: var(--border);
  141. height: 4px;
  142. }
  143. ion-range::part(bar-active) {
  144. background: var(--primary);
  145. }
  146. /* 高级设置区 */
  147. .advanced-settings {
  148. border-top: 1px solid var(--border);
  149. margin-top: 1.5rem;
  150. padding-top: 1.5rem;
  151. }
  152. /* 版本信息 */
  153. .version-info {
  154. margin-top: auto;
  155. text-align: center;
  156. color: var(--text-secondary);
  157. padding: 2rem;
  158. font-size: 0.9rem;
  159. }
  160. </style>
  161. </head>
  162. <body>
  163. <!-- 侧边导航 -->
  164. <nav class="sidebar">
  165. <div class="nav-group">
  166. <div class="nav-group-title">核心设置</div>
  167. <ion-item class="nav-item" button aria-selected="true">
  168. <ion-icon name="desktop" slot="start"></ion-icon>
  169. <ion-label>图形设置</ion-label>
  170. </ion-item>
  171. <ion-item class="nav-item" button>
  172. <ion-icon name="settings" slot="start"></ion-icon>
  173. <ion-label>系统设置</ion-label>
  174. </ion-item>
  175. <ion-item class="nav-item" button>
  176. <ion-icon name="chatbubbles" slot="start"></ion-icon>
  177. <ion-label>互动设置</ion-label>
  178. </ion-item>
  179. </div>
  180. <div class="nav-group">
  181. <div class="nav-group-title">扩展功能</div>
  182. <ion-item class="nav-item" button>
  183. <ion-icon name="extension-puzzle" slot="start"></ion-icon>
  184. <ion-label>MOD管理</ion-label>
  185. </ion-item>
  186. <ion-item class="nav-item" button>
  187. <ion-icon name="medkit" slot="start"></ion-icon>
  188. <ion-label>诊断与反馈</ion-label>
  189. </ion-item>
  190. <ion-item class="nav-item" button>
  191. <ion-icon name="information-circle" slot="start"></ion-icon>
  192. <ion-label>关于</ion-label>
  193. </ion-item>
  194. </div>
  195. </nav>
  196. <!-- 主内容区 -->
  197. <main class="main-content">
  198. <!-- 系统设置 -->
  199. <div class="settings-card">
  200. <div class="settings-card-header">
  201. <h2 class="settings-card-title">系统设置</h2>
  202. <ion-button fill="clear" size="small">
  203. <ion-icon name="help-circle" slot="start"></ion-icon>
  204. 帮助
  205. </ion-button>
  206. </div>
  207. <div class="settings-grid">
  208. <ion-item>
  209. <ion-label position="stacked">置于顶层</ion-label>
  210. <ion-toggle checked></ion-toggle>
  211. </ion-item>
  212. <ion-item>
  213. <ion-label position="stacked">开机启动</ion-label>
  214. <ion-select value="steam">
  215. <ion-select-option value="disabled">禁用</ion-select-option>
  216. <ion-select-option value="system">系统启动</ion-select-option>
  217. <ion-select-option value="steam">Steam启动</ion-select-option>
  218. </ion-select>
  219. </ion-item>
  220. <ion-item>
  221. <ion-label position="stacked">缩放等级 (85%)</ion-label>
  222. <ion-range min="50" max="150" value="85">
  223. <ion-icon name="remove" slot="start"></ion-icon>
  224. <ion-icon name="add" slot="end"></ion-icon>
  225. </ion-range>
  226. </ion-item>
  227. </div>
  228. </div>
  229. <!-- 数据管理 -->
  230. <div class="settings-card">
  231. <div class="settings-card-header">
  232. <h2 class="settings-card-title">数据管理</h2>
  233. <ion-button fill="clear" size="small">
  234. <ion-icon name="time" slot="start"></ion-icon>
  235. 历史版本
  236. </ion-button>
  237. </div>
  238. <div class="settings-grid">
  239. <ion-item>
  240. <ion-label position="stacked">自动保存频率</ion-label>
  241. <ion-input type="number" value="20" min="5" max="60"></ion-input>
  242. <ion-note slot="end">分钟</ion-note>
  243. </ion-item>
  244. <ion-item>
  245. <ion-label position="stacked">最大备份数量</ion-label>
  246. <ion-input type="number" value="50" min="10" max="100"></ion-input>
  247. </ion-item>
  248. <ion-item>
  249. <ion-label>从备份还原</ion-label>
  250. <ion-button slot="end" fill="outline">
  251. <ion-icon name="cloud-download" slot="start"></ion-icon>
  252. 加载存档
  253. </ion-button>
  254. </ion-item>
  255. </div>
  256. </div>
  257. <!-- 高级互动设置 -->
  258. <div class="settings-card">
  259. <div class="settings-card-header">
  260. <h2 class="settings-card-title">高级互动设置</h2>
  261. <ion-button fill="clear" size="small">
  262. <ion-icon name="alert-circle" slot="start"></ion-icon>
  263. 实验性功能
  264. </ion-button>
  265. </div>
  266. <div class="settings-grid">
  267. <ion-item>
  268. <ion-label position="stacked">计算间隔</ion-label>
  269. <ion-input type="number" value="14.0" step="0.1"></ion-input>
  270. <ion-note slot="end">秒</ion-note>
  271. </ion-item>
  272. <ion-item>
  273. <ion-label position="stacked">互动周期</ion-label>
  274. <ion-input type="number" value="200" min="100" max="500"></ion-input>
  275. </ion-item>
  276. <ion-item>
  277. <ion-label>移动范围设置</ion-label>
  278. <div slot="end" style="display: flex; gap: 8px;">
  279. <ion-button size="small">
  280. <ion-icon name="expand" slot="start"></ion-icon>
  281. 重置为主屏
  282. </ion-button>
  283. <ion-button size="small" fill="outline">
  284. 自定范围
  285. </ion-button>
  286. </div>
  287. </ion-item>
  288. </div>
  289. <div class="advanced-settings">
  290. <ion-item>
  291. <ion-label>智能移动判断</ion-label>
  292. <ion-input type="number" value="30" slot="end"></ion-input>
  293. <ion-note slot="end">秒</ion-note>
  294. </ion-item>
  295. <ion-item>
  296. <ion-label>音量触发阈值</ion-label>
  297. <ion-range dual-knobs min="0" max="100" value="80,90">
  298. <ion-icon name="volume-low" slot="start"></ion-icon>
  299. <ion-icon name="volume-high" slot="end"></ion-icon>
  300. </ion-range>
  301. </ion-item>
  302. </div>
  303. </div>
  304. <!-- MOD管理 -->
  305. <div class="settings-card">
  306. <div class="settings-card-header">
  307. <h2 class="settings-card-title">MOD管理</h2>
  308. <ion-button fill="clear" size="small">
  309. <ion-icon name="logo-steam" slot="start"></ion-icon>
  310. Workshop
  311. </ion-button>
  312. </div>
  313. <div class="settings-grid">
  314. <ion-item>
  315. <ion-label>语音增强包</ion-label>
  316. <ion-toggle slot="end"></ion-toggle>
  317. </ion-item>
  318. <ion-item>
  319. <ion-label>动画扩展包</ion-label>
  320. <ion-badge color="warning" slot="end">v2.1.5</ion-badge>
  321. </ion-item>
  322. <ion-item>
  323. <ion-label>界面主题包</ion-label>
  324. <ion-button slot="end" fill="clear">
  325. <ion-icon name="color-palette"></ion-icon>
  326. </ion-button>
  327. </ion-item>
  328. <ion-item>
  329. <ion-button expand="block">
  330. <ion-icon name="add-circle" slot="start"></ion-icon>
  331. 添加MOD
  332. </ion-button>
  333. </ion-item>
  334. </div>
  335. </div>
  336. <!-- 版本信息 -->
  337. <div class="version-info">
  338. <ion-text color="medium">
  339. <p>当前版本 v1.10.48 x64</p>
  340. <p>Power By exLB.net 洛里斯杨远</p>
  341. <p>开源协议:MIT License</p>
  342. </ion-text>
  343. </div>
  344. </main>
  345. <script>
  346. // 初始化Ionic组件
  347. customElements.whenDefined('ion-toggle').then(() => {
  348. // 开关状态同步
  349. document.querySelectorAll('ion-toggle').forEach(toggle => {
  350. toggle.addEventListener('ionChange', (e) => {
  351. console.log(`Toggle ${e.target.checked ? '开启' : '关闭'}`);
  352. });
  353. });
  354. // 范围选择器交互
  355. document.querySelectorAll('ion-range').forEach(range => {
  356. range.addEventListener('ionChange', (e) => {
  357. console.log('范围值变更:', e.target.value);
  358. });
  359. });
  360. // 按钮点击事件
  361. document.querySelectorAll('ion-button').forEach(button => {
  362. button.addEventListener('click', (e) => {
  363. const target = e.target.closest('ion-button');
  364. console.log('按钮点击:', target.innerText.trim());
  365. });
  366. });
  367. // 表单验证
  368. document.querySelectorAll('ion-input').forEach(input => {
  369. input.addEventListener('ionInput', (e) => {
  370. const value = parseFloat(e.target.value);
  371. const min = parseFloat(e.target.min) || -Infinity;
  372. const max = parseFloat(e.target.max) || Infinity;
  373. if (value < min) e.target.value = min;
  374. if (value > max) e.target.value = max;
  375. });
  376. });
  377. });
  378. // 动态加载示例
  379. setTimeout(() => {
  380. const loadingToast = document.createElement('ion-toast');
  381. loadingToast.message = '设置加载完成';
  382. loadingToast.duration = 2000;
  383. document.body.appendChild(loadingToast);
  384. loadingToast.present();
  385. }, 1000);
  386. </script>
  387. </body>
  388. </html>