diff --git a/configs.js b/configs.js index 7a2554f..b1df250 100644 --- a/configs.js +++ b/configs.js @@ -34,7 +34,8 @@ const CONFIGS = { }, autoHideMenuBar: true, useContentSize: true, - icon: getIcon() + icon: getIcon(), + enableLargerThanScreen: true }, MANAGER_WINDOW_CONFIG: { width: 1280, // + 16, diff --git a/index.js b/index.js index 80aa197..4f15263 100644 --- a/index.js +++ b/index.js @@ -322,7 +322,7 @@ const windowControl = { 'file://' + path.join(toolInfo.filesDir, indexPage) ) case 'update-user-config': - userConfigs = require('configs-user.json') + userConfigs = require('./configs-user.json') break default: break diff --git a/manager/iconfont.eot b/manager/iconfont.eot index 8391fd8..1c4609c 100644 Binary files a/manager/iconfont.eot and b/manager/iconfont.eot differ diff --git a/manager/iconfont.ttf b/manager/iconfont.ttf index 520b699..d9bbe02 100644 Binary files a/manager/iconfont.ttf and b/manager/iconfont.ttf differ diff --git a/manager/iconfont.woff b/manager/iconfont.woff index 68e7552..a6dfd61 100644 Binary files a/manager/iconfont.woff and b/manager/iconfont.woff differ diff --git a/manager/index.html b/manager/index.html index bfa802e..93c5a5d 100644 --- a/manager/index.html +++ b/manager/index.html @@ -74,7 +74,23 @@

强制开启语音报番型

-
+
+ +
+

窗口

+ +

更新

+ +
+
服务器: 加载中 { ) }) /* 检查更新业务逻辑 End */ + +/* 设置项业务逻辑 Start */ +const getKeyText = key => { + const lang = { + window: '窗口', + isKioskModeOn: '使用原生全屏幕模式(Kiosk)', + update: '更新', + prerelease: '获取浏览版(Pre-release)', + chromium: '核心(需要重启软件)', + isHardwareAccelerationDisable: '关闭硬件加速(Hardware Acceleration)' + } + return lang[key] ? lang[key] : false +} +const userConfig = require('../configs-user.json') +const settingInner = document.getElementById('settingInner') +settingInner.innerHTML = '' +Object.entries(userConfig).forEach(([keyGroup, value]) => { + const groupName = getKeyText(keyGroup) + const h3 = document.createElement('h3') + h3.innerText = groupName + settingInner.append(h3) + Object.entries(value).forEach(([keyConfig, value], index) => { + const selectName = getKeyText(keyConfig) + const input = document.createElement('input') + input.type = 'checkbox' + const label = document.createElement('label') + input.id = 'config' + keyGroup + keyConfig + index + label.setAttribute('for', input.id) + label.innerText = selectName + input.checked = value + input.addEventListener('change', e => { + userConfig[keyGroup][keyConfig] = input.checked + }) + settingInner.append(input) + settingInner.append(label) + }) +}) +const saveConfigsBtn = document.getElementById('saveConfigs') +saveConfigsBtn.addEventListener('click', e => { + try { + fs.writeSync('../configs-user.json', JSON.stringify(userConfig)) + alert('保存成功') + } catch (error) { + alert('保存失败\n' + error) + } +}) + +/* 设置项业务逻辑 End */ diff --git a/manager/style.css b/manager/style.css index 58dec7f..9684b63 100644 --- a/manager/style.css +++ b/manager/style.css @@ -83,6 +83,41 @@ user-select: none; font-family: '思源黑体 CN', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } +*::-webkit-scrollbar { + width: 8px; +} +*::-webkit-scrollbar-button { + height: 0; + display: none; + background-color: transparent; +} +*::-webkit-scrollbar-track-piece { + background-color: transparent; + padding-right: 8px; +} +*::-webkit-scrollbar-thumb { + width: 8px; + border-radius: 4px; + min-height: 64px; + max-height: 128px; + height: auto; + background-color: rgba(0, 0, 0, 0); + -webkit-transition: background-color var(--animation-time) var(--ease-in-out); + transition: background-color var(--animation-time) var(--ease-in-out); +} +*:hover::-webkit-scrollbar-thumb { + background-color: rgba(0, 0, 0, 0.1); +} +*:hover::-webkit-scrollbar-thumb:hover { + background-color: rgba(0, 0, 0, 0.15); + -webkit-transition: background-color 0; + transition: background-color 0; +} +*:hover::-webkit-scrollbar-thumb:active { + background-color: rgba(0, 0, 0, 0.2); + -webkit-transition: background-color 0; + transition: background-color 0; +} button { outline: none !important; @@ -208,41 +243,6 @@ h1 { overflow-y: auto; padding-left: 102px; } -.main-context > section > div.info-cards::-webkit-scrollbar { - width: 8px; -} -.main-context > section > div.info-cards::-webkit-scrollbar-button { - height: 0; - display: none; - background-color: transparent; -} -.main-context > section > div.info-cards::-webkit-scrollbar-track-piece { - background-color: transparent; - padding-right: 8px; -} -.main-context > section > div.info-cards::-webkit-scrollbar-thumb { - width: 8px; - border-radius: 4px; - min-height: 64px; - max-height: 128px; - height: auto; - background-color: rgba(0, 0, 0, 0); - -webkit-transition: background-color var(--animation-time) var(--ease-in-out); - transition: background-color var(--animation-time) var(--ease-in-out); -} -.main-context > section > div.info-cards:hover::-webkit-scrollbar-thumb { - background-color: rgba(0, 0, 0, 0.1); -} -.main-context > section > div.info-cards:hover::-webkit-scrollbar-thumb:hover { - background-color: rgba(0, 0, 0, 0.15); - -webkit-transition: background-color 0; - transition: background-color 0; -} -.main-context > section > div.info-cards:hover::-webkit-scrollbar-thumb:active { - background-color: rgba(0, 0, 0, 0.2); - -webkit-transition: background-color 0; - transition: background-color 0; -} .main-context > section > div.info-cards > article { width: 400px; height: 144px; @@ -398,8 +398,67 @@ h1 { display: none; } .main-context > section[data-name='settingPage'] { - padding-left: 102px; - padding-top: 16px; + padding: 40px 0 20px 102px; +} +.main-context > section[data-name='settingPage'] > .save-btn { + left: 102px; +} +.main-context > section[data-name='settingPage'] > .save-btn::before { + content: ''; +} +.main-context > section[data-name='settingPage'] > .setting-innner { + height: 100%; + width: calc(100% - 16px); + overflow-y: auto; +} +.main-context > section[data-name='settingPage'] > .setting-innner > h3 { + cursor: default; +} +.main-context > section[data-name='settingPage'] > .setting-innner > input { + display: none; +} +.main-context > section[data-name='settingPage'] > .setting-innner > input[type='checkbox'] + label { + width: -webkit-max-content; + width: -moz-max-content; + width: max-content; + line-height: 20px; + font-size: 14px; + cursor: pointer; + outline: none !important; + display: block; + padding-left: 16px; +} +.main-context > section[data-name='settingPage'] > .setting-innner > input[type='checkbox'] + label::before { + content: ' '; + display: inline-block; + width: 32px; + height: 16px; + border-radius: 8px; + position: relative; + top: 3px; + right: 12px; + background-color: var(--switch-disable-color); + -webkit-transition: background-color var(--animation-time) var(--ease-in-out); + transition: background-color var(--animation-time) var(--ease-in-out); +} +.main-context > section[data-name='settingPage'] > .setting-innner > input[type='checkbox'] + label::after { + content: ' '; + display: block; + width: 12px; + height: 12px; + border-radius: 6px; + position: relative; + left: -10px; + bottom: 16px; + background-color: var(--switch-ball-color); + -webkit-transition: left var(--animation-time) var(--ease-in-out); + transition: left var(--animation-time) var(--ease-in-out); +} +.main-context > section[data-name='settingPage'] > .setting-innner > input[type='checkbox']:checked + label::before { + background-color: var(--switch-able-color); +} +.main-context > section[data-name='settingPage'] > .setting-innner > input[type='checkbox']:checked + label::after { + left: calc(-12px - 2px + 20px); } .main-context > .left-pannel { height: var(--main-height); diff --git a/manager/style.scss b/manager/style.scss index f5485c1..cd86c6b 100644 --- a/manager/style.scss +++ b/manager/style.scss @@ -89,6 +89,41 @@ font-weight: 400; user-select: none; font-family: '思源黑体 CN', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + + &::-webkit-scrollbar { + width: 8px; + } + &::-webkit-scrollbar-button { + height: 0; + display: none; + background-color: transparent; + } + &::-webkit-scrollbar-track-piece { + background-color: transparent; + padding-right: 8px; + } + &::-webkit-scrollbar-thumb { + width: 8px; + border-radius: 4px; + min-height: 64px; + max-height: 128px; + height: auto; + background-color: rgba(0, 0, 0, 0); + transition: background-color var(--animation-time) var(--ease-in-out); + } + &:hover { + &::-webkit-scrollbar-thumb { + background-color: rgba(0, 0, 0, 0.1); + } + &::-webkit-scrollbar-thumb:hover { + background-color: rgba(0, 0, 0, 0.15); + transition: background-color 0; + } + &::-webkit-scrollbar-thumb:active { + background-color: rgba(0, 0, 0, 0.2); + transition: background-color 0; + } + } } button { outline: none !important; @@ -211,40 +246,6 @@ h1 { top: 40px; overflow-y: auto; padding-left: 102px; - &::-webkit-scrollbar { - width: 8px; - } - &::-webkit-scrollbar-button { - height: 0; - display: none; - background-color: transparent; - } - &::-webkit-scrollbar-track-piece { - background-color: transparent; - padding-right: 8px; - } - &::-webkit-scrollbar-thumb { - width: 8px; - border-radius: 4px; - min-height: 64px; - max-height: 128px; - height: auto; - background-color: rgba(0, 0, 0, 0); - transition: background-color var(--animation-time) var(--ease-in-out); - } - &:hover { - &::-webkit-scrollbar-thumb { - background-color: rgba(0, 0, 0, 0.1); - } - &::-webkit-scrollbar-thumb:hover { - background-color: rgba(0, 0, 0, 0.15); - transition: background-color 0; - } - &::-webkit-scrollbar-thumb:active { - background-color: rgba(0, 0, 0, 0.2); - transition: background-color 0; - } - } & > article { width: 400px; @@ -403,8 +404,69 @@ h1 { } &[data-name='settingPage'] { - padding-left: 102px; - padding-top: 16px; + padding: 40px 0 20px 102px; + + & > .save-btn { + left: 102px; + &::before { + content: ''; + } + } + & > .setting-innner { + height: 100%; + width: calc(100% - 16px); + overflow-y: auto; + + & > h3 { + cursor: default; + } + & > input { + display: none; + } + & > input[type='checkbox'] + label { + width: max-content; + line-height: 20px; + font-size: 14px; + cursor: pointer; + outline: none !important; + display: block; + padding-left: 16px; + &::before { + content: ' '; + display: inline-block; + width: 32px; + height: 16px; + border-radius: 8px; + position: relative; + top: 3px; + right: 12px; + // bottom: 16px; + background-color: var(--switch-disable-color); + transition: background-color var(--animation-time) + var(--ease-in-out); + } + &::after { + content: ' '; + display: block; + width: 12px; + height: 12px; + border-radius: 6px; + position: relative; + left: -10px; + bottom: 16px; + background-color: var(--switch-ball-color); + transition: left var(--animation-time) var(--ease-in-out); + } + } + & > input[type='checkbox']:checked + label { + &::before { + background-color: var(--switch-able-color); + } + &::after { + left: calc(-12px - 2px + 20px); + } + } + } } } & > .left-pannel { diff --git a/package.json b/package.json index 017b399..8cdabef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "majsoul-plus-client", - "version": "1.6.0-alpha.1", + "version": "1.6.0-beta.1", "productName": "Majsoul Plus", "author": "MajsoulPlus Team", "description": "Majsoul Plus",