mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-07-02 05:52:46 +08:00
systemDialog样式根据操作系统改变
This commit is contained in:
parent
d64f00a8b4
commit
b71f47ec56
@ -25,6 +25,9 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
document.getElementById("content").textContent = config.content;
|
document.getElementById("content").textContent = config.content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加平台类名
|
||||||
|
document.body.classList.add(`platform-${config.platform}`);
|
||||||
|
|
||||||
// 根据类型设置不同的对话框内容
|
// 根据类型设置不同的对话框内容
|
||||||
switch (config.type) {
|
switch (config.type) {
|
||||||
case "message":
|
case "message":
|
||||||
|
@ -1,19 +1,25 @@
|
|||||||
const { ipcRenderer } = require("electron");
|
const { ipcRenderer } = require("electron");
|
||||||
|
const os = require("os");
|
||||||
const { createBrowserWindow } = utools;
|
const { createBrowserWindow } = utools;
|
||||||
/**
|
/**
|
||||||
* 创建对话框窗口
|
* 创建对话框窗口
|
||||||
* @param {object} config - 对话框配置
|
* @param {object} config - 对话框配置
|
||||||
* @param {object} [customOptions] - 自定义窗口选项
|
* @param {object} [customDialogOptions] - 自定义窗口选项
|
||||||
* @returns {Promise} 返回对话框结果
|
* @returns {Promise} 返回对话框结果
|
||||||
*/
|
*/
|
||||||
const createDialog = (config, customOptions = {}) => {
|
const createDialog = (config, customDialogOptions = {}) => {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
const dialogPath = "lib/dialog/view.html";
|
const dialogPath = "lib/dialog/view.html";
|
||||||
const preloadPath = "lib/dialog/controller.js";
|
const preloadPath = "lib/dialog/controller.js";
|
||||||
|
|
||||||
|
const platform = os.platform();
|
||||||
|
|
||||||
|
const dialogWidth =
|
||||||
|
platform === "win32" && config.type !== "textarea" ? 370 : 470;
|
||||||
|
|
||||||
const dialogOptions = {
|
const dialogOptions = {
|
||||||
title: config.title || "对话框",
|
title: config.title || "对话框",
|
||||||
width: 470,
|
width: dialogWidth,
|
||||||
height: 80,
|
height: 80,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
minimizable: false,
|
minimizable: false,
|
||||||
@ -27,7 +33,7 @@ const createDialog = (config, customOptions = {}) => {
|
|||||||
preload: preloadPath,
|
preload: preloadPath,
|
||||||
devTools: utools.isDev(),
|
devTools: utools.isDev(),
|
||||||
},
|
},
|
||||||
...customOptions, // 合并自定义选项
|
...customDialogOptions, // 合并自定义选项
|
||||||
};
|
};
|
||||||
|
|
||||||
// 创建窗口
|
// 创建窗口
|
||||||
@ -48,7 +54,7 @@ const createDialog = (config, customOptions = {}) => {
|
|||||||
const newBounds = {
|
const newBounds = {
|
||||||
x: Math.round(bounds.x),
|
x: Math.round(bounds.x),
|
||||||
y: Math.max(0, y), // 确保不会超出屏幕顶部
|
y: Math.max(0, y), // 确保不会超出屏幕顶部
|
||||||
width: 470,
|
width: dialogWidth,
|
||||||
height: Math.round(height),
|
height: Math.round(height),
|
||||||
};
|
};
|
||||||
// 设置新的位置和大小
|
// 设置新的位置和大小
|
||||||
@ -68,6 +74,7 @@ const createDialog = (config, customOptions = {}) => {
|
|||||||
ipcRenderer.sendTo(UBrowser.webContents.id, "dialog-config", {
|
ipcRenderer.sendTo(UBrowser.webContents.id, "dialog-config", {
|
||||||
...config,
|
...config,
|
||||||
isDark: utools.isDarkColors(),
|
isDark: utools.isDarkColors(),
|
||||||
|
platform,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
:root {
|
:root {
|
||||||
--bg-color: #fff;
|
--bg-color: #fff;
|
||||||
--text-color: #333;
|
--text-color: #333;
|
||||||
--border-color: #ddd;
|
--border-color: #ddd;
|
||||||
@ -11,9 +11,30 @@
|
|||||||
--button-text: #fff;
|
--button-text: #fff;
|
||||||
--cancel-bg: #6c757d;
|
--cancel-bg: #6c757d;
|
||||||
--cancel-border: #6c757d;
|
--cancel-border: #6c757d;
|
||||||
}
|
--mac-close-btn: #ff5f57;
|
||||||
|
--win-title-bg: #F9F1EF;
|
||||||
|
--win-button-bar-bg: #F0F0F0;
|
||||||
|
--win-button-bg: #fdfdfd;
|
||||||
|
--win-button-hover-border: #3C96DB;
|
||||||
|
--win-button-hover-bg: #E0EEF9;
|
||||||
|
--win-close-hover: #e81123;
|
||||||
|
--mac-close-x: rgba(0, 0, 0, 0.5);
|
||||||
|
--win-border: rgba(0, 0, 0, 0.1);
|
||||||
|
--win-text: #000;
|
||||||
|
--win-text-dark: #fdfdfd;
|
||||||
|
--select-item-hover: rgba(13, 110, 253, 0.1);
|
||||||
|
--select-item-hover-dark: rgba(13, 110, 253, 0.2);
|
||||||
|
--select-item-shadow: rgba(0, 0, 0, 0.02);
|
||||||
|
--select-item-shadow-dark: rgba(0, 0, 0, 0.1);
|
||||||
|
--select-description: rgba(0, 0, 0, 0.6);
|
||||||
|
--select-description-dark: rgba(255, 255, 255, 0.6);
|
||||||
|
--highlight-color: #ec3535;
|
||||||
|
--wait-btn-hover: #ec3535;
|
||||||
|
--scrollbar-thumb: rgba(0, 0, 0, 0.3);
|
||||||
|
--scrollbar-thumb-dark: rgba(255, 255, 255, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
:root[data-theme="dark"] {
|
:root[data-theme="dark"] {
|
||||||
--bg-color: #282727;
|
--bg-color: #282727;
|
||||||
--text-color: #e0e0e0;
|
--text-color: #e0e0e0;
|
||||||
--border-color: #404040;
|
--border-color: #404040;
|
||||||
@ -22,9 +43,13 @@
|
|||||||
--input-border: #404040;
|
--input-border: #404040;
|
||||||
--cancel-bg: #4a4a4a;
|
--cancel-bg: #4a4a4a;
|
||||||
--cancel-border: #4a4a4a;
|
--cancel-border: #4a4a4a;
|
||||||
}
|
--win-title-bg: #17040B;
|
||||||
|
--win-button-bar-bg: #1C1C1C;
|
||||||
|
--win-button-bg: #353B3A;
|
||||||
|
--content-bg: #191919;
|
||||||
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
||||||
@ -36,154 +61,236 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 自定义滚动条样式 */
|
/* 自定义滚动条样式 */
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 4px;
|
width: 4px;
|
||||||
height: 4px;
|
height: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-track {
|
::-webkit-scrollbar-track {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb {
|
::-webkit-scrollbar-thumb {
|
||||||
background: rgba(0, 0, 0, 0);
|
background: rgba(0, 0, 0, 0);
|
||||||
transition: background-color 0.3s;
|
transition: background-color 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
:root[data-theme="dark"] ::-webkit-scrollbar-thumb {
|
:root[data-theme="dark"] ::-webkit-scrollbar-thumb {
|
||||||
background: rgba(255, 255, 255, 0);
|
background: rgba(255, 255, 255, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 悬浮时显示滚动条 */
|
/* 悬浮时显示滚动条 */
|
||||||
*:hover::-webkit-scrollbar-thumb {
|
*:hover::-webkit-scrollbar-thumb {
|
||||||
background: rgba(0, 0, 0, 0.3);
|
background: var(--scrollbar-thumb);
|
||||||
transition: background-color 0.3s;
|
transition: background-color 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
:root[data-theme="dark"] *:hover::-webkit-scrollbar-thumb {
|
:root[data-theme="dark"] *:hover::-webkit-scrollbar-thumb {
|
||||||
background: rgba(255, 255, 255, 0.3);
|
background: var(--scrollbar-thumb-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 标题栏样式 */
|
/* 标题栏样式 */
|
||||||
.title-bar {
|
.title-bar {
|
||||||
background: var(--title-bg);
|
background: var(--title-bg);
|
||||||
border-bottom: 1px solid var(--border-color);
|
padding: 2px 12px;
|
||||||
padding: 4px 12px;
|
|
||||||
-webkit-app-region: drag;
|
-webkit-app-region: drag;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
.title-left {
|
.title-text {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-left {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title-text {
|
.platform-darwin .title-left,
|
||||||
font-size: 13px;
|
.platform-linux .title-left {
|
||||||
font-weight: 500;
|
padding-left: 20px;
|
||||||
color: var(--text-color);
|
}
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.close-btn {
|
/* macOS 和 Linux 样式 */
|
||||||
-webkit-app-region: no-drag;
|
.platform-darwin .title-bar,
|
||||||
background-color: rgba(0, 0, 0, 0.05);
|
.platform-linux .title-bar {
|
||||||
width: 16px;
|
border-bottom: 1px solid var(--border-color);
|
||||||
height: 16px;
|
}
|
||||||
min-width: 16px;
|
|
||||||
min-height: 16px;
|
.platform-darwin .close-btn,
|
||||||
|
.platform-linux .close-btn {
|
||||||
|
position: absolute;
|
||||||
|
left: 8px;
|
||||||
|
top: 7px;
|
||||||
|
background-color: var(--mac-close-btn);
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
border-radius: 50%;
|
||||||
|
opacity: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
border-radius: 50%;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
opacity: 0.8;
|
-webkit-app-region: no-drag;
|
||||||
transition: all 0.2s;
|
}
|
||||||
margin-left: 8px;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root[data-theme="dark"] .close-btn {
|
.platform-darwin .close-btn::before,
|
||||||
background-color: rgba(255, 255, 255, 0.1);
|
.platform-darwin .close-btn::after,
|
||||||
}
|
.platform-linux .close-btn::before,
|
||||||
|
.platform-linux .close-btn::after {
|
||||||
.close-btn:hover {
|
|
||||||
opacity: 1;
|
|
||||||
background-color: #ff4d4d;
|
|
||||||
}
|
|
||||||
|
|
||||||
.close-btn::before,
|
|
||||||
.close-btn::after {
|
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 8px;
|
width: 8px;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
background-color: var(--text-color);
|
background-color: var(--mac-close-x);
|
||||||
transform-origin: center;
|
transform-origin: center;
|
||||||
}
|
opacity: 0;
|
||||||
|
transition: opacity 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
.close-btn::before {
|
.platform-darwin .close-btn::before,
|
||||||
|
.platform-linux .close-btn::before {
|
||||||
transform: rotate(45deg);
|
transform: rotate(45deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.close-btn::after {
|
.platform-darwin .close-btn::after,
|
||||||
|
.platform-linux .close-btn::after {
|
||||||
transform: rotate(-45deg);
|
transform: rotate(-45deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
.close-btn:hover::before,
|
.platform-darwin .close-btn:hover,
|
||||||
.close-btn:hover::after {
|
.platform-linux .close-btn:hover {
|
||||||
|
background-color: var(--mac-close-btn);
|
||||||
|
}
|
||||||
|
|
||||||
|
.platform-darwin .close-btn:hover::before,
|
||||||
|
.platform-darwin .close-btn:hover::after,
|
||||||
|
.platform-linux .close-btn:hover::before,
|
||||||
|
.platform-linux .close-btn:hover::after {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Windows 样式 */
|
||||||
|
.platform-win32 .title-bar {
|
||||||
|
padding: 4px 0 4px 12px;
|
||||||
|
background: var(--win-title-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
:root[data-theme="dark"] .platform-win32 .title-bar {
|
||||||
|
background: #17040B;
|
||||||
|
}
|
||||||
|
|
||||||
|
.platform-win32 .close-btn {
|
||||||
|
-webkit-app-region: no-drag;
|
||||||
|
width: 46px;
|
||||||
|
height: 32px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 0;
|
||||||
|
position: relative;
|
||||||
|
opacity: 1;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.platform-win32 .close-btn::before,
|
||||||
|
.platform-win32 .close-btn::after {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
width: 12px;
|
||||||
|
height: 1px;
|
||||||
|
background-color: var(--win-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
:root[data-theme="dark"] .platform-win32 .close-btn::before,
|
||||||
|
:root[data-theme="dark"] .platform-win32 .close-btn::after {
|
||||||
|
background-color: var(--win-text-dark);
|
||||||
|
}
|
||||||
|
|
||||||
|
.platform-win32 .close-btn::before {
|
||||||
|
transform: rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.platform-win32 .close-btn::after {
|
||||||
|
transform: rotate(-45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.platform-win32 .close-btn:hover {
|
||||||
|
background-color: var(--win-close-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.platform-win32 .close-btn:hover::before,
|
||||||
|
.platform-win32 .close-btn:hover::after {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
/* 按钮栏样式 */
|
||||||
|
.platform-win32 .button-bar {
|
||||||
|
padding: 6px 16px 12px 16px;
|
||||||
|
background: var(--win-button-bar-bg);
|
||||||
|
border-top: 1px solid #e0e0e0;
|
||||||
|
}
|
||||||
|
|
||||||
|
:root[data-theme="dark"] .platform-win32 .button-bar {
|
||||||
|
background: #1C1C1C;
|
||||||
|
border-top: 1px solid #1C1C1C;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content-wrapper {
|
.content-wrapper {
|
||||||
padding: 16px;
|
padding: 16px;
|
||||||
min-height: 60px;
|
min-height: 60px;
|
||||||
max-height: 449px;
|
max-height: 449px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 选择列表对话框的内容区域padding和高度 */
|
:root[data-theme="dark"] .content-wrapper {
|
||||||
.dialog-select .content-wrapper {
|
background: var(--content-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 选择列表对话框的内容区域padding和高度 */
|
||||||
|
.dialog-select .content-wrapper {
|
||||||
padding: 16px 8px;
|
padding: 16px 8px;
|
||||||
max-height: 600px;
|
max-height: 600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#content {
|
#content {
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
user-select: text;
|
user-select: text;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-bar {
|
.button-bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
padding: 0 16px 16px;
|
padding: 0 16px 16px;
|
||||||
|
background: var(--content-bg);
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
background: var(--bg-color);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
button {
|
||||||
padding: 4px 12px;
|
padding: 4px 12px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: 1px solid var(--button-bg);
|
border: 1px solid var(--button-bg);
|
||||||
@ -197,29 +304,52 @@
|
|||||||
min-width: 70px;
|
min-width: 70px;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
||||||
}
|
}
|
||||||
|
|
||||||
button:hover {
|
button:hover {
|
||||||
background: linear-gradient(180deg,
|
background: linear-gradient(180deg,
|
||||||
rgba(255, 255, 255, 0.1) 0%,
|
rgba(255, 255, 255, 0.1) 0%,
|
||||||
rgba(0, 0, 0, 0.05) 100%),
|
rgba(0, 0, 0, 0.05) 100%),
|
||||||
var(--button-hover);
|
var(--button-hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
button:active {
|
button:active {
|
||||||
background: linear-gradient(180deg,
|
background: linear-gradient(180deg,
|
||||||
rgba(0, 0, 0, 0.05) 0%,
|
rgba(0, 0, 0, 0.05) 0%,
|
||||||
rgba(255, 255, 255, 0.08) 100%),
|
rgba(255, 255, 255, 0.08) 100%),
|
||||||
var(--button-bg);
|
var(--button-bg);
|
||||||
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ok-btn {
|
.platform-win32 #ok-btn,
|
||||||
|
.platform-win32 #cancel-btn {
|
||||||
|
background: var(--win-button-bg);
|
||||||
|
color: var(--win-text);
|
||||||
|
border: 1px solid var(--win-border);
|
||||||
|
padding: 2px 12px;
|
||||||
|
height: 24px;
|
||||||
|
border-radius: 2px;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
:root[data-theme="dark"] .platform-win32 #ok-btn,
|
||||||
|
:root[data-theme="dark"] .platform-win32 #cancel-btn {
|
||||||
|
background: #353B3A;
|
||||||
|
color: var(--win-text-dark);
|
||||||
|
}
|
||||||
|
|
||||||
|
.platform-win32 #ok-btn:hover,
|
||||||
|
.platform-win32 #cancel-btn:hover {
|
||||||
|
border: 1px solid var(--win-button-hover-border);
|
||||||
|
background-color: var(--win-button-hover-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ok-btn {
|
||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cancel-btn {
|
#cancel-btn {
|
||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
background: linear-gradient(180deg,
|
background: linear-gradient(180deg,
|
||||||
rgba(255, 255, 255, 0.08) 0%,
|
rgba(255, 255, 255, 0.08) 0%,
|
||||||
@ -227,29 +357,29 @@
|
|||||||
var(--cancel-bg);
|
var(--cancel-bg);
|
||||||
border: 1px solid var(--cancel-border);
|
border: 1px solid var(--cancel-border);
|
||||||
height: 20px;
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cancel-btn:hover {
|
#cancel-btn:hover {
|
||||||
background: linear-gradient(180deg,
|
background: linear-gradient(180deg,
|
||||||
rgba(255, 255, 255, 0.1) 0%,
|
rgba(255, 255, 255, 0.2) 0%,
|
||||||
rgba(0, 0, 0, 0.05) 100%),
|
rgba(0, 0, 0, 0.1) 100%),
|
||||||
var(--cancel-bg);
|
var(--cancel-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#input-container {
|
#input-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-group label {
|
.input-group label {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 0 0 4px 2px;
|
padding: 0 0 4px 2px;
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-group input {
|
.input-group input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 6px 8px;
|
padding: 6px 8px;
|
||||||
border: 1px solid var(--input-border);
|
border: 1px solid var(--input-border);
|
||||||
@ -258,16 +388,16 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: var(--input-bg);
|
background: var(--input-bg);
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-group input:focus {
|
.input-group input:focus {
|
||||||
border-color: var(--input-focus);
|
border-color: var(--input-focus);
|
||||||
outline: none;
|
outline: none;
|
||||||
box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
|
box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 文本区域样式 */
|
/* 文本区域样式 */
|
||||||
textarea {
|
textarea {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 400px;
|
height: 400px;
|
||||||
padding: 6px 8px;
|
padding: 6px 8px;
|
||||||
@ -278,60 +408,60 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: var(--input-bg);
|
background: var(--input-bg);
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
textarea:focus {
|
textarea:focus {
|
||||||
border-color: var(--input-focus);
|
border-color: var(--input-focus);
|
||||||
outline: none;
|
outline: none;
|
||||||
box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
|
box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 按钮组样式 */
|
/* 按钮组样式 */
|
||||||
#button-container {
|
#button-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#button-container button {
|
#button-container button {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 6px 12px;
|
padding: 6px 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 根据对话框类型显示/隐藏取消按钮 */
|
/* 根据对话框类型显示/隐藏取消按钮 */
|
||||||
.dialog-message #cancel-btn {
|
.dialog-message #cancel-btn {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-buttons .button-bar {
|
.dialog-buttons .button-bar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 隐藏所有对话框内容 */
|
/* 隐藏所有对话框内容 */
|
||||||
#input,
|
#input,
|
||||||
#confirm,
|
#confirm,
|
||||||
#buttons,
|
#buttons,
|
||||||
#textarea,
|
#textarea,
|
||||||
#select {
|
#select {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 选择列表样式 */
|
/* 选择列表样式 */
|
||||||
.select-list {
|
.select-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
max-height: 505px;
|
max-height: 505px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-input {
|
.filter-input {
|
||||||
padding: 0 2px 8px 2px;
|
padding: 0 2px 8px 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-input input {
|
.filter-input input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 6px 8px;
|
padding: 6px 8px;
|
||||||
border: 1px solid var(--input-border);
|
border: 1px solid var(--input-border);
|
||||||
@ -340,23 +470,23 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: var(--input-bg);
|
background: var(--input-bg);
|
||||||
color: var(--text-color);
|
color: var(--text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-input input:focus {
|
.filter-input input:focus {
|
||||||
border-color: var(--input-focus);
|
border-color: var(--input-focus);
|
||||||
outline: none;
|
outline: none;
|
||||||
box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
|
box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-list-container {
|
.select-list-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
max-height: 360px;
|
max-height: 360px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-item {
|
.select-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 6px 8px;
|
padding: 6px 8px;
|
||||||
@ -366,146 +496,146 @@
|
|||||||
transform: translateY(0) scale(1);
|
transform: translateY(0) scale(1);
|
||||||
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
will-change: transform;
|
will-change: transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-item.selected {
|
.select-item.selected {
|
||||||
background-color: rgba(13, 110, 253, 0.1);
|
background-color: var(--select-item-hover);
|
||||||
position: relative;
|
position: relative;
|
||||||
transform: translateY(-1px) scale(0.995);
|
transform: translateY(-1px) scale(0.995);
|
||||||
will-change: transform;
|
will-change: transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-item-icon {
|
.select-item-icon {
|
||||||
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
will-change: transform;
|
will-change: transform;
|
||||||
padding-right: 8px;
|
padding-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-item.selected .select-item-icon {
|
.select-item.selected .select-item-icon {
|
||||||
transform: scale(1.05);
|
transform: scale(1.05);
|
||||||
filter: brightness(1.05);
|
filter: brightness(1.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
:root[data-theme="dark"] .select-list:not(.keyboard-nav) .select-item:hover {
|
:root[data-theme="dark"] .select-list:not(.keyboard-nav) .select-item:hover {
|
||||||
background-color: rgba(13, 110, 253, 0.2);
|
background-color: var(--select-item-hover-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
:root[data-theme="dark"] .select-item.selected {
|
:root[data-theme="dark"] .select-item.selected {
|
||||||
background-color: rgba(13, 110, 253, 0.2);
|
background-color: var(--select-item-hover-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 添加选择时的轻微阴影效果 */
|
/* 添加选择时的轻微阴影效果 */
|
||||||
.select-item.selected,
|
.select-item.selected,
|
||||||
.select-list:not(.keyboard-nav) .select-item:hover {
|
.select-list:not(.keyboard-nav) .select-item:hover {
|
||||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
|
box-shadow: 0 1px 2px var(--select-item-shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
:root[data-theme="dark"] .select-item.selected,
|
:root[data-theme="dark"] .select-item.selected,
|
||||||
:root[data-theme="dark"] .select-list:not(.keyboard-nav) .select-item:hover {
|
:root[data-theme="dark"] .select-list:not(.keyboard-nav) .select-item:hover {
|
||||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 1px 2px var(--select-item-shadow-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-item-icon {
|
.select-item-icon {
|
||||||
width: 34px;
|
width: 34px;
|
||||||
height: 34px;
|
height: 34px;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-item-icon img {
|
.select-item-icon img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-item-content {
|
.select-item-content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-item-title {
|
.select-item-title {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-item-description {
|
.select-item-description {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: rgba(0, 0, 0, 0.6);
|
color: var(--select-description);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
:root[data-theme="dark"] .select-item-description {
|
:root[data-theme="dark"] .select-item-description {
|
||||||
color: rgba(255, 255, 255, 0.6);
|
color: var(--select-description-dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 搜索结果高亮样式 */
|
/* 搜索结果高亮样式 */
|
||||||
.highlight {
|
.highlight {
|
||||||
color: #ec3535;
|
color: var(--highlight-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 隐藏确定和取消按钮 */
|
/* 隐藏确定和取消按钮 */
|
||||||
.dialog-select .button-bar {
|
.dialog-select .button-bar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-wait-button .title-bar,
|
.dialog-wait-button .title-bar,
|
||||||
.dialog-wait-button .button-bar {
|
.dialog-wait-button .button-bar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-wait-button .content-wrapper {
|
.dialog-wait-button .content-wrapper {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 按钮容器和按钮样式 */
|
/* 按钮容器和按钮样式 */
|
||||||
#wait-button {
|
#wait-button {
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wait-button-group {
|
.wait-button-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border: none;
|
border: none;
|
||||||
background: none;
|
background: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wait-btn,
|
#wait-btn,
|
||||||
#wait-cancel-btn {
|
#wait-cancel-btn {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wait-btn:hover,
|
#wait-btn:hover,
|
||||||
#wait-cancel-btn:hover {
|
#wait-cancel-btn:hover {
|
||||||
filter: brightness(1.1);
|
filter: brightness(1.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#wait-btn {
|
#wait-btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: var(--button-bg);
|
background: var(--button-bg);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wait-cancel-btn {
|
#wait-cancel-btn {
|
||||||
width: 25px;
|
width: 25px;
|
||||||
min-width: 25px;
|
min-width: 25px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wait-cancel-btn:hover {
|
#wait-cancel-btn:hover {
|
||||||
background-color: #ec3535;
|
background-color: var(--wait-btn-hover);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user