用户问「文字工具能不能选字体、难度大不大、性能要求高不高」。结论:能,核心只差 fontOf() 里硬编码的 'sans-serif',难度和性能都不是障碍 —— 真正的约束在字体文件怎么来。 实现(只做系统字体族,不做内置字体文件): - text.js 新增 TEXT_FONTS(sans 黑体 / serif 宋体 / kai 楷体 / round 圆体),每个是一串 跨平台候选栈:macOS 命中苹方/宋体,Windows 命中雅黑/宋体,全不命中退通用 sans-serif/serif。 - fontOf() 改为 weight + size + fontStackOf(t);fontKeyOf() 把 undefined / 脏值收敛回 sans, 防止非法字符串进 ctx.font 让整串失效、静默退回浏览器默认(画面上看不出报错,极难排查)。 - 状态加 S.textFamily,对象加 fontFamily 字段;写回复用 TEXT_STYLE_STATE_KEY 一条路径, 快照 cloneVectors 深拷贝天然带上,撤销/导出无需额外适配。 - 选项栏加「字体」下拉:唯一走 change 而非 click 的文字样式控件。 - 输入框同步字体族与字重,不会「输入时黑体、确认后宋体」。 为什么不做内置字体(三条硬约束): 1. 宿主 CSP 是 default-src 'self',font-src 回落它,第三方字体 CDN 会被直接拒绝; 2. CJK 字体本机宋体 2.3MB / 楷体 2.2MB / 苹方全字重 64MB,插件产物只有 392KB; 3. Web 字体异步,没 ready 就 measureText 会量出 fallback 宽度,选中框与字形错位、导出画错。 实测(1000²,30 个文字对象各一张整图画布):首次 13.2–42.1ms,热重绘 0.1–0.2ms —— 换字体只在首次多一次字形光栅化,之后走缓存,比现状还略快。中文全角等宽,换字体不改字宽 (10 字 48px 在 6 种字体下都是 480px),所以版面不跳动。另记既有开销:每对象一张整图画布, 1000² 3.8MB / 4000² 61MB,20 个对象在 4000² 上约 1.2GB(与字体无关)。 回归:harness 192 → 197(新增 5 条,含脏值收敛、中文宽度不变、撤销);validate 9/9; 真站 e2e 补 2 条字体断言。
2029 lines
86 KiB
CSS
Executable File
2029 lines
86 KiB
CSS
Executable File
/* IWB 鲜艺抠图节点 - 注入样式 */
|
||
|
||
/* 抠图按钮 */
|
||
.iwb-cutout-btn {
|
||
cursor: pointer;
|
||
opacity: 0.7;
|
||
transition: opacity 0.15s, transform 0.15s;
|
||
}
|
||
|
||
.iwb-cutout-btn:hover {
|
||
opacity: 1;
|
||
transform: scale(1.15);
|
||
}
|
||
|
||
.iwb-cutout-btn svg {
|
||
width: 14px;
|
||
height: 14px;
|
||
display: block;
|
||
}
|
||
|
||
/* 正在处理中的按钮状态 */
|
||
.iwb-cutout-btn.processing {
|
||
animation: iwb-cutout-pulse 1s infinite;
|
||
pointer-events: none;
|
||
}
|
||
|
||
@keyframes iwb-cutout-pulse {
|
||
0%, 100% { opacity: 0.4; }
|
||
50% { opacity: 1; }
|
||
}
|
||
|
||
/* 全屏遮罩 */
|
||
.iwb-cutout-overlay {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
background: rgba(0, 0, 0, 0.25);
|
||
display: none;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-direction: column;
|
||
gap: 12px;
|
||
z-index: 999999;
|
||
pointer-events: all;
|
||
backdrop-filter: blur(2px);
|
||
}
|
||
|
||
/* 自定义按钮提示(挂在 body,最高层级,不会被图片遮挡) */
|
||
#iwb-cutout-tip {
|
||
position: fixed;
|
||
z-index: 2147483647;
|
||
background: rgba(30, 30, 46, 0.95);
|
||
color: #fff;
|
||
padding: 5px 10px;
|
||
border-radius: 6px;
|
||
font-size: 12px;
|
||
line-height: 1.5;
|
||
white-space: nowrap;
|
||
pointer-events: none;
|
||
display: none;
|
||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
|
||
border: 1px solid rgba(255, 255, 255, 0.14);
|
||
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
|
||
max-width: 320px;
|
||
white-space: normal;
|
||
word-break: break-all;
|
||
}
|
||
|
||
/* 加载动画 */
|
||
.iwb-cutout-spinner {
|
||
width: 48px;
|
||
height: 48px;
|
||
border: 4px solid rgba(255, 255, 255, 0.3);
|
||
border-top-color: #e8a735;
|
||
border-radius: 50%;
|
||
animation: iwb-cutout-spin 0.8s linear infinite;
|
||
}
|
||
|
||
@keyframes iwb-cutout-spin {
|
||
to { transform: rotate(360deg); }
|
||
}
|
||
|
||
/* 遮罩文字 */
|
||
.iwb-cutout-text {
|
||
color: #fff;
|
||
font-size: 14px;
|
||
font-weight: 500;
|
||
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
|
||
background: rgba(0, 0, 0, 0.6);
|
||
padding: 8px 16px;
|
||
border-radius: 6px;
|
||
}
|
||
|
||
/* Toast 提示 */
|
||
.iwb-cutout-toast {
|
||
position: fixed;
|
||
bottom: 24px;
|
||
left: 50%;
|
||
transform: translateX(-50%);
|
||
padding: 10px 20px;
|
||
border-radius: 8px;
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
z-index: 999999;
|
||
transition: opacity 0.3s;
|
||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||
display: none;
|
||
max-width: 400px;
|
||
}
|
||
|
||
.iwb-cutout-toast-success {
|
||
background: #1a7f37;
|
||
color: #fff;
|
||
}
|
||
|
||
.iwb-cutout-toast-error {
|
||
background: #cf222e;
|
||
color: #fff;
|
||
}
|
||
|
||
.iwb-cutout-toast-info {
|
||
background: #1f6feb;
|
||
color: #fff;
|
||
}
|
||
|
||
/* 白底按钮 */
|
||
.iwb-whitebg-btn {
|
||
cursor: pointer;
|
||
opacity: 0.7;
|
||
transition: opacity 0.15s, transform 0.15s;
|
||
}
|
||
.iwb-whitebg-btn:hover { opacity: 1; transform: scale(1.15); }
|
||
.iwb-whitebg-btn svg { width: 14px; height: 14px; display: block; }
|
||
.iwb-whitebg-btn.processing { animation: iwb-cutout-pulse 1s infinite; pointer-events: none; }
|
||
|
||
/* 编辑按钮 */
|
||
.iwb-editor-btn-icon {
|
||
cursor: pointer;
|
||
opacity: 0.7;
|
||
transition: opacity 0.15s, transform 0.15s;
|
||
}
|
||
.iwb-editor-btn-icon:hover { opacity: 1; transform: scale(1.15); }
|
||
.iwb-editor-btn-icon svg { width: 14px; height: 14px; display: block; }
|
||
|
||
/* ==================== 图片编辑器 ==================== */
|
||
|
||
.iwb-editor-overlay {
|
||
position: fixed;
|
||
top: 0; left: 0;
|
||
width: 100%; height: 100%;
|
||
background: rgba(0, 0, 0, 0.6);
|
||
display: none;
|
||
align-items: center;
|
||
justify-content: center;
|
||
z-index: 999998;
|
||
backdrop-filter: blur(3px);
|
||
}
|
||
|
||
.iwb-editor-modal {
|
||
background: #1e1e2e;
|
||
border-radius: 0;
|
||
box-shadow: none;
|
||
display: flex;
|
||
flex-direction: column;
|
||
width: 100vw;
|
||
height: 100vh;
|
||
max-width: none;
|
||
max-height: none;
|
||
overflow: visible;
|
||
}
|
||
|
||
/* 新增:主区域(画布 + 图层面板)flex 布局 */
|
||
.iwb-editor-main {
|
||
display: flex;
|
||
flex: 1 1 auto;
|
||
min-height: 0;
|
||
overflow: visible;
|
||
}
|
||
|
||
.iwb-editor-header {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
padding: 10px 16px;
|
||
background: #181825;
|
||
border-bottom: 1px solid #313244;
|
||
flex-wrap: nowrap;
|
||
}
|
||
.iwb-editor-header > .iwb-editor-tools {
|
||
position: absolute;
|
||
left: 12px;
|
||
top: 68px;
|
||
width: 44px;
|
||
flex-direction: column;
|
||
padding: 6px;
|
||
background: #181825;
|
||
border: 1px solid #313244;
|
||
border-radius: 8px;
|
||
z-index: 20;
|
||
}
|
||
.iwb-editor-header > .iwb-editor-tools .iwb-editor-action { position: static; }
|
||
.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="undo"],
|
||
.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="redo"],
|
||
.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="reset"],
|
||
.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="restore"] {
|
||
position: absolute;
|
||
top: -54px;
|
||
left: auto;
|
||
}
|
||
.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="undo"] { right: 154px; }
|
||
.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="redo"] { right: 118px; }
|
||
.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="reset"] { right: 82px; }
|
||
.iwb-editor-header > .iwb-editor-tools .iwb-editor-action[data-action="restore"] { right: 46px; }
|
||
.iwb-editor-header > .iwb-editor-tools .iwb-editor-divider {
|
||
width: 24px;
|
||
height: 1px;
|
||
margin: 4px 0;
|
||
}
|
||
|
||
.iwb-editor-title {
|
||
color: #cdd6f4;
|
||
font-size: 14px;
|
||
font-weight: 600;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.iwb-editor-tools {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
}
|
||
|
||
.iwb-editor-tool, .iwb-editor-action {
|
||
background: #313244;
|
||
border: none;
|
||
border-radius: 6px;
|
||
color: #cdd6f4;
|
||
width: 32px; height: 32px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
cursor: pointer;
|
||
font-size: 15px;
|
||
transition: background 0.15s, transform 0.1s;
|
||
}
|
||
.iwb-editor-tool:hover, .iwb-editor-action:hover { background: #45475a; transform: scale(1.08); }
|
||
.iwb-editor-tool.active { background: #e8a735; color: #1e1e2e; }
|
||
.iwb-editor-tool svg, .iwb-editor-action svg { display: block; }
|
||
.iwb-editor-layer-btn svg { display: block; }
|
||
|
||
/* 复原按钮:绿色高亮,与撤销/重做/清空区分 */
|
||
.iwb-editor-action-restore { background: #1a7f37; color: #fff; }
|
||
.iwb-editor-action-restore:hover { background: #15803d !important; }
|
||
|
||
.iwb-editor-divider {
|
||
width: 1px; height: 20px;
|
||
background: #45475a;
|
||
margin: 0 4px;
|
||
}
|
||
|
||
.iwb-editor-params {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
margin-left: 12px;
|
||
justify-content: flex-start;
|
||
min-width: 0;
|
||
flex: 1 1 auto;
|
||
flex-wrap: wrap;
|
||
}
|
||
.iwb-editor-params .iwb-editor-zoom { margin-left: auto; order: 20; }
|
||
.iwb-editor-top-colors { display: none; }
|
||
|
||
.iwb-editor-colors { display: flex; gap: 4px; }
|
||
.iwb-editor-color {
|
||
width: 20px; height: 20px;
|
||
border-radius: 50%;
|
||
cursor: pointer;
|
||
border: 2px solid transparent;
|
||
transition: transform 0.1s, border-color 0.15s;
|
||
}
|
||
.iwb-editor-color:hover { transform: scale(1.2); }
|
||
.iwb-editor-color.active { border-color: #fff; transform: scale(1.15); }
|
||
|
||
.iwb-editor-brush-label {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
color: #a6adc8;
|
||
font-size: 12px;
|
||
}
|
||
.iwb-editor-brush-size { width: 80px; cursor: pointer; }
|
||
.iwb-editor-brush-val { color: #e8a735; font-weight: 600; min-width: 16px; }
|
||
|
||
/* 笔刷/橡皮大小精确数值输入框 */
|
||
.iwb-editor-brush-num,
|
||
.iwb-editor-eraser-num {
|
||
width: 44px;
|
||
padding: 2px 3px;
|
||
background: #313244;
|
||
border: 1px solid #45475a;
|
||
border-radius: 5px;
|
||
color: #e8a735;
|
||
font-weight: 600;
|
||
font-size: 11px;
|
||
font-family: inherit;
|
||
text-align: center;
|
||
}
|
||
.iwb-editor-brush-num:focus,
|
||
.iwb-editor-eraser-num:focus {
|
||
outline: none;
|
||
border-color: #e8a735;
|
||
background: #1e1e2e;
|
||
}
|
||
.iwb-editor-brush-num::-webkit-outer-spin-button,
|
||
.iwb-editor-brush-num::-webkit-inner-spin-button,
|
||
.iwb-editor-eraser-num::-webkit-outer-spin-button,
|
||
.iwb-editor-eraser-num::-webkit-inner-spin-button {
|
||
-webkit-appearance: none; /* 去掉上下箭头,窄输入框更干净 */
|
||
margin: 0;
|
||
}
|
||
|
||
/* 实心矩形开关 */
|
||
.iwb-editor-fill-btn {
|
||
background: #313244;
|
||
border: 1px solid #45475a;
|
||
border-radius: 6px;
|
||
color: #a6adc8;
|
||
padding: 4px 10px;
|
||
font-size: 12px;
|
||
cursor: pointer;
|
||
transition: background 0.15s, color 0.15s, border-color 0.15s;
|
||
white-space: nowrap;
|
||
}
|
||
.iwb-editor-fill-btn:hover { background: #45475a; }
|
||
.iwb-editor-fill-btn.active {
|
||
background: #e8a735;
|
||
border-color: #e8a735;
|
||
color: #1e1e2e;
|
||
font-weight: 600;
|
||
}
|
||
|
||
/* 画笔参数组(硬度/透明度,画笔与橡皮工具共用) */
|
||
.iwb-editor-brush-group {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
}
|
||
.iwb-editor-layer-group {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 3px;
|
||
}
|
||
.iwb-editor-layer-btn {
|
||
background: #313244;
|
||
border: 1px solid #45475a;
|
||
border-radius: 6px;
|
||
color: #a6adc8;
|
||
width: 26px;
|
||
height: 26px;
|
||
font-size: 14px;
|
||
line-height: 1;
|
||
cursor: pointer;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
|
||
}
|
||
.iwb-editor-layer-btn:hover:not(:disabled) { background: #45475a; color: #cdd6f4; }
|
||
.iwb-editor-layer-btn:disabled {
|
||
opacity: 0.35;
|
||
cursor: not-allowed;
|
||
}
|
||
|
||
/* 缩放控件 */
|
||
.iwb-editor-zoom {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 2px;
|
||
background: #313244;
|
||
border-radius: 6px;
|
||
padding: 2px;
|
||
}
|
||
.iwb-editor-zoom-btn {
|
||
background: transparent;
|
||
border: none;
|
||
color: #cdd6f4;
|
||
width: 26px;
|
||
height: 26px;
|
||
border-radius: 4px;
|
||
cursor: pointer;
|
||
font-size: 14px;
|
||
line-height: 1;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
transition: background 0.15s;
|
||
}
|
||
.iwb-editor-zoom-btn:hover { background: #45475a; }
|
||
.iwb-editor-zoom-btn:active { transform: scale(0.94); }
|
||
.iwb-editor-zoom-fit { font-size: 12px; width: auto; padding: 0 8px; }
|
||
.iwb-editor-zoom-val {
|
||
color: #e8a735;
|
||
font-size: 12px;
|
||
font-weight: 600;
|
||
min-width: 46px;
|
||
text-align: center;
|
||
font-variant-numeric: tabular-nums;
|
||
user-select: none;
|
||
}
|
||
|
||
/* 底部操作提示 */
|
||
.iwb-editor-zoom-hint {
|
||
position: absolute;
|
||
bottom: 8px;
|
||
right: 14px;
|
||
color: #7f849c;
|
||
font-size: 11px;
|
||
background: rgba(24, 24, 37, 0.85);
|
||
padding: 3px 10px;
|
||
border-radius: 4px;
|
||
pointer-events: none;
|
||
z-index: 5;
|
||
}
|
||
|
||
.iwb-editor-canvas-wrap {
|
||
position: relative;
|
||
background: #11111b;
|
||
flex: 1 1 auto;
|
||
min-height: 0;
|
||
max-width: 100%;
|
||
max-height: 100%;
|
||
overflow: hidden; /* 裁剪框允许显示在图片边界外;编辑区仍由模态层裁切 */
|
||
overflow: clip; /* v1.2.8:hidden 仍可被编程滚动(点击底部工具栏会触发 scrollIntoView 把画布滚跑),clip 彻底禁止滚动 */
|
||
padding: 12px;
|
||
}
|
||
|
||
.iwb-editor-canvas-stack {
|
||
position: absolute;
|
||
left: 0;
|
||
top: 0;
|
||
display: block;
|
||
width: 0;
|
||
height: 0;
|
||
/* 仅图片工作区显示透明棋盘格,外围裁剪工作区保持纯色。 */
|
||
background-color: #d6d6d6;
|
||
background-image:
|
||
linear-gradient(45deg, #b8b8b8 25%, transparent 25%),
|
||
linear-gradient(-45deg, #b8b8b8 25%, transparent 25%),
|
||
linear-gradient(45deg, transparent 75%, #b8b8b8 75%),
|
||
linear-gradient(-45deg, transparent 75%, #b8b8b8 75%);
|
||
background-size: 20px 20px;
|
||
background-position: 0 0, 0 10px, 10px -10px, -10px 0;
|
||
}
|
||
|
||
.iwb-editor-base, .iwb-editor-draw, .iwb-editor-text, .iwb-editor-crop-overlay {
|
||
display: block;
|
||
}
|
||
/* 位图图层 canvas(动态创建) */
|
||
.iwb-editor-layer-canvas {
|
||
display: block;
|
||
position: absolute;
|
||
top: 0; left: 0;
|
||
}
|
||
.iwb-editor-base {
|
||
background: #fff;
|
||
/* 棋盘格透明背景示意 */
|
||
background-image:
|
||
linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
|
||
linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
|
||
linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
|
||
linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
|
||
background-size: 20px 20px;
|
||
background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
|
||
}
|
||
.iwb-editor-draw {
|
||
position: absolute;
|
||
top: 0; left: 0;
|
||
cursor: crosshair;
|
||
}
|
||
|
||
/* 笔划预览层:一笔进行中显示(draw 之上、text 之下),事件穿透 */
|
||
.iwb-editor-stroke {
|
||
position: absolute;
|
||
top: 0; left: 0;
|
||
pointer-events: none;
|
||
display: none;
|
||
}
|
||
|
||
.iwb-editor-brush-hardness { width: 70px; cursor: pointer; }
|
||
.iwb-editor-brush-hardness-val { color: #e8a735; font-weight: 600; min-width: 20px; display: inline-block; text-align: right; }
|
||
.iwb-editor-brush-opacity { width: 70px; cursor: pointer; }
|
||
.iwb-editor-brush-opacity-val { color: #e8a735; font-weight: 600; min-width: 34px; display: inline-block; text-align: right; }
|
||
|
||
/* 自定义颜色(原生取色器伪装成圆形色板) */
|
||
.iwb-editor-color-custom {
|
||
position: relative;
|
||
overflow: hidden;
|
||
border: 2px dashed #a6adc8;
|
||
}
|
||
.iwb-editor-color-custom.active { border-color: #fff; border-style: solid; transform: scale(1.15); }
|
||
.iwb-editor-color-custom input[type="color"] {
|
||
position: absolute;
|
||
inset: -6px;
|
||
width: calc(100% + 12px);
|
||
height: calc(100% + 12px);
|
||
padding: 0;
|
||
border: none;
|
||
cursor: pointer;
|
||
background: conic-gradient(#ff4444, #ffaa00, #44dd44, #4488ff, #aa44ff, #ff4444);
|
||
}
|
||
.iwb-editor-color-custom input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
|
||
.iwb-editor-color-custom input[type="color"]::-webkit-color-swatch { border: none; }
|
||
|
||
/* 吸管悬停预览浮窗 */
|
||
.iwb-editor-picker-tip {
|
||
position: fixed;
|
||
z-index: 2147483000;
|
||
display: none;
|
||
align-items: center;
|
||
gap: 6px;
|
||
background: rgba(30, 30, 46, 0.95);
|
||
border: 1px solid rgba(255, 255, 255, 0.14);
|
||
border-radius: 6px;
|
||
padding: 4px 8px;
|
||
pointer-events: none;
|
||
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
|
||
}
|
||
.iwb-editor-picker-chip {
|
||
width: 16px;
|
||
height: 16px;
|
||
border-radius: 4px;
|
||
background: transparent;
|
||
}
|
||
.iwb-editor-picker-hex {
|
||
color: #cdd6f4;
|
||
font-size: 12px;
|
||
font-weight: 600;
|
||
font-variant-numeric: tabular-nums;
|
||
}
|
||
|
||
/* 文字图层:独立 canvas,事件穿透到下层 drawCanvas */
|
||
.iwb-editor-text {
|
||
position: absolute;
|
||
top: 0; left: 0;
|
||
pointer-events: none;
|
||
}
|
||
|
||
/* 裁剪覆盖层:遮罩/选区框/手柄画在这层,不污染标注层 */
|
||
.iwb-editor-crop-overlay {
|
||
position: absolute;
|
||
top: 0; left: 0;
|
||
pointer-events: none;
|
||
}
|
||
|
||
/* 文字输入框 */
|
||
.iwb-editor-text-input {
|
||
position: absolute;
|
||
display: none;
|
||
padding: 4px 8px;
|
||
border: 2px solid #4488ff;
|
||
border-radius: 4px;
|
||
font-size: 14px;
|
||
line-height: 1.35;
|
||
/* textarea:默认会显示右下角拖拽柄与滚动条,画布上的就地输入框都不要 */
|
||
resize: none;
|
||
overflow: hidden;
|
||
white-space: pre;
|
||
background: rgba(255, 255, 255, 0.95);
|
||
color: #1e1e2e;
|
||
z-index: 10;
|
||
min-width: 120px;
|
||
min-height: 30px;
|
||
font-family: inherit;
|
||
}
|
||
.iwb-editor-text-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(68, 136, 255, 0.3); }
|
||
|
||
/* 裁剪确认栏(含约束控件) */
|
||
.iwb-editor-crop-bar {
|
||
position: absolute;
|
||
bottom: 16px;
|
||
left: 50%;
|
||
transform: translateX(-50%);
|
||
display: none;
|
||
gap: 8px;
|
||
z-index: 10;
|
||
align-items: center;
|
||
background: rgba(24, 24, 37, 0.92);
|
||
border: 1px solid #313244;
|
||
border-radius: 8px;
|
||
padding: 6px 10px;
|
||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
|
||
flex-wrap: wrap;
|
||
max-width: 90%;
|
||
justify-content: center;
|
||
}
|
||
|
||
.iwb-editor-constraint-group {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
}
|
||
|
||
.iwb-editor-constraint-label {
|
||
color: #7f849c;
|
||
font-size: 11px;
|
||
margin-right: 2px;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.iwb-editor-constraint-btn {
|
||
background: #313244;
|
||
border: none;
|
||
border-radius: 4px;
|
||
color: #cdd6f4;
|
||
padding: 3px 8px;
|
||
font-size: 12px;
|
||
cursor: pointer;
|
||
transition: background 0.15s, transform 0.1s;
|
||
white-space: nowrap;
|
||
}
|
||
.iwb-editor-constraint-btn:hover { background: #45475a; transform: scale(1.05); }
|
||
.iwb-editor-constraint-btn.active { background: #4488ff; color: #fff; }
|
||
|
||
.iwb-editor-constraint-sep {
|
||
width: 1px;
|
||
height: 20px;
|
||
background: #45475a;
|
||
}
|
||
|
||
.iwb-editor-size-input {
|
||
width: 50px;
|
||
background: #313244;
|
||
border: 1px solid #45475a;
|
||
border-radius: 4px;
|
||
color: #cdd6f4;
|
||
padding: 3px 6px;
|
||
font-size: 12px;
|
||
text-align: center;
|
||
}
|
||
.iwb-editor-size-input:focus { outline: none; border-color: #4488ff; }
|
||
.iwb-editor-size-input::-webkit-inner-spin-button { -webkit-appearance: none; }
|
||
|
||
.iwb-editor-size-x { color: #7f849c; font-size: 12px; }
|
||
|
||
.iwb-editor-size-apply {
|
||
background: #313244;
|
||
border: 1px solid #4488ff;
|
||
color: #4488ff;
|
||
border-radius: 4px;
|
||
padding: 3px 8px;
|
||
font-size: 12px;
|
||
cursor: pointer;
|
||
transition: background 0.15s;
|
||
}
|
||
.iwb-editor-size-apply:hover { background: #4488ff; color: #fff; }
|
||
|
||
.iwb-editor-crop-info {
|
||
color: #e8a735;
|
||
font-size: 12px;
|
||
font-weight: 600;
|
||
font-variant-numeric: tabular-nums;
|
||
white-space: nowrap;
|
||
min-width: 60px;
|
||
text-align: center;
|
||
}
|
||
|
||
.iwb-editor-crop-confirm, .iwb-editor-crop-cancel {
|
||
padding: 6px 16px;
|
||
border: none;
|
||
border-radius: 6px;
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
cursor: pointer;
|
||
}
|
||
.iwb-editor-crop-confirm { background: #1a7f37; color: #fff; }
|
||
.iwb-editor-crop-confirm:hover { background: #15803d; }
|
||
.iwb-editor-crop-cancel { background: #cf222e; color: #fff; }
|
||
.iwb-editor-crop-cancel:hover { background: #b91c1c; }
|
||
|
||
/* 底部 */
|
||
.iwb-editor-footer {
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
gap: 8px;
|
||
padding: 12px 16px;
|
||
background: #181825;
|
||
border-top: 1px solid #313244;
|
||
}
|
||
|
||
.iwb-editor-btn {
|
||
padding: 8px 20px;
|
||
border: none;
|
||
border-radius: 6px;
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
cursor: pointer;
|
||
transition: background 0.15s, transform 0.1s;
|
||
}
|
||
.iwb-editor-btn:hover { transform: scale(1.03); }
|
||
.iwb-editor-btn-cancel { background: #45475a; color: #cdd6f4; }
|
||
.iwb-editor-btn-cancel:hover { background: #585b70; }
|
||
.iwb-editor-btn-new { background: #4488ff; color: #fff; }
|
||
.iwb-editor-btn-new:hover { background: #3578f0; }
|
||
.iwb-editor-btn-replace { background: #e8a735; color: #1e1e2e; }
|
||
.iwb-editor-btn-replace:hover { background: #d49628; }
|
||
|
||
/* ==================== 图层面板 ==================== */
|
||
|
||
.iwb-editor-layer-panel {
|
||
width: 290px;
|
||
min-width: 290px;
|
||
background: #181825;
|
||
border-left: 1px solid #313244;
|
||
display: flex;
|
||
flex-direction: column;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.iwb-editor-layer-panel-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding: 10px 12px;
|
||
border-bottom: 1px solid #313244;
|
||
}
|
||
|
||
.iwb-editor-layer-panel-title {
|
||
color: #cdd6f4;
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.iwb-editor-layer-add-group {
|
||
display: flex;
|
||
gap: 4px;
|
||
}
|
||
|
||
.iwb-editor-layer-add-btn {
|
||
background: #313244;
|
||
border: 1px solid #45475a;
|
||
border-radius: 6px;
|
||
color: #cdd6f4;
|
||
width: 26px;
|
||
height: 26px;
|
||
cursor: pointer;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
transition: background 0.15s;
|
||
}
|
||
.iwb-editor-layer-add-btn:hover { background: #45475a; color: #e8a735; }
|
||
.iwb-editor-layer-add-btn svg { display: block; }
|
||
|
||
.iwb-editor-layer-list {
|
||
flex: 1 1 auto;
|
||
overflow-y: auto;
|
||
padding: 4px;
|
||
/* 拖动排序的插入线是绝对定位的,锚点必须在列表上(随滚动一起移动) */
|
||
position: relative;
|
||
}
|
||
|
||
/* 图层项:整项改成「行 + 可选的不透明度行」,两行都靠 .iwb-layer-row 保持原来的横向排布 */
|
||
.iwb-layer-item {
|
||
display: block;
|
||
padding: 5px 8px;
|
||
border-radius: 6px;
|
||
cursor: grab;
|
||
user-select: none;
|
||
transition: background 0.12s;
|
||
margin-bottom: 2px;
|
||
}
|
||
.iwb-layer-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
min-width: 0;
|
||
}
|
||
.iwb-layer-item:hover { background: #313244; }
|
||
.iwb-layer-item.active {
|
||
background: #313244;
|
||
box-shadow: inset 2px 0 0 #e8a735;
|
||
}
|
||
.iwb-layer-item.hidden { opacity: 0.5; }
|
||
/* 拖动中:整行跟着指针浮起,压住相邻行;其余行由 JS 实时让位(落点反馈) */
|
||
.iwb-layer-item.dragging {
|
||
position: relative;
|
||
z-index: 3;
|
||
opacity: 1;
|
||
background: #3a3d55;
|
||
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), inset 0 0 0 1px #e8a735;
|
||
transition: none;
|
||
cursor: grabbing;
|
||
}
|
||
.iwb-editor-layer-list.sorting,
|
||
.iwb-editor-layer-list.sorting .iwb-layer-item { cursor: grabbing; }
|
||
/* 画笔/橡皮作用目标:与「选中」分离,避免出现两个图层同时高亮 */
|
||
.iwb-layer-paint { flex: 0 0 auto; color: #a6adc8; font-size: 11px; opacity: 0.85; }
|
||
/* 不透明度角标:只有非 100% 才出现,一眼看出哪层被调淡了 */
|
||
.iwb-layer-op { flex: 0 0 auto; font-size: 10px; color: #a6adc8; font-variant-numeric: tabular-nums; }
|
||
|
||
/* 缩略图:canvas 画内容,类型图标垫在下面当兜底(空图层的缩略图是全透明的) */
|
||
.iwb-layer-thumb {
|
||
position: relative;
|
||
flex: 0 0 auto;
|
||
width: 22px;
|
||
height: 22px;
|
||
border-radius: 3px;
|
||
overflow: hidden;
|
||
background-color: #1e1e2e;
|
||
background-image: linear-gradient(45deg, #33334a 25%, transparent 25%), linear-gradient(-45deg, #33334a 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #33334a 75%), linear-gradient(-45deg, transparent 75%, #33334a 75%);
|
||
background-size: 8px 8px;
|
||
background-position: 0 0, 0 4px, 4px -4px, -4px 0;
|
||
box-shadow: inset 0 0 0 1px #45475a;
|
||
}
|
||
.iwb-layer-thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
|
||
.iwb-layer-thumb .iwb-layer-icon {
|
||
position: absolute;
|
||
inset: 0;
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
color: #7f849c;
|
||
}
|
||
|
||
/* 不透明度行:只出现在选中项下,拖动时不能被重绘打断 */
|
||
.iwb-layer-op-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
margin: 4px 0 1px 26px;
|
||
}
|
||
.iwb-layer-opacity {
|
||
flex: 1 1 auto;
|
||
min-width: 0;
|
||
height: 14px;
|
||
accent-color: #e8a735;
|
||
cursor: pointer;
|
||
}
|
||
.iwb-layer-op-val {
|
||
flex: 0 0 auto;
|
||
width: 32px;
|
||
text-align: right;
|
||
font-size: 10px;
|
||
color: #a6adc8;
|
||
font-variant-numeric: tabular-nums;
|
||
}
|
||
|
||
/* 可重命名的图层名:悬停给个提示,进入编辑时换成输入框 */
|
||
.iwb-layer-name.renamable:hover { color: #e8a735; }
|
||
.iwb-layer-name-input {
|
||
flex: 1 1 auto;
|
||
min-width: 0;
|
||
padding: 1px 4px;
|
||
border: 1px solid #e8a735;
|
||
border-radius: 3px;
|
||
background: #1e1e2e;
|
||
color: #cdd6f4;
|
||
font-size: 12px;
|
||
font-family: inherit;
|
||
outline: none;
|
||
}
|
||
|
||
.iwb-layer-vis {
|
||
background: none;
|
||
border: none;
|
||
color: #a6adc8;
|
||
cursor: pointer;
|
||
font-size: 13px;
|
||
width: 20px;
|
||
height: 20px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
border-radius: 4px;
|
||
transition: background 0.12s;
|
||
}
|
||
.iwb-layer-vis:hover { background: #45475a; }
|
||
|
||
.iwb-layer-icon {
|
||
font-size: 13px;
|
||
width: 18px;
|
||
text-align: center;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.iwb-layer-name {
|
||
color: #cdd6f4;
|
||
font-size: 12px;
|
||
flex: 1 1 auto;
|
||
white-space: nowrap;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
min-width: 0;
|
||
}
|
||
|
||
.iwb-layer-lock {
|
||
background: none;
|
||
border: none;
|
||
color: #7f849c;
|
||
cursor: pointer;
|
||
width: 20px;
|
||
height: 20px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
border-radius: 4px;
|
||
transition: background 0.12s, color 0.12s;
|
||
flex-shrink: 0;
|
||
}
|
||
.iwb-layer-lock:hover, .iwb-layer-lock.active { background: #45475a; color: #e8a735; }
|
||
|
||
.iwb-layer-del {
|
||
background: none;
|
||
border: none;
|
||
color: #585b70;
|
||
cursor: pointer;
|
||
font-size: 12px;
|
||
width: 18px;
|
||
height: 18px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
border-radius: 4px;
|
||
transition: background 0.12s, color 0.12s;
|
||
flex-shrink: 0;
|
||
}
|
||
.iwb-layer-del:hover { background: #cf222e; color: #fff; }
|
||
|
||
/* SVG 图标尺寸 */
|
||
.iwb-layer-vis svg { display: block; }
|
||
.iwb-layer-icon svg { display: block; }
|
||
.iwb-layer-lock svg { display: block; }
|
||
.iwb-layer-del svg { display: block; }
|
||
|
||
/* 独立 PS 风格颜色面板 */
|
||
.iwb-editor-color-panel { padding: 12px; border-bottom: 1px solid #313244; background: #202033; }
|
||
.iwb-editor-color-panel-title { color: #cdd6f4; font-size: 12px; font-weight: 600; margin-bottom: 10px; }
|
||
.iwb-editor-color-panel-main { display: flex; align-items: center; gap: 10px; }
|
||
.iwb-editor-color-current { width: 52px; height: 52px; border: 2px solid #cdd6f4; border-radius: 6px; overflow: hidden; display: block; background: #ff4444; }
|
||
.iwb-editor-color-panel-input { width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; opacity: 0; }
|
||
.iwb-editor-color-panel-values { min-width: 0; flex: 1; }
|
||
.iwb-editor-color-hex { color: #cdd6f4; font: 600 12px monospace; display: block; margin-bottom: 8px; }
|
||
.iwb-editor-color-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
|
||
.iwb-editor-color-panel-swatch { width: 20px; height: 20px; border: 1px solid #585b70; border-radius: 4px; cursor: pointer; }
|
||
.iwb-editor-color-panel-swatch:hover { transform: scale(1.12); border-color: #fff; }
|
||
.iwb-editor-panel-width { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: #a6adc8; font-size: 11px; }
|
||
.iwb-editor-panel-width-range { flex: 1; min-width: 60px; }
|
||
.iwb-editor-panel-width-num { width: 42px; padding: 3px; background: #313244; color: #e8a735; border: 1px solid #45475a; border-radius: 4px; text-align: center; }
|
||
|
||
/* 顶部独立操作区,避免操作按钮被竖向工具栏裁切 */
|
||
.iwb-editor-actions { display: flex; align-items: center; gap: 5px; margin-left: auto; flex: 0 0 auto; }
|
||
.iwb-editor-actions .iwb-editor-action { position: static !important; }
|
||
.iwb-editor-actions .iwb-editor-action-restore { width: auto; padding: 0 9px; font-size: 12px; }
|
||
|
||
/* 原图 canvas 只负责绘制像素,透明处透出 stack 的棋盘格。 */
|
||
.iwb-editor-base { background: transparent !important; background-image: none !important; }
|
||
|
||
/* 透明区域使用 Photoshop 风格的灰色棋盘格,覆盖整个实际图片区域。 */
|
||
.iwb-editor-canvas-stack {
|
||
background-color: #d6d6d6 !important;
|
||
background-image:
|
||
linear-gradient(45deg, #b8b8b8 25%, transparent 25%),
|
||
linear-gradient(-45deg, #b8b8b8 25%, transparent 25%),
|
||
linear-gradient(45deg, transparent 75%, #b8b8b8 75%),
|
||
linear-gradient(-45deg, transparent 75%, #b8b8b8 75%) !important;
|
||
background-size: 20px 20px !important;
|
||
background-position: 0 0, 0 10px, 10px -10px, -10px 0 !important;
|
||
}
|
||
.iwb-editor-base { background: transparent !important; background-image: none !important; }
|
||
|
||
/* 顶部参数区必须保持可见且可交互,避免被侧栏定位层覆盖。 */
|
||
.iwb-editor-header { position: relative; min-height: 56px; overflow: visible; }
|
||
.iwb-editor-params { position: relative; z-index: 30; overflow: visible; pointer-events: auto; }
|
||
.iwb-editor-params input, .iwb-editor-params button, .iwb-editor-params label { pointer-events: auto; }
|
||
.iwb-editor-brush-size, .iwb-editor-brush-hardness, .iwb-editor-brush-opacity { min-width: 70px; accent-color: #e8a735; }
|
||
.iwb-editor-brush-num, .iwb-editor-eraser-num { pointer-events: auto; }
|
||
|
||
/* canvas 的透明像素必须透出 stack 棋盘格,不能被黑色工作区遮住。 */
|
||
.iwb-editor-canvas-stack { isolation: isolate; }
|
||
.iwb-editor-layer-canvas, .iwb-editor-text, .iwb-editor-stroke, .iwb-editor-crop-overlay { background: transparent !important; }
|
||
|
||
/* 透明棋盘格只覆盖原图的显示矩形,外围裁剪扩展区保持纯色。 */
|
||
.iwb-editor-canvas-stack { background: #11111b !important; background-image: none !important; }
|
||
.iwb-editor-transparency-grid { position: absolute; z-index: 0; pointer-events: none; background-color: #d6d6d6; background-image: linear-gradient(45deg, #b8b8b8 25%, transparent 25%), linear-gradient(-45deg, #b8b8b8 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #b8b8b8 75%), linear-gradient(-45deg, transparent 75%, #b8b8b8 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
|
||
.iwb-editor-layer-canvas, .iwb-editor-stroke, .iwb-editor-text { z-index: 1; }
|
||
.iwb-editor-crop-overlay { z-index: 10; }
|
||
|
||
/* 画布扩展区不得盖过编辑器外围,图片区域由透明层单独标识。 */
|
||
.iwb-editor-canvas-stack { overflow: visible; max-width: 100%; max-height: 100%; background: #11111b !important; background-image: none !important; }
|
||
.iwb-editor-transparency-grid { z-index: 0; overflow: hidden; }
|
||
.iwb-editor-layer-canvas { z-index: 1; }
|
||
.iwb-editor-stroke { z-index: 4; }
|
||
.iwb-editor-text { z-index: 5; }
|
||
.iwb-editor-crop-overlay { z-index: 10; }
|
||
|
||
/* 导出操作与缩放同处顶栏,缩放独立靠右。 */
|
||
.iwb-editor-export-actions { display: flex; align-items: center; gap: 6px; margin-left: 10px; flex: 0 0 auto; }
|
||
.iwb-editor-export-actions .iwb-editor-btn { padding: 6px 10px; font-size: 11px; }
|
||
.iwb-editor-footer { display: none !important; }
|
||
|
||
.iwb-editor-export-actions { display: flex; align-items: center; gap: 6px; margin-left: 10px; flex: 0 0 auto; }
|
||
.iwb-editor-export-actions .iwb-editor-btn { padding: 6px 10px; font-size: 11px; }
|
||
.iwb-editor-footer { display: none !important; }
|
||
|
||
/* 顶部七个操作按钮统一文本按钮样式,自适应中文宽度。 */
|
||
.iwb-editor-actions { gap: 6px; }
|
||
.iwb-editor-actions .iwb-editor-action { width: auto; min-width: 72px; height: 32px; padding: 0 12px; gap: 5px; font-size: 12px; font-weight: 500; white-space: nowrap; }
|
||
.iwb-editor-actions .iwb-editor-action svg { width: 14px; height: 14px; flex: 0 0 auto; }
|
||
.iwb-editor-export-actions .iwb-editor-btn { min-width: 72px; white-space: nowrap; }
|
||
|
||
/* 顶部操作按钮统一为纯文本,图标隐藏并保持一致宽度。 */
|
||
.iwb-editor-actions .iwb-editor-action svg { display: none !important; }
|
||
.iwb-editor-actions .iwb-editor-action { min-width: 76px; width: 76px; justify-content: center; background: #3b3d52; color: #cdd6f4; }
|
||
.iwb-editor-actions .iwb-editor-action:hover { background: #50536b; }
|
||
.iwb-editor-actions .iwb-editor-action-restore { background: #3b3d52; color: #cdd6f4; }
|
||
.iwb-editor-actions .iwb-editor-action-restore:hover { background: #50536b !important; }
|
||
|
||
.iwb-editor-actions .iwb-editor-action svg { display: none !important; }
|
||
.iwb-editor-actions .iwb-editor-action { min-width: 76px; width: 76px; justify-content: center; background: #3b3d52; color: #cdd6f4; }
|
||
.iwb-editor-actions .iwb-editor-action:hover, .iwb-editor-actions .iwb-editor-action-restore:hover { background: #50536b !important; }
|
||
|
||
.iwb-editor-actions .iwb-editor-action { width: auto; min-width: 76px; padding: 0 12px; gap: 5px; }
|
||
.iwb-editor-actions .iwb-editor-action span { display: inline-block; }
|
||
|
||
.iwb-editor-actions { margin-left: 12px; }
|
||
.iwb-editor-actions .iwb-editor-btn { width: auto; min-width: 76px; height: 32px; padding: 0 12px; font-size: 12px; white-space: nowrap; }
|
||
.iwb-editor-actions .iwb-editor-action { width: auto; min-width: 76px; }
|
||
|
||
.iwb-editor-actions .iwb-editor-action { min-width: 52px; width: auto; padding: 0 10px; font-size: 12px; }
|
||
.iwb-editor-brush-presets { display: flex; align-items: center; gap: 7px; margin-left: 4px; }
|
||
.iwb-editor-brush-preset { display: inline-flex; align-items: center; gap: 3px; padding: 2px 3px; border: 0; background: transparent; color: #a6adc8; cursor: pointer; font-size: 11px; }
|
||
.iwb-editor-brush-preset i { display: block; width: 12px; height: 12px; border-radius: 50%; background: #e8a735; border: 1px solid #f6d38a; }
|
||
.iwb-editor-brush-preset:nth-child(2) i { width: 16px; height: 16px; }
|
||
.iwb-editor-brush-preset:nth-child(3) i { width: 20px; height: 20px; }
|
||
.iwb-editor-brush-preset:nth-child(4) i { width: 24px; height: 24px; }
|
||
.iwb-editor-brush-preset:hover, .iwb-editor-brush-preset.active { color: #fff; }
|
||
|
||
/* 紧凑顶栏:操作按钮与描边快捷点仅保留必要视觉信息。 */
|
||
.iwb-editor-actions .iwb-editor-action { width: 28px; min-width: 28px; height: 28px; padding: 0; }
|
||
.iwb-editor-actions .iwb-editor-action svg { display: block !important; width: 14px; height: 14px; }
|
||
.iwb-editor-brush-presets { gap: 5px; margin-left: 2px; }
|
||
.iwb-editor-brush-preset { width: 24px; height: 24px; padding: 0; justify-content: center; }
|
||
.iwb-editor-brush-preset i { width: 5px; height: 5px; }
|
||
.iwb-editor-brush-preset:nth-child(2) i { width: 8px; height: 8px; }
|
||
.iwb-editor-brush-preset:nth-child(3) i { width: 12px; height: 12px; }
|
||
.iwb-editor-brush-preset:nth-child(4) i { width: 16px; height: 16px; }
|
||
|
||
/* 图层栏内嵌调色板:颜色直接点击应用,不弹出系统取色器。 */
|
||
.iwb-editor-color-panel { padding: 10px; }
|
||
.iwb-editor-color-current { width: 42px; height: 42px; flex: 0 0 42px; cursor: default; }
|
||
.iwb-editor-color-swatches { display: grid; grid-template-columns: repeat(7, 20px); gap: 5px; }
|
||
.iwb-editor-color-panel-swatch { width: 20px; height: 20px; border-radius: 50%; }
|
||
|
||
.iwb-editor-color-panel { padding: 10px; }
|
||
.iwb-editor-color-current { width: 42px; height: 42px; flex: 0 0 42px; cursor: default; }
|
||
.iwb-editor-color-swatches { display: grid; grid-template-columns: repeat(7, 20px); gap: 5px; }
|
||
.iwb-editor-color-panel-swatch { width: 20px; height: 20px; border-radius: 50%; }
|
||
|
||
.iwb-editor-color-panel { padding: 10px; }
|
||
.iwb-editor-palette-current { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
|
||
.iwb-editor-palette-current .iwb-editor-color-current { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 4px; }
|
||
.iwb-editor-color-panel .iwb-editor-color-hex { margin: 0; }
|
||
.iwb-editor-color-panel .iwb-editor-color-swatches { display: grid; grid-template-columns: repeat(6, 20px); gap: 7px; }
|
||
.iwb-editor-color-panel .iwb-editor-color-panel-swatch { width: 20px; height: 20px; border-radius: 50%; padding: 0; }
|
||
.iwb-editor-color-panel .iwb-editor-color-panel-swatch.active { outline: 2px solid #fff; outline-offset: 2px; }
|
||
|
||
.iwb-editor-color-panel { padding: 10px; }
|
||
.iwb-editor-palette-current { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
|
||
.iwb-editor-palette-current .iwb-editor-color-current { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 4px; }
|
||
.iwb-editor-color-panel .iwb-editor-color-hex { margin: 0; }
|
||
.iwb-editor-color-panel .iwb-editor-color-swatches { display: grid; grid-template-columns: repeat(6, 20px); gap: 7px; }
|
||
.iwb-editor-color-panel .iwb-editor-color-panel-swatch { width: 20px; height: 20px; border-radius: 50%; padding: 0; }
|
||
.iwb-editor-color-panel .iwb-editor-color-panel-swatch.active { outline: 2px solid #fff; outline-offset: 2px; }
|
||
|
||
.iwb-editor-inline-picker { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
|
||
.iwb-editor-inline-picker .iwb-editor-color-panel-input { width: 42px; height: 28px; padding: 0; opacity: 1; cursor: pointer; border: 1px solid #585b70; border-radius: 4px; }
|
||
.iwb-editor-color-panel .iwb-editor-color-swatches { display: grid; grid-template-columns: repeat(6, 20px); gap: 7px; }
|
||
.iwb-editor-color-panel .iwb-editor-color-panel-swatch { width: 20px; height: 20px; border-radius: 50%; padding: 0; }
|
||
|
||
.iwb-editor-inline-picker { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
|
||
.iwb-editor-inline-picker .iwb-editor-color-panel-input { width: 42px; height: 28px; padding: 0; opacity: 1; cursor: pointer; border: 1px solid #585b70; border-radius: 4px; }
|
||
.iwb-editor-color-panel .iwb-editor-color-swatches { display: grid; grid-template-columns: repeat(6, 20px); gap: 7px; }
|
||
.iwb-editor-color-panel .iwb-editor-color-panel-swatch { width: 20px; height: 20px; border-radius: 50%; padding: 0; }
|
||
|
||
.iwb-editor-inline-picker { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
|
||
.iwb-editor-inline-picker .iwb-editor-color-panel-input { width: 42px; height: 28px; padding: 0; opacity: 1; cursor: pointer; border: 1px solid #585b70; border-radius: 4px; }
|
||
.iwb-editor-color-panel .iwb-editor-color-swatches { display: grid; grid-template-columns: repeat(6, 20px); gap: 7px; }
|
||
.iwb-editor-color-panel .iwb-editor-color-panel-swatch { width: 20px; height: 20px; border-radius: 50%; padding: 0; }
|
||
|
||
.iwb-editor-color-panel { padding: 9px; }
|
||
.iwb-editor-inline-picker { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
|
||
.iwb-editor-inline-picker .iwb-editor-color-panel-input { display: block; width: 44px; height: 30px; padding: 0; opacity: 1; cursor: pointer; border: 1px solid #585b70; border-radius: 4px; }
|
||
.iwb-editor-color-panel .iwb-editor-color-swatches { display: grid; grid-template-columns: repeat(6, 20px); gap: 7px; }
|
||
.iwb-editor-color-panel .iwb-editor-color-panel-swatch { width: 20px; height: 20px; border-radius: 50%; padding: 0; }
|
||
.iwb-editor-color-panel .iwb-editor-color-panel-swatch.active { outline: 2px solid #fff; outline-offset: 2px; }
|
||
|
||
.iwb-editor-color-picker2 { display: flex; gap: 8px; height: 118px; }
|
||
.iwb-color-sv { position: relative; flex: 1; background: linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0)); background-color: #f44; border-radius: 4px; }
|
||
.iwb-color-hue { width: 18px; border-radius: 4px; background: linear-gradient(to bottom,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00); }
|
||
.iwb-editor-color-fields { display: flex; gap: 6px; margin: 8px 0; }
|
||
.iwb-editor-color-hex-input { width: 72px; background:#313244; color:#cdd6f4; border:1px solid #585b70; padding:4px; }
|
||
.iwb-editor-color-panel-input { width: 32px; height: 26px; opacity: 1; padding: 0; }
|
||
|
||
.iwb-color-sv span, .iwb-color-hue span { position: absolute; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #222; transform: translate(-50%, -50%); pointer-events: none; }
|
||
.iwb-color-sv span { left: 100%; top: 0; }
|
||
.iwb-color-hue span { left: 50%; top: 0; }
|
||
|
||
.iwb-compress-btn { color: #16a34a !important; font-size: 11px; font-weight: 700; }
|
||
|
||
/* 新版浮动气泡栏内的工具按钮 */
|
||
.iwb-node-floatbar .iwb-compress-btn { font-size: 11px; font-weight: 700; }
|
||
.iwb-node-floatbar .iwb-cutout-btn.processing,
|
||
.iwb-node-floatbar .iwb-whitebg-btn.processing,
|
||
.iwb-node-floatbar .iwb-compress-btn.processing { animation: iwb-cutout-pulse 1s infinite; pointer-events: none; }
|
||
|
||
|
||
/* 调色板:吸色按钮(替代原来的弹出式取色器) */
|
||
.iwb-editor-color-eye { width: 26px; height: 26px; border: 1px solid #585b70; border-radius: 4px; background: #313244; color: #cdd6f4; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
|
||
.iwb-editor-color-eye:hover { border-color: #e8a735; color: #e8a735; }
|
||
|
||
/* 矢量对象独立画布:与位图图层统一参与 z 排序 */
|
||
.iwb-editor-vec-canvas { position: absolute; top: 0; left: 0; z-index: 1; background: transparent !important; }
|
||
|
||
/* 空白画布创建菜单 */
|
||
.iwb-blank-menu { position: fixed; width: 242px; background: #fff; border: 1px solid #d0d7de; border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.2); padding: 10px; z-index: 2147483000; font-size: 12px; color: #1f2328; }
|
||
.iwb-blank-menu .iwb-blank-title { font-weight: 700; font-size: 12px; margin-bottom: 8px; }
|
||
.iwb-blank-menu .iwb-blank-bg, .iwb-blank-menu .iwb-blank-res { display: flex; align-items: center; gap: 5px; margin-bottom: 7px; }
|
||
.iwb-blank-menu .iwb-blank-bg span, .iwb-blank-menu .iwb-blank-res span { color: #656d76; min-width: 26px; }
|
||
.iwb-blank-menu button { border: 1px solid #d0d7de; background: #f6f8fa; color: #1f2328; border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: 11px; }
|
||
.iwb-blank-menu button:hover { background: #eff2f4; }
|
||
.iwb-blank-menu button.on { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }
|
||
.iwb-blank-menu .iwb-blank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
|
||
.iwb-blank-menu .iwb-blank-grid button { display: flex; flex-direction: column; gap: 1px; align-items: center; padding: 5px 4px; }
|
||
.iwb-blank-menu .iwb-blank-grid b { font-weight: 600; }
|
||
.iwb-blank-menu .iwb-blank-grid i { font-style: normal; color: #656d76; font-size: 10px; }
|
||
|
||
/* 空参考图节点:常驻“空白画布”按钮(位于节点顶部中央) */
|
||
.iwb-blank-inline-btn { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 6; display: inline-flex; align-items: center; gap: 5px; background: #fff; border: 1px solid #d0d7de; border-radius: 14px; padding: 4px 11px; color: #0ea5e9; font-size: 11px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
|
||
.iwb-blank-inline-btn:hover { background: #f0f9ff; border-color: #0ea5e9; }
|
||
.iwb-blank-inline-btn svg { width: 13px; height: 13px; }
|
||
|
||
/* ============ UI 布局重构(参照 excalidraw) ============ */
|
||
/* 顶部:功能按钮在左,工具栏横排整行、按快捷键排序并带数字角标 */
|
||
.iwb-editor-header { flex-wrap: wrap; }
|
||
.iwb-editor-header > .iwb-editor-title { order: 1; }
|
||
.iwb-editor-header > .iwb-editor-actions { order: 2; }
|
||
.iwb-editor-header > .iwb-editor-tools {
|
||
position: static;
|
||
order: 3;
|
||
flex: 1 1 100%;
|
||
width: auto;
|
||
left: auto;
|
||
top: auto;
|
||
margin-top: 8px;
|
||
flex-direction: row;
|
||
justify-content: center;
|
||
padding: 6px 10px;
|
||
border-radius: 10px;
|
||
}
|
||
.iwb-editor-tool { position: relative; }
|
||
.iwb-tool-key {
|
||
position: absolute;
|
||
right: -3px;
|
||
bottom: -3px;
|
||
font-size: 8px;
|
||
line-height: 1;
|
||
background: #45475a;
|
||
color: #cdd6f4;
|
||
padding: 1px 3px;
|
||
border-radius: 3px;
|
||
pointer-events: none;
|
||
font-style: normal;
|
||
font-weight: 600;
|
||
}
|
||
.iwb-editor-tool.active .iwb-tool-key { background: #1e1e2e; color: #e8a735; }
|
||
.iwb-editor-header > .iwb-editor-tools .iwb-editor-divider { width: 1px; height: 22px; margin: 0 6px; }
|
||
|
||
/* 左侧:工具参数设定栏(缩放/实心/图层/描边/硬度/透明度) */
|
||
.iwb-editor-params {
|
||
width: 216px;
|
||
min-width: 216px;
|
||
flex: 0 0 216px;
|
||
flex-direction: column;
|
||
align-items: stretch;
|
||
gap: 12px;
|
||
margin-left: 0;
|
||
padding: 14px 12px;
|
||
background: #181825;
|
||
border-right: 1px solid #313244;
|
||
overflow-y: auto;
|
||
}
|
||
.iwb-editor-params .iwb-editor-zoom { margin-left: 0; order: 0; }
|
||
.iwb-editor-params .iwb-editor-zoom .iwb-editor-zoom-val { min-width: 52px; text-align: center; }
|
||
.iwb-editor-params .iwb-editor-layer-group { flex-wrap: wrap; justify-content: flex-start; }
|
||
.iwb-editor-params .iwb-editor-brush-label { width: 100%; }
|
||
.iwb-editor-params .iwb-editor-brush-presets { justify-content: flex-start; }
|
||
.iwb-editor-params .iwb-editor-fill-btn { align-self: stretch; }
|
||
.iwb-editor-main { display: flex; flex-direction: row; }
|
||
|
||
/* ======== 布局重构 v2(按用户 6 点) ======== */
|
||
.iwb-editor-main { display: flex; flex-direction: row; align-items: stretch; }
|
||
|
||
/* 顶部一行:标题 + 工具栏(含数字角标) + 撤销重做清空还原 */
|
||
.iwb-editor-header { flex-wrap: nowrap; align-items: center; }
|
||
.iwb-editor-header > .iwb-editor-title { order: 0; }
|
||
.iwb-editor-header > .iwb-editor-tools {
|
||
position: static; order: 1; flex: 1 1 auto; flex-basis: auto;
|
||
margin-top: 0; width: auto; left: auto; top: auto;
|
||
flex-direction: row; justify-content: center;
|
||
padding: 0; background: transparent; border: 0; border-radius: 0;
|
||
}
|
||
.iwb-editor-header > .iwb-editor-divider { order: 2; }
|
||
.iwb-editor-header > .iwb-editor-history { order: 3; display: flex; align-items: center; gap: 4px; }
|
||
|
||
/* 左栏:调色板在上,参数竖排,导出按钮底部 */
|
||
.iwb-editor-left {
|
||
width: 240px; min-width: 240px; flex: 0 0 240px;
|
||
display: flex; flex-direction: column; gap: 14px;
|
||
padding: 12px; background: #181825; border-right: 1px solid #313244; overflow-y: auto;
|
||
}
|
||
.iwb-editor-left > .iwb-editor-color-panel { padding: 0; background: transparent; border-bottom: 0; }
|
||
.iwb-editor-left > .iwb-editor-params {
|
||
width: auto; min-width: 0; flex: 1 1 auto;
|
||
flex-direction: column; align-items: stretch; gap: 12px; margin-left: 0; padding: 0;
|
||
}
|
||
.iwb-editor-left > .iwb-editor-export-actions {
|
||
display: flex; flex-direction: column; gap: 8px;
|
||
margin-top: auto; padding-top: 12px; border-top: 1px solid #313244;
|
||
}
|
||
.iwb-editor-left > .iwb-editor-export-actions .iwb-editor-btn { width: 100%; }
|
||
|
||
/* 参数竖排:一行一个设置 */
|
||
.iwb-editor-params .iwb-editor-brush-group { display: flex; flex-direction: column; gap: 10px; }
|
||
.iwb-editor-params .iwb-editor-zoom .iwb-editor-zoom-btn,
|
||
.iwb-editor-params .iwb-editor-zoom .iwb-editor-zoom-val { flex: 1 1 auto; }
|
||
.iwb-editor-params .iwb-editor-layer-group { flex-wrap: wrap; }
|
||
|
||
/* 颜色值后面的 实心/边线 切换 */
|
||
.iwb-editor-fill-pair { display: inline-flex; margin-left: 6px; }
|
||
.iwb-editor-fill-pair .iwb-editor-fill-btn { align-self: center; }
|
||
|
||
/* ======== 布局优化 v3 ======== */
|
||
/* 左栏可交互(避免被画布/层级遮挡导致“调节不起作用”) */
|
||
.iwb-editor-left { position: relative; z-index: 40; pointer-events: auto; }
|
||
.iwb-editor-left input, .iwb-editor-left select, .iwb-editor-left button, .iwb-editor-left label { pointer-events: auto; }
|
||
|
||
/* 顶部工具栏内的 面/边(实心) 切换按钮 */
|
||
.iwb-editor-tools .iwb-editor-fill-btn {
|
||
width: 42px; height: 32px; padding: 0; border: 0; border-radius: 8px;
|
||
background: transparent; color: #cdd6f4; cursor: pointer; font-size: 11px; font-weight: 600;
|
||
}
|
||
.iwb-editor-tools .iwb-editor-fill-btn:hover { background: #45475a; }
|
||
.iwb-editor-tools .iwb-editor-fill-btn.active { background: #e8a735; color: #1e1e2e; }
|
||
|
||
/* 右侧图层面板内的图层顺序按钮 */
|
||
.iwb-editor-layer-panel .iwb-editor-layer-group {
|
||
display: flex; align-items: center; gap: 6px;
|
||
padding: 10px 12px; border-bottom: 1px solid #313244;
|
||
}
|
||
.iwb-editor-layer-panel .iwb-editor-layer-group .iwb-editor-constraint-label { color: #a6adc8; font-size: 12px; margin-right: 2px; }
|
||
|
||
/* 缩放(画面调整)移到左栏下方 */
|
||
.iwb-editor-params .iwb-editor-zoom {
|
||
order: 99; margin-top: 10px; padding-top: 10px; border-top: 1px solid #313244;
|
||
}
|
||
.iwb-editor-params .iwb-editor-zoom .iwb-editor-zoom-btn { flex: 0 0 auto; }
|
||
.iwb-editor-params .iwb-editor-zoom .iwb-editor-zoom-val { flex: 0 0 auto; }
|
||
|
||
/* ======== 布局优化 v4 ======== */
|
||
/* 交换左右栏:图层在左,调色板/参数在右 */
|
||
.iwb-editor-main { flex-direction: row; }
|
||
.iwb-editor-main > .iwb-editor-layer-panel { order: 1; border-left: 0; border-right: 1px solid #313244; }
|
||
.iwb-editor-main > .iwb-editor-canvas-wrap { order: 2; }
|
||
.iwb-editor-left { order: 3; border-right: 0; border-left: 1px solid #313244; }
|
||
|
||
/* 硬度/透明度 数值与滑块对齐 */
|
||
.iwb-editor-params .iwb-editor-brush-label .iwb-editor-brush-hardness-val,
|
||
.iwb-editor-params .iwb-editor-brush-label .iwb-editor-brush-opacity-val {
|
||
min-width: 40px; text-align: right; color: #cdd6f4; font-size: 12px;
|
||
}
|
||
.iwb-editor-params .iwb-editor-brush-label input[type="range"] { flex: 1 1 auto; }
|
||
|
||
/* 缩放块放在参数区最底部 */
|
||
.iwb-editor-params .iwb-editor-zoom, .iwb-editor-left .iwb-editor-zoom {
|
||
display: flex; align-items: center; justify-content: center; gap: 8px;
|
||
width: 100%; padding: 8px 4px; border-top: 1px solid #313244; margin-top: 12px;
|
||
}
|
||
.iwb-editor-left .iwb-editor-zoom .iwb-editor-zoom-btn {
|
||
flex: 0 0 auto; min-width: 28px; height: 26px; background: #313244; color: #cdd6f4; border: 0; border-radius: 6px; cursor: pointer; font-size: 14px;
|
||
}
|
||
.iwb-editor-left .iwb-editor-zoom .iwb-editor-zoom-btn:hover { background: #45475a; }
|
||
.iwb-editor-left .iwb-editor-zoom .iwb-editor-zoom-val { min-width: 52px; text-align: center; color: #cdd6f4; font: 600 12px sans-serif; }
|
||
|
||
/* 调色板与下方参数调节之间的横线分割 */
|
||
.iwb-editor-params { border-top: 1px solid #313244; padding-top: 12px; }
|
||
|
||
/* 色相条指示器需定位父级相对 */
|
||
.iwb-color-hue { position: relative; }
|
||
|
||
/* 顶部实心按钮与工具匹配:默认背景 */
|
||
.iwb-editor-tools .iwb-editor-fill-btn { background: #313244; color: #cdd6f4; }
|
||
|
||
/* 裁剪工具条:三行展示(比例 / 尺寸 / 确认取消),避免被挤压 */
|
||
.iwb-editor-crop-bar {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 8px;
|
||
align-items: center;
|
||
padding: 10px 14px;
|
||
}
|
||
.iwb-editor-crop-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; gap: 6px; }
|
||
.iwb-editor-crop-row .iwb-editor-constraint-group { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
|
||
.iwb-editor-crop-actions { gap: 10px; }
|
||
.iwb-editor-crop-actions .iwb-editor-crop-info { min-width: 88px; text-align: center; }
|
||
.iwb-editor-constraint-sep { display: none; }
|
||
|
||
/* ======== 修复:左列(图层)占满高度,三列稳定布局 ======== */
|
||
.iwb-editor-main { display: flex; flex-direction: row; align-items: stretch; }
|
||
.iwb-editor-main > .iwb-editor-layer-panel { flex: 0 0 290px; min-width: 290px; width: 290px; }
|
||
.iwb-editor-main > .iwb-editor-canvas-wrap { flex: 1 1 auto; min-width: 0; }
|
||
.iwb-editor-left { flex: 0 0 240px; min-width: 240px; width: 240px; }
|
||
.iwb-editor-layer-panel .iwb-editor-layer-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
|
||
|
||
/* ======== 顶部布局 v5:左侧重置类 / 中间工具 / 右侧保存类 ======== */
|
||
.iwb-editor-header > .iwb-editor-title { order: 0; }
|
||
.iwb-editor-header > .iwb-editor-history { order: 1; display: flex; align-items: center; gap: 4px; }
|
||
.iwb-editor-header > .iwb-editor-tools { order: 2; flex: 1 1 auto; justify-content: center; }
|
||
.iwb-editor-header > .iwb-editor-export-actions { order: 3; display: flex; align-items: center; gap: 6px; margin-left: 4px; }
|
||
|
||
/* 重置类(撤销/重做/清空/复原)统一小圆角按钮 */
|
||
.iwb-editor-header .iwb-editor-history .iwb-editor-action {
|
||
width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px;
|
||
background: #313244; color: #cdd6f4; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
|
||
}
|
||
.iwb-editor-header .iwb-editor-history .iwb-editor-action:hover { background: #45475a; }
|
||
.iwb-editor-header .iwb-editor-history .iwb-editor-action-restore { background: #313244; color: #cdd6f4; }
|
||
|
||
/* 保存类(新建/覆盖/退出)统一样式 */
|
||
.iwb-editor-header .iwb-editor-export-actions .iwb-editor-btn {
|
||
height: 30px; padding: 0 14px; border: 0; border-radius: 8px; font-size: 12px; font-weight: 600;
|
||
background: #313244; color: #cdd6f4; cursor: pointer;
|
||
}
|
||
.iwb-editor-header .iwb-editor-export-actions .iwb-editor-btn:hover { background: #45475a; }
|
||
|
||
/* 调色板与参数之间的分割线及间距 */
|
||
.iwb-editor-left > .iwb-editor-params { border-top: 1px solid #313244; margin-top: 16px; padding-top: 16px; }
|
||
|
||
/* 笔刷快捷值 7 档圆点 */
|
||
.iwb-editor-brush-presets { display: flex; align-items: center; gap: 8px; }
|
||
.iwb-editor-brush-preset i { width: 6px; height: 6px; }
|
||
.iwb-editor-brush-preset:nth-child(2) i { width: 8px; height: 8px; }
|
||
.iwb-editor-brush-preset:nth-child(3) i { width: 10px; height: 10px; }
|
||
.iwb-editor-brush-preset:nth-child(4) i { width: 13px; height: 13px; }
|
||
.iwb-editor-brush-preset:nth-child(5) i { width: 16px; height: 16px; }
|
||
.iwb-editor-brush-preset:nth-child(6) i { width: 20px; height: 20px; }
|
||
.iwb-editor-brush-preset:nth-child(7) i { width: 24px; height: 24px; }
|
||
|
||
/* 缩放:缩小比例、圆角 */
|
||
.iwb-editor-left .iwb-editor-zoom { gap: 6px; padding: 6px 4px; margin-top: 10px; }
|
||
.iwb-editor-left .iwb-editor-zoom .iwb-editor-zoom-btn { min-width: 26px; height: 24px; border-radius: 8px; font-size: 13px; }
|
||
.iwb-editor-left .iwb-editor-zoom .iwb-editor-zoom-val { min-width: 44px; font-size: 11px; }
|
||
.iwb-editor-left .iwb-editor-zoom .iwb-editor-zoom-fit { font-size: 11px; padding: 0 8px; }
|
||
|
||
/* 笔刷快捷值:压缩横向间距,避免右栏出现横向滚动条 */
|
||
.iwb-editor-left { overflow-x: hidden; }
|
||
.iwb-editor-params { overflow-x: hidden; }
|
||
.iwb-editor-brush-presets { gap: 3px; flex-wrap: wrap; max-width: 100%; justify-content: flex-start; }
|
||
.iwb-editor-brush-preset { padding: 0 1px; min-width: 0; flex: 0 0 auto; }
|
||
.iwb-editor-brush-preset i { width: 5px; height: 5px; }
|
||
.iwb-editor-brush-preset:nth-child(2) i { width: 7px; height: 7px; }
|
||
.iwb-editor-brush-preset:nth-child(3) i { width: 9px; height: 9px; }
|
||
.iwb-editor-brush-preset:nth-child(4) i { width: 11px; height: 11px; }
|
||
.iwb-editor-brush-preset:nth-child(5) i { width: 14px; height: 14px; }
|
||
.iwb-editor-brush-preset:nth-child(6) i { width: 17px; height: 17px; }
|
||
.iwb-editor-brush-preset:nth-child(7) i { width: 20px; height: 20px; }
|
||
|
||
/* 去掉参数模块右侧的边线(隐藏纵向滚动条与右边框) */
|
||
.iwb-editor-left { border-right: 0 !important; scrollbar-width: none; -ms-overflow-style: none; }
|
||
.iwb-editor-left::-webkit-scrollbar { width: 0; height: 0; display: none; }
|
||
.iwb-editor-left > .iwb-editor-params { border-right: 0; }
|
||
.iwb-editor-brush-presets::-webkit-scrollbar { width: 0; height: 0; display: none; }
|
||
|
||
/* 独立悬浮工具条(扩展自建,不插入应用 React DOM) */
|
||
.iwb-cutout-toolbar {
|
||
position: fixed; z-index: 2147483000; display: none; align-items: center; gap: 3px;
|
||
padding: 4px 6px; border-radius: 14px; background: #fff;
|
||
border: 1px solid #d0d7de; box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
|
||
pointer-events: auto;
|
||
}
|
||
.iwb-cutout-toolbar button {
|
||
width: 30px; height: 28px; padding: 0; border: 0; border-radius: 8px;
|
||
background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
|
||
}
|
||
.iwb-cutout-toolbar button:hover { background: #eef2f7; }
|
||
.iwb-cutout-toolbar button i { font-style: normal; font-size: 11px; font-weight: 700; }
|
||
.iwb-cutout-toolbar button svg { display: block; }
|
||
|
||
/* 顶部左右两组工具交换:左=新建/覆盖/退出,右=撤销/重做/清空/复原 */
|
||
.iwb-editor-header > .iwb-editor-title { order: 0; }
|
||
/* 输出设定 + 下载/新建/覆盖/退出 收在顶栏最右侧(用户裁定 2026-11-04):
|
||
order 排最后 + margin-left:auto 兜底,中间工具区 flex:1 会把它顶到右端 */
|
||
.iwb-editor-header > .iwb-editor-export-actions { order: 9; margin-left: auto; margin-right: 0; flex: 0 0 auto; }
|
||
.iwb-editor-header > .iwb-editor-tools { order: 2; flex: 1 1 auto; justify-content: center; }
|
||
.iwb-editor-header > .iwb-editor-history { order: 3; margin-left: 0; }
|
||
|
||
/* 图层面板:放大锁定 / 删除按钮的点击区域与图标 */
|
||
.iwb-editor-layer-panel .iwb-layer-lock,
|
||
.iwb-editor-layer-panel .iwb-layer-del {
|
||
width: 24px; height: 24px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
|
||
}
|
||
.iwb-editor-layer-panel .iwb-layer-lock svg,
|
||
.iwb-editor-layer-panel .iwb-layer-del svg { width: 16px; height: 16px; }
|
||
|
||
|
||
/* 图层按钮图标统一 14px */
|
||
.iwb-editor-layer-panel .iwb-layer-vis svg,
|
||
.iwb-editor-layer-panel .iwb-layer-lock svg,
|
||
.iwb-editor-layer-panel .iwb-layer-del svg { width: 14px; height: 14px; }
|
||
.iwb-editor-layer-panel .iwb-layer-vis,
|
||
.iwb-editor-layer-panel .iwb-layer-lock,
|
||
.iwb-editor-layer-panel .iwb-layer-del { width: 22px; height: 22px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
|
||
|
||
/* ================================================================
|
||
v1.1 便利版 UI(单张处理)
|
||
只追加、不重写历史样式:旧规则里的魔数定位在这里统一覆盖。
|
||
分区:顶栏 / 就地选项栏 / 竖工具栏 / 画布浮层 / 状态栏 / toast
|
||
================================================================ */
|
||
|
||
/* ---- 顶栏:精简、一步可达 ---- */
|
||
.iwb-editor-header { min-height: 44px; padding: 6px 12px; gap: 8px; }
|
||
.iwb-editor-title em.iwb-editor-doc-size { font-style: normal; font-weight: 400; font-size: 11px; color: #7f849c; margin-left: 6px; }
|
||
.iwb-editor-optionbar {
|
||
display: flex; align-items: center; gap: 10px;
|
||
height: 36px; min-height: 36px; padding: 0 12px;
|
||
background: #202033; border-bottom: 1px solid #313244;
|
||
color: #a6adc8; font-size: 12px;
|
||
}
|
||
.iwb-editor-optionbar-label { color: #7f849c; font-weight: 600; white-space: nowrap; }
|
||
.iwb-editor-optionbar-body { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
|
||
/* 右端通用快捷键提示。原来只有 @media 里的 display:none,没有任何基础样式,
|
||
于是它作为裸 span 参与 flex 收缩,被挤成两行还贴到右边缘外。 */
|
||
.iwb-editor-optionbar-tip {
|
||
flex: 0 0 auto; white-space: nowrap;
|
||
color: #6c7086; font-size: 11px; padding-left: 4px;
|
||
}
|
||
.iwb-opt-label { color: #a6adc8; white-space: nowrap; }
|
||
.iwb-opt-btn {
|
||
background: #313244; color: #cdd6f4; border: 1px solid transparent; border-radius: 5px;
|
||
padding: 3px 9px; font-size: 12px; cursor: pointer;
|
||
}
|
||
.iwb-opt-btn:hover { background: #45475a; }
|
||
.iwb-opt-btn.active { background: #4488ff; color: #fff; }
|
||
.iwb-opt-num {
|
||
width: 46px; padding: 2px 4px; background: #313244; color: #e8a735;
|
||
border: 1px solid #45475a; border-radius: 5px; text-align: center; font-size: 12px;
|
||
}
|
||
/* 字体下拉:flex:0 0 auto 不能被压 —— 选项文字是 2 个汉字宽,压窄后会被截成「黑…」,
|
||
用户没法确认自己选的是哪一档。 */
|
||
.iwb-opt-select {
|
||
flex: 0 0 auto; padding: 2px 4px; background: #313244; color: #cdd6f4;
|
||
border: 1px solid #45475a; border-radius: 5px; font-size: 12px; cursor: pointer;
|
||
}
|
||
.iwb-opt-select:hover { background: #45475a; }
|
||
.iwb-opt-select option { background: #1e1e2e; color: #cdd6f4; }
|
||
.iwb-opt-current { color: #e8a735; font-weight: 600; white-space: nowrap; }
|
||
/* hint 是「说明」不是「控件」:不许被压缩。
|
||
早先带 text-overflow:ellipsis,在 36px 高的选项栏里会被压成「双击改…」这种半截文案,
|
||
比不显示更误导人;现在由父级 overflow-x 决定是完整显示还是整体滚出视野。 */
|
||
.iwb-opt-hint { color: #7f849c; font-size: 11px; margin-left: auto; white-space: nowrap; flex: 0 0 auto; }
|
||
|
||
.iwb-editor-more-wrap, .iwb-editor-export-settings-wrap { position: relative; flex: 0 0 auto; z-index: 45; }
|
||
.iwb-editor-more-btn, .iwb-editor-panel-toggle, .iwb-editor-export-settings-btn {
|
||
background: #313244; color: #cdd6f4; border: 1px solid #45475a; border-radius: 6px;
|
||
padding: 5px 10px; font-size: 12px; cursor: pointer; white-space: nowrap;
|
||
}
|
||
.iwb-editor-more-btn:hover, .iwb-editor-panel-toggle:hover, .iwb-editor-export-settings-btn:hover { background: #45475a; }
|
||
.iwb-editor-panel-toggle { padding: 5px 8px; }
|
||
.iwb-editor-export-summary { color: #e8a735; margin: 0 2px; }
|
||
|
||
.iwb-editor-more-menu, .iwb-editor-export-settings {
|
||
display: none; position: absolute; top: 34px; z-index: 60;
|
||
background: #252537; border: 1px solid #45475a; border-radius: 8px;
|
||
padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.45);
|
||
}
|
||
.iwb-editor-more-menu { left: 0; width: 206px; flex-direction: column; gap: 2px; }
|
||
.iwb-editor-more-menu.open, .iwb-editor-export-settings.open { display: flex; flex-direction: column; gap: 4px; }
|
||
.iwb-editor-export-settings { right: 0; width: 268px; }
|
||
.iwb-editor-more-menu button, .iwb-editor-export-row button {
|
||
background: transparent; color: #cdd6f4; border: 0; border-radius: 5px;
|
||
padding: 6px 8px; font-size: 12px; text-align: left; cursor: pointer; white-space: nowrap;
|
||
}
|
||
.iwb-editor-more-menu button:hover, .iwb-editor-export-row button:hover { background: #3b3d52; }
|
||
.iwb-editor-more-menu kbd { float: right; color: #7f849c; font-size: 10px; }
|
||
.iwb-editor-more-sep { height: 1px; background: #45475a; margin: 4px 0; }
|
||
.iwb-editor-export-row { display: flex; align-items: center; gap: 4px; }
|
||
.iwb-editor-export-row > span { width: 34px; flex: 0 0 34px; color: #7f849c; font-size: 11px; }
|
||
.iwb-editor-export-row button { flex: 1 1 auto; text-align: center; background: #313244; }
|
||
.iwb-editor-export-row button.active { background: #4488ff; color: #fff; }
|
||
.iwb-editor-export-note { color: #7f849c; font-size: 11px; border-top: 1px solid #313244; padding-top: 6px; }
|
||
.iwb-editor-btn-download { background: #1a7f37 !important; color: #fff !important; }
|
||
.iwb-editor-btn-download:hover { background: #15803d !important; }
|
||
|
||
/* ---- v1.2.8:底部浮动工具栏(Figma 风格,横排悬浮在画布底部居中) ----
|
||
工具栏已从 header 移进 canvas-wrap,只占画布区域宽度,不挤压左右面板;
|
||
bottom 距容器 14px,配合 computeFit() 预留的底部空间,图片不会被压住。 */
|
||
.iwb-editor-canvas-wrap > .iwb-editor-tools {
|
||
position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
|
||
display: flex; flex-direction: row; align-items: center; gap: 2px;
|
||
padding: 5px 8px; border-radius: 14px;
|
||
background: rgba(24, 24, 37, 0.94);
|
||
border: 1px solid #313244;
|
||
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
|
||
-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
|
||
z-index: 40;
|
||
max-width: calc(100% - 28px);
|
||
overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
|
||
}
|
||
.iwb-editor-canvas-wrap > .iwb-editor-tools::-webkit-scrollbar { display: none; }
|
||
.iwb-editor-canvas-wrap > .iwb-editor-tools .iwb-editor-tool,
|
||
.iwb-editor-canvas-wrap > .iwb-editor-tools .iwb-editor-action {
|
||
width: 32px !important; height: 32px !important; min-width: 32px; flex: 0 0 auto; border-radius: 9px;
|
||
}
|
||
.iwb-editor-canvas-wrap > .iwb-editor-tools .iwb-editor-divider {
|
||
width: 1px; height: 20px; margin: 0 5px; flex: 0 0 auto; background: #45475a;
|
||
}
|
||
.iwb-editor-main { padding-left: 0; }
|
||
.iwb-editor-main > .iwb-editor-layer-panel { flex: 0 0 260px !important; min-width: 260px !important; width: 260px !important; }
|
||
.iwb-editor-left { flex: 0 0 220px !important; min-width: 220px !important; width: 220px !important; }
|
||
.iwb-editor-overlay.panels-collapsed .iwb-editor-layer-panel,
|
||
.iwb-editor-overlay.panels-collapsed .iwb-editor-left { display: none !important; }
|
||
.iwb-editor-zoom-hint { display: none !important; }
|
||
|
||
/* ---- 交互层:蚂蚁线 / 笔刷环各自独立,互不擦除 ---- */
|
||
.iwb-editor-selection-overlay, .iwb-editor-cursor-overlay {
|
||
position: absolute; top: 0; left: 0; display: block; pointer-events: none;
|
||
background: transparent !important;
|
||
}
|
||
.iwb-editor-selection-overlay { z-index: 11; }
|
||
.iwb-editor-cursor-overlay { z-index: 12; }
|
||
|
||
/* ---- 选区浮动操作条(体验后再定去留;纯视图,可随时替换) ---- */
|
||
.iwb-editor-sel-bar {
|
||
display: none; position: absolute; z-index: 30; align-items: center; gap: 4px;
|
||
padding: 5px 6px; background: rgba(24,24,37,0.96);
|
||
border: 1px solid #45475a; border-radius: 8px;
|
||
box-shadow: 0 8px 26px rgba(0,0,0,0.45); white-space: nowrap;
|
||
}
|
||
.iwb-editor-sel-bar.as-menu { border-color: #4488ff; }
|
||
.iwb-editor-sel-bar .iwb-editor-sel-info {
|
||
color: #7f849c; font-size: 11px; padding: 0 6px;
|
||
border-right: 1px solid #45475a; margin-right: 2px; font-variant-numeric: tabular-nums;
|
||
}
|
||
.iwb-editor-sel-bar button {
|
||
background: #313244; color: #cdd6f4; border: 1px solid transparent; border-radius: 5px;
|
||
padding: 4px 8px; font-size: 12px; cursor: pointer;
|
||
}
|
||
.iwb-editor-sel-bar button:hover:not(:disabled) { background: #4488ff; color: #fff; }
|
||
.iwb-editor-sel-bar button[data-sel-cmd="sel.delete"]:hover:not(:disabled) { background: #cf222e; }
|
||
.iwb-editor-sel-bar button:disabled { opacity: 0.35; cursor: not-allowed; }
|
||
|
||
/* ---- 状态栏 / toast ---- */
|
||
.iwb-editor-statusbar {
|
||
display: flex; align-items: center; gap: 14px;
|
||
height: 26px; min-height: 26px; padding: 0 12px;
|
||
background: #181825; border-top: 1px solid #313244;
|
||
color: #a6adc8; font-size: 11px; font-variant-numeric: tabular-nums;
|
||
}
|
||
.iwb-editor-statusbar span + span { border-left: 1px solid #313244; padding-left: 14px; }
|
||
.iwb-editor-status-tool { margin-left: auto; color: #e8a735; }
|
||
.iwb-editor-toast {
|
||
position: fixed; left: 50%; bottom: 46px; z-index: 1000000;
|
||
transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
|
||
transition: opacity 0.2s, transform 0.2s;
|
||
background: #313244; color: #cdd6f4; padding: 8px 14px; border-radius: 8px;
|
||
font-size: 12px; max-width: 80vw; box-shadow: 0 8px 26px rgba(0,0,0,0.45);
|
||
}
|
||
.iwb-editor-toast.show { opacity: 1; transform: translate(-50%, 0); }
|
||
.iwb-editor-toast-success { background: #1a7f37; color: #fff; }
|
||
.iwb-editor-toast-error { background: #cf222e; color: #fff; }
|
||
.iwb-editor-toast-warn { background: #b06a00; color: #fff; }
|
||
.iwb-editor-toast-info { background: #2f6fed; color: #fff; }
|
||
|
||
@media (max-width: 900px) {
|
||
.iwb-opt-hint, .iwb-editor-optionbar-tip { display: none; }
|
||
.iwb-editor-session .iwb-editor-btn-cancel,
|
||
.iwb-editor-export-actions .iwb-editor-btn-cancel { display: none; }
|
||
}
|
||
|
||
|
||
/* 输出设置:按预设显示的行(尺寸/体积只属于电商方图)
|
||
注意 `.iwb-editor-export-row` 是 display:flex,会盖掉 UA 的 [hidden]{display:none},
|
||
必须显式 !important,否则 JS 设 hidden 后行还留在面板里。 */
|
||
.iwb-editor-export-row[hidden] { display: none !important; }
|
||
.iwb-editor-export-settings [data-export-key]:disabled {
|
||
opacity: 0.32; cursor: not-allowed; text-decoration: line-through;
|
||
}
|
||
.iwb-editor-export-settings [data-export-key]:disabled:hover { background: #313244; }
|
||
|
||
/* 选项栏参数控件(v1.2):滑杆 + 数字框 + 实时读数,一行放得下就该保持一行 */
|
||
.iwb-opt-range {
|
||
width: 84px; height: 4px; flex: 0 0 auto;
|
||
accent-color: #4488ff; cursor: pointer;
|
||
}
|
||
.iwb-opt-val {
|
||
min-width: 32px; flex: 0 0 auto; color: #e8a735; font-size: 11px;
|
||
font-variant-numeric: tabular-nums; text-align: right;
|
||
}
|
||
.iwb-opt-unit { color: #7f849c; font-size: 11px; flex: 0 0 auto; }
|
||
/* 窄屏:参数多到放不下时横向滚动,不换行(换行会把 36px 高的选项栏撑开压画布) */
|
||
.iwb-editor-optionbar-body { overflow-x: auto; scrollbar-width: none; }
|
||
.iwb-editor-optionbar-body::-webkit-scrollbar { display: none; }
|
||
@media (max-width: 1100px) {
|
||
.iwb-opt-range { width: 64px; }
|
||
}
|
||
|
||
/* ---- v1.2.2 ---- */
|
||
/* 选项栏快捷值圆点(笔刷大小 / 矢量描边推荐值),与侧栏描边快捷点同交互 */
|
||
.iwb-opt-dots { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; }
|
||
.iwb-opt-dot {
|
||
display: inline-flex; align-items: center; justify-content: center;
|
||
width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%;
|
||
background: transparent; cursor: pointer;
|
||
}
|
||
.iwb-opt-dot i { display: block; width: 5px; height: 5px; border-radius: 50%; background: #e8a735; border: 1px solid #f6d38a; }
|
||
.iwb-opt-dot:nth-child(2) i { width: 7px; height: 7px; }
|
||
.iwb-opt-dot:nth-child(3) i { width: 9px; height: 9px; }
|
||
.iwb-opt-dot:nth-child(4) i { width: 11px; height: 11px; }
|
||
.iwb-opt-dot:nth-child(5) i { width: 14px; height: 14px; }
|
||
.iwb-opt-dot:nth-child(6) i { width: 17px; height: 17px; }
|
||
.iwb-opt-dot:nth-child(7) i { width: 20px; height: 20px; }
|
||
.iwb-opt-dot:hover { background: #313244; }
|
||
|
||
/* 裁剪控件在选项栏内联布局(旧 .iwb-editor-crop-bar 的绝对定位容器已删除) */
|
||
.iwb-editor-optionbar-body .iwb-editor-crop-info {
|
||
min-width: 88px; text-align: center; color: #e8a735;
|
||
font-size: 11px; font-variant-numeric: tabular-nums; flex: 0 0 auto;
|
||
}
|
||
.iwb-editor-optionbar-body .iwb-editor-size-input {
|
||
width: 52px; padding: 2px 5px; font-size: 11px;
|
||
background: #1e2030; color: #e5e9f0;
|
||
border: 1px solid #45475a; border-radius: 4px;
|
||
}
|
||
.iwb-editor-optionbar-body .iwb-editor-size-input:focus { outline: none; border-color: #4488ff; }
|
||
/* 硬度滑杆加宽:参数太密时默认 84px 拉不开,用户反馈「软度调节不明显」(2026-11-04) */
|
||
.iwb-editor-optionbar-body .iwb-opt-range-wide { width: 140px; }
|
||
.iwb-editor-optionbar-body .iwb-opt-dots { margin-left: 2px; }
|
||
.iwb-editor-optionbar-body .iwb-editor-size-input::-webkit-inner-spin-button { -webkit-appearance: none; }
|
||
.iwb-editor-optionbar-body .iwb-editor-crop-confirm,
|
||
.iwb-editor-optionbar-body .iwb-editor-crop-cancel {
|
||
padding: 3px 10px; border: 0; border-radius: 4px; cursor: pointer; font-size: 12px; flex: 0 0 auto;
|
||
}
|
||
.iwb-editor-optionbar-body .iwb-editor-crop-confirm { background: #1a7f37; color: #fff; }
|
||
.iwb-editor-optionbar-body .iwb-editor-crop-confirm:hover { background: #15803d; }
|
||
.iwb-editor-optionbar-body .iwb-editor-crop-cancel { background: #cf222e; color: #fff; }
|
||
.iwb-editor-optionbar-body .iwb-editor-crop-cancel:hover { background: #b91c1c; }
|
||
|
||
/* ---- v1.2.3:侧栏只留调色板 + 缩放 ---- */
|
||
/* 笔刷粗细/快捷点从侧栏移除后,缩放条直接挂在 aside 下:贴底,与调色板拉开距离 */
|
||
.iwb-editor-left > .iwb-editor-zoom { margin-top: auto; border-top: 1px solid #313244; padding-top: 10px; }
|
||
|
||
/* ================================================================
|
||
v1.2.4:顶栏命令带(原「更多 ▾」图标化)
|
||
布局:标题 | 撤销·重做·还原 | ⟨图层 新建/导入⟩ ⟨顺序 置顶/上移/下移/置底⟩ ⟨视图 适应/侧栏⟩ | …… | 输出·下载·新建·覆盖·退出
|
||
================================================================ */
|
||
.iwb-editor-header > .iwb-editor-history { order: 1; }
|
||
.iwb-editor-header > .iwb-editor-commands { order: 3; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
|
||
.iwb-editor-header > .iwb-editor-commands .iwb-editor-divider { width: 1px; height: 20px; background: #313244; flex: 0 0 auto; }
|
||
.iwb-editor-cmdgroup { display: flex; align-items: center; gap: 4px; }
|
||
.iwb-editor-cmdgroup[data-group="order"] { gap: 2px; }
|
||
/* 顶栏里的命令按钮统一 30×30 方角,和撤销/重做同款 */
|
||
.iwb-editor-header > .iwb-editor-commands .iwb-editor-action,
|
||
.iwb-editor-header > .iwb-editor-commands .iwb-editor-layer-btn {
|
||
width: 30px; height: 30px; min-width: 30px; padding: 0; border: 0; border-radius: 8px;
|
||
background: #313244; color: #cdd6f4;
|
||
display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
|
||
}
|
||
.iwb-editor-header > .iwb-editor-commands .iwb-editor-action:hover:not(:disabled),
|
||
.iwb-editor-header > .iwb-editor-commands .iwb-editor-layer-btn:hover:not(:disabled) { background: #45475a; }
|
||
.iwb-editor-header > .iwb-editor-commands .iwb-editor-layer-btn:disabled { opacity: 0.35; cursor: not-allowed; }
|
||
/* 选区命令(全选/反选/取消):v1.2.5 起放在「选择」工具的选项栏里,不再占竖工具条 */
|
||
/* 分隔线只负责「分组」,不负责「推到右边」。
|
||
原来写的是 margin: 0 4px 0 auto —— auto 会把分隔线之后的内容整组推到最右侧,
|
||
在选项栏已经排满的情况下(文字样式那一行)直接把后面的选区按钮顶出可视区,
|
||
看起来就是「这个工具下没有那几个按钮」。留白交给末尾的 .iwb-opt-hint。 */
|
||
.iwb-opt-sep { width: 1px; height: 18px; background: #313244; margin: 0 2px; flex: 0 0 auto; }
|
||
.iwb-opt-selcmd {
|
||
width: 26px; height: 26px; min-width: 26px; padding: 0; border: 0; border-radius: 7px;
|
||
background: #26263a; color: #cdd6f4; flex: 0 0 auto;
|
||
display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
|
||
}
|
||
.iwb-opt-selcmd:hover { background: #45475a; }
|
||
|
||
/* ================================================================
|
||
v1.2.11:顶栏次序与配色(用户裁定 2026-11-04 晚)
|
||
布局:标题 | ⟨新建·覆盖·退出⟩ | 撤销·重做·还原 | 顺序·视图 | …… | 输出·导出
|
||
标题在前(它是标题,不能跑到按钮后面);会话组三键统一中性色,不再花
|
||
================================================================ */
|
||
.iwb-editor-header > .iwb-editor-title { order: 0; }
|
||
.iwb-editor-header > .iwb-editor-session { order: 1; display: flex; align-items: center; gap: 6px; flex: 0 0 auto; margin-left: 8px; }
|
||
.iwb-editor-header > .iwb-editor-session .iwb-editor-btn { padding: 6px 10px; font-size: 11px; min-width: 56px; white-space: nowrap; }
|
||
.iwb-editor-header > .iwb-editor-session .iwb-editor-btn-new,
|
||
.iwb-editor-header > .iwb-editor-session .iwb-editor-btn-replace,
|
||
.iwb-editor-header > .iwb-editor-session .iwb-editor-btn-cancel { background: #45475a; color: #cdd6f4; }
|
||
.iwb-editor-header > .iwb-editor-session .iwb-editor-btn-new:hover,
|
||
.iwb-editor-header > .iwb-editor-session .iwb-editor-btn-replace:hover,
|
||
.iwb-editor-header > .iwb-editor-session .iwb-editor-btn-cancel:hover { background: #585b70; }
|
||
/* 标题与会话组之间、撤销组与命令带之间的竖分隔 */
|
||
.iwb-editor-header > .iwb-editor-session { margin-right: 4px; }
|
||
.iwb-editor-header > .iwb-editor-divider { width: 1px; height: 20px; background: #313244; flex: 0 0 auto; margin: 0 4px; }
|
||
|
||
/* ================================================================
|
||
v1.3:色板搬进工具栏(用户裁定 2026-11-05)
|
||
工具栏最左一个「当前色圆点」,点开在工具栏上方弹出色板:
|
||
[SV + 色相] | [吸管 + hex] | [6×2 推荐色]
|
||
弹层挂在 modal 下(不是工具栏里):工具栏 overflow-x:auto、
|
||
canvas-wrap overflow:clip,放里面必被裁;位置由 events.js 按按钮矩形算。
|
||
================================================================ */
|
||
.iwb-editor-modal { position: relative; }
|
||
|
||
/* ---- v1.11:工具栏颜色双槽(描边 + 填充) ----
|
||
一个 30px 的按钮位上叠两颗:左上 19px 是描边,右下 19px 是填充。
|
||
描边压在上面(最常用),填充露出右下角,一眼能看出是两格、谁是上级。
|
||
只有「描边」概念的工具(画笔/文字/箭头)把填充槽藏起来,描边槽放大占满,
|
||
不留一个空位让人猜。 */
|
||
.iwb-editor-canvas-wrap > .iwb-editor-tools .iwb-editor-color-pair {
|
||
position: relative; width: 30px; height: 30px; flex: 0 0 auto;
|
||
}
|
||
.iwb-editor-color-pair .iwb-editor-color-btn {
|
||
position: absolute; width: 19px; height: 19px; min-width: 0; padding: 0;
|
||
border: 0; border-radius: 6px; background: #181825; cursor: pointer;
|
||
display: inline-flex; align-items: center; justify-content: center;
|
||
box-shadow: 0 0 0 1.5px #585b70;
|
||
}
|
||
.iwb-editor-color-pair [data-color-slot="stroke"] { left: 0; top: 0; z-index: 2; }
|
||
.iwb-editor-color-pair [data-color-slot="fill"] { right: 0; bottom: 0; z-index: 1; }
|
||
.iwb-editor-color-pair .iwb-editor-color-btn:hover { box-shadow: 0 0 0 2px #89b4fa; }
|
||
.iwb-editor-color-pair .iwb-editor-color-btn.active { box-shadow: 0 0 0 2px #e8a735; }
|
||
.iwb-editor-color-pair .iwb-editor-color-btn i {
|
||
width: 12px; height: 12px; border-radius: 3px; display: block;
|
||
background-color: #ff4444; background-size: 100% 100%;
|
||
}
|
||
/* 无填充:不露颜色本身,画一道红斜杠 —— 留着上次的颜色会被当成「现在填的就是它」 */
|
||
.iwb-editor-color-pair .iwb-editor-color-btn.is-none i {
|
||
background-color: #45475a !important;
|
||
background-image: linear-gradient(135deg, transparent calc(50% - 1px), #f38ba8 calc(50% - 1px), #f38ba8 calc(50% + 1px), transparent calc(50% + 1px));
|
||
}
|
||
/* 填充色还在「跟随描边色」:右下角一个小三角,表示它不是自己指定的 */
|
||
.iwb-editor-color-pair .iwb-editor-color-btn.is-follow::after {
|
||
content: ''; position: absolute; right: 0; bottom: 0;
|
||
border-left: 4px solid transparent; border-bottom: 4px solid #89b4fa;
|
||
}
|
||
.iwb-editor-color-pair[data-color-mode="single"] [data-color-slot="fill"] { display: none; }
|
||
.iwb-editor-color-pair[data-color-mode="single"] [data-color-slot="stroke"] {
|
||
left: 1px; top: 1px; width: 28px; height: 28px; border-radius: 8px;
|
||
}
|
||
.iwb-editor-color-pair[data-color-mode="single"] [data-color-slot="stroke"] i { width: 20px; height: 20px; border-radius: 6px; }
|
||
|
||
/* ---- v1.12:文字上下文的第三格「文本框底色」 ----
|
||
文字对象天生三个颜色(文字 / 描边 / 底色),两格叠放塞不下第三个。
|
||
文字上下文三格横排,各 18px,谁在调谁戴橙圈。
|
||
选择器必须带上 .iwb-editor-canvas-wrap > .iwb-editor-tools 前缀:上面那条
|
||
30px 宽的定位规则是三段选择器,少了前缀优先级压不过它,格子会被挤成 10px。 */
|
||
.iwb-editor-color-pair [data-color-slot="bg"] { display: none; }
|
||
.iwb-editor-canvas-wrap > .iwb-editor-tools .iwb-editor-color-pair[data-color-mode="triple"] {
|
||
width: 62px; display: flex; align-items: center; justify-content: space-between;
|
||
}
|
||
.iwb-editor-canvas-wrap > .iwb-editor-tools .iwb-editor-color-pair[data-color-mode="triple"] [data-color-slot] {
|
||
position: relative; left: auto; top: auto; right: auto; bottom: auto; z-index: 1;
|
||
display: inline-flex; flex: 0 0 auto; width: 18px; height: 18px; border-radius: 5px;
|
||
}
|
||
.iwb-editor-canvas-wrap > .iwb-editor-tools .iwb-editor-color-pair[data-color-mode="triple"] [data-color-slot="bg"] {
|
||
display: inline-flex;
|
||
}
|
||
.iwb-editor-canvas-wrap > .iwb-editor-tools .iwb-editor-color-pair[data-color-mode="triple"] .iwb-editor-color-btn i {
|
||
width: 11px; height: 11px; border-radius: 3px;
|
||
}
|
||
|
||
|
||
.iwb-editor-color-pop {
|
||
position: absolute; z-index: 60; display: flex; flex-direction: column; align-items: stretch; gap: 9px;
|
||
padding: 10px 12px; border-radius: 12px;
|
||
background: rgba(24, 24, 37, 0.97); border: 1px solid #313244;
|
||
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
|
||
-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
|
||
}
|
||
.iwb-editor-color-pop[hidden] { display: none; }
|
||
/* 弹层头部:说明现在调的是描边还是填充,并可直接换;右侧是「无」(仅填充) */
|
||
.iwb-color-pop-head { display: flex; align-items: center; gap: 6px; }
|
||
.iwb-color-pop-tab {
|
||
display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
|
||
border: 1px solid transparent; border-radius: 7px; background: #232334;
|
||
color: #a6adc8; font: 500 11.5px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
|
||
cursor: pointer;
|
||
}
|
||
.iwb-color-pop-tab i {
|
||
width: 11px; height: 11px; border-radius: 3px; display: block;
|
||
background-color: #ff4444; background-size: 100% 100%;
|
||
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
|
||
}
|
||
.iwb-color-pop-tab:hover { background: #313244; color: #cdd6f4; }
|
||
.iwb-color-pop-tab.active { background: #313244; color: #fff; border-color: #e8a735; }
|
||
.iwb-color-pop-tab.is-none i {
|
||
background-color: #45475a !important;
|
||
background-image: linear-gradient(135deg, transparent calc(50% - 1px), #f38ba8 calc(50% - 1px), #f38ba8 calc(50% + 1px), transparent calc(50% + 1px));
|
||
}
|
||
.iwb-color-pop-tab[hidden] { display: none; }
|
||
.iwb-color-pop-none {
|
||
margin-left: auto; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
|
||
border: 1px dashed #585b70; border-radius: 7px; background: transparent; color: #a6adc8;
|
||
font: 500 11.5px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; cursor: pointer;
|
||
}
|
||
.iwb-color-pop-none span {
|
||
width: 11px; height: 11px; border-radius: 3px; display: block; background-color: #45475a;
|
||
background-image: linear-gradient(135deg, transparent calc(50% - 1px), #f38ba8 calc(50% - 1px), #f38ba8 calc(50% + 1px), transparent calc(50% + 1px));
|
||
}
|
||
.iwb-color-pop-none:hover { border-color: #f38ba8; color: #f38ba8; }
|
||
.iwb-color-pop-none.active { border-style: solid; border-color: #f38ba8; color: #f38ba8; background: rgba(243, 139, 168, 0.12); }
|
||
.iwb-color-pop-none[hidden] { display: none; }
|
||
.iwb-color-pop-body { display: flex; align-items: center; gap: 10px; }
|
||
.iwb-color-pop-picker { display: flex; gap: 8px; flex: 0 0 auto; }
|
||
.iwb-editor-color-pop .iwb-color-sv { width: 180px; height: 104px; flex: 0 0 180px; }
|
||
.iwb-editor-color-pop .iwb-color-hue { width: 16px; height: 104px; flex: 0 0 16px; }
|
||
.iwb-color-pop-sep { width: 1px; align-self: stretch; background: #313244; flex: 0 0 auto; }
|
||
.iwb-color-pop-fields { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
|
||
.iwb-editor-color-pop .iwb-editor-color-hex-input {
|
||
width: 86px; height: 28px; padding: 0 6px; text-align: center;
|
||
font: 600 12px monospace; border-radius: 6px; box-sizing: border-box;
|
||
}
|
||
.iwb-editor-color-pop .iwb-editor-color-swatches {
|
||
display: grid; grid-template-columns: repeat(6, 22px); grid-auto-rows: 22px;
|
||
gap: 7px; flex: 0 0 auto; align-content: center;
|
||
}
|
||
.iwb-editor-color-pop .iwb-editor-color-panel-swatch {
|
||
width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
|
||
transition: transform 0.08s ease;
|
||
}
|
||
.iwb-editor-color-pop .iwb-editor-color-panel-swatch:hover { transform: scale(1.12); }
|
||
.iwb-editor-color-pop .iwb-editor-color-panel-swatch.active {
|
||
outline: 2px solid #fff; outline-offset: 2px;
|
||
}
|
||
.iwb-editor-color-pop .iwb-editor-color-eye { width: 28px; height: 28px; border-radius: 6px; }
|
||
|
||
/* ================================================================
|
||
v1.4:侧栏「快速效果」
|
||
3×2 网格,作用于当前位图图层。只做颜色/采样变换,不改几何。
|
||
图标全部用 CSS 渐变画(不引第三方库,也不加 SVG 体积)。
|
||
================================================================ */
|
||
.iwb-editor-fx {
|
||
display: flex; flex-direction: column; gap: 8px;
|
||
flex: 0 0 auto;
|
||
}
|
||
.iwb-editor-fx-head {
|
||
display: flex; align-items: center; justify-content: space-between; gap: 6px;
|
||
}
|
||
.iwb-editor-fx-title {
|
||
font-size: 11px; font-weight: 600; letter-spacing: 0.4px; color: #a6adc8;
|
||
}
|
||
.iwb-editor-fx-target {
|
||
max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||
padding: 2px 6px; border-radius: 5px; background: #313244; color: #cdd6f4;
|
||
font-size: 10px; line-height: 1.4;
|
||
}
|
||
.iwb-editor-fx-grid {
|
||
display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
|
||
}
|
||
.iwb-editor-fx-btn {
|
||
display: flex; flex-direction: column; align-items: center; gap: 5px;
|
||
padding: 7px 2px 6px; border: 1px solid transparent; border-radius: 9px;
|
||
background: #232334; color: #cdd6f4;
|
||
font: 500 10.5px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
|
||
cursor: pointer; transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
|
||
}
|
||
.iwb-editor-fx-btn:hover { background: #313244; border-color: #45475a; }
|
||
.iwb-editor-fx-btn:active { transform: scale(0.96); }
|
||
.iwb-editor-fx-btn:focus-visible { outline: 2px solid #89b4fa; outline-offset: 1px; }
|
||
/* v1.8:当前生效的效果。必须与 hover 一眼区分 —— 拖动强度滑杆时要能看出在调哪个效果 */
|
||
.iwb-editor-fx-btn.is-active {
|
||
background: #2c2735; border-color: #e8a735; color: #f3dcb0;
|
||
}
|
||
.iwb-editor-fx-btn.is-active .iwb-editor-fx-ico {
|
||
box-shadow: inset 0 0 0 1px rgba(232, 167, 53, 0.75);
|
||
}
|
||
.iwb-editor-fx-ico {
|
||
width: 22px; height: 22px; border-radius: 5px; display: block;
|
||
background-color: #d9d9e3;
|
||
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
|
||
}
|
||
/* 图标统一垫浅色底:纯黑部分若直接压在深色按钮上会「消失」,看着像缺了个角 */
|
||
.ico-invert { background-image: linear-gradient(135deg, transparent 0 50%, #14141f 50% 100%); }
|
||
.ico-gray { background-image: linear-gradient(90deg, #12121c 0, #8a8a99 50%, #f4f4f8 100%); }
|
||
.ico-boost {
|
||
background-image: radial-gradient(circle at 50% 52%, #ffffff 0 24%, #cfcfdd 42%, #6e6e85 100%);
|
||
}
|
||
.ico-contrast { background-image: linear-gradient(90deg, #000000 0 46%, #ffffff 54% 100%); }
|
||
.ico-soft {
|
||
background-image: radial-gradient(circle at 50% 50%, #23233a 0 16%, rgba(35, 35, 58, 0.5) 34%, rgba(35, 35, 58, 0.16) 50%, rgba(35, 35, 58, 0) 68%);
|
||
}
|
||
.ico-mosaic {
|
||
background-image: repeating-conic-gradient(#6b6b80 0% 25%, #d9d9e3 0% 50%);
|
||
background-size: 10px 10px;
|
||
}
|
||
.iwb-editor-fx-tip {
|
||
margin: 0; font-size: 10px; line-height: 1.55; color: #6c7086;
|
||
}
|
||
|
||
/* v1.8:效果参数滑杆。范围与单位随效果切换(马赛克=块大小 px、柔化=半径 px、其余=强度 %)。
|
||
未点效果 / 目标层被切走时加 .iwb-editor-fx-adj-off 整条置灰。 */
|
||
.iwb-editor-fx-adj {
|
||
display: flex; flex-direction: column; gap: 4px;
|
||
padding: 6px 8px 5px; border-radius: 7px;
|
||
background: #1e1e2c; border: 1px solid #2f2f42;
|
||
transition: opacity 0.12s ease;
|
||
}
|
||
.iwb-editor-fx-adj-head {
|
||
display: flex; align-items: center; justify-content: space-between; gap: 6px;
|
||
}
|
||
.iwb-editor-fx-adj-name {
|
||
font-size: 10.5px; font-weight: 500; color: #b9c0d8;
|
||
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
||
}
|
||
.iwb-editor-fx-adj-val {
|
||
font-size: 10.5px; color: #e8a735; font-variant-numeric: tabular-nums; flex: 0 0 auto;
|
||
}
|
||
.iwb-editor-fx-adj-off { opacity: 0.5; }
|
||
.iwb-editor-fx-range {
|
||
-webkit-appearance: none; appearance: none;
|
||
width: 100%; height: 14px; margin: 0; background: transparent; cursor: pointer;
|
||
}
|
||
.iwb-editor-fx-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: #313244; }
|
||
.iwb-editor-fx-range::-webkit-slider-thumb {
|
||
-webkit-appearance: none; appearance: none;
|
||
width: 12px; height: 12px; margin-top: -4px; border-radius: 50%;
|
||
background: #e8a735; border: 1px solid #1e1e2c;
|
||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
|
||
}
|
||
.iwb-editor-fx-range::-moz-range-track { height: 4px; border-radius: 2px; background: #313244; }
|
||
.iwb-editor-fx-range::-moz-range-thumb {
|
||
width: 12px; height: 12px; border-radius: 50%; background: #e8a735; border: 1px solid #1e1e2c;
|
||
}
|
||
.iwb-editor-fx-range:disabled { cursor: default; }
|
||
.iwb-editor-fx-range:disabled::-webkit-slider-thumb { background: #585b70; }
|
||
.iwb-editor-fx-range:disabled::-moz-range-thumb { background: #585b70; }
|
||
.iwb-editor-fx-range:focus-visible { outline: 2px solid #89b4fa; outline-offset: 2px; }
|
||
|
||
/* ================================================================
|
||
v1.6:图层面板多选(⌘/Ctrl 点击)+ 合并按钮
|
||
多选用青色侧条与单选(橙色 #e8a735)区分:一个图层可以「被选中但不在合并集合里」,
|
||
两套状态不能长得一样。
|
||
================================================================ */
|
||
.iwb-layer-item.multi {
|
||
background: rgba(137, 180, 250, 0.14);
|
||
box-shadow: inset 2px 0 0 #89b4fa;
|
||
}
|
||
.iwb-layer-item.multi.active {
|
||
background: rgba(137, 180, 250, 0.2);
|
||
box-shadow: inset 2px 0 0 #89b4fa, inset 0 0 0 1px rgba(137, 180, 250, 0.45);
|
||
}
|
||
.iwb-editor-layer-add-group { flex: 0 0 auto; flex-wrap: nowrap; }
|
||
.iwb-editor-layer-add-btn[data-action="mergeLayers"]:hover,
|
||
.iwb-editor-layer-add-btn[data-action="mergeVisible"]:hover {
|
||
background: #45475a;
|
||
border-color: #89b4fa;
|
||
color: #cdd6f4;
|
||
}
|
||
|
||
/* ================================================================
|
||
v1.9:文字样式控件 / 圆角 / 最近使用颜色 / 复制按钮
|
||
================================================================ */
|
||
|
||
/* 选项栏里的原生颜色框(描边色 / 底色):压成和数字框同高的小方块 */
|
||
.iwb-opt-color {
|
||
width: 22px;
|
||
height: 20px;
|
||
padding: 0;
|
||
flex: 0 0 auto;
|
||
border: 1px solid #45475a;
|
||
border-radius: 4px;
|
||
background: transparent;
|
||
cursor: pointer;
|
||
}
|
||
.iwb-opt-color::-webkit-color-swatch-wrapper { padding: 2px; }
|
||
.iwb-opt-color::-webkit-color-swatch { border: 0; border-radius: 3px; }
|
||
/* 底色是半透明的:色块按真实不透明度显示(--sw-a),看起来和画布上的效果一致,
|
||
不再是一块实心纯黑让人以为「又多了一个字体颜色」 */
|
||
.iwb-opt-color { opacity: var(--sw-a, 1); }
|
||
/* 该颜色当前没生效(描边宽度 0 / 底色未开 / 图形是描边模式):
|
||
不再显示那块颜色本身,而是显示为一块灰色斜纹 —— 语义是「这里还没有颜色」。
|
||
只做半透明灰化的话,纯黑/深色照样是一块黑方块,用户仍会以为「设了个黑色没生效」。 */
|
||
.iwb-opt-color.is-off {
|
||
opacity: 1;
|
||
border-style: dashed;
|
||
border-color: #4b4f66;
|
||
background: repeating-linear-gradient(45deg, #353849 0 3px, #262939 3px 6px);
|
||
}
|
||
.iwb-opt-color.is-off::-webkit-color-swatch { opacity: 0; }
|
||
/* 选项栏里色块旁边的分组标签,和「描边 / 底色」这类双字按钮区分开 */
|
||
.iwb-opt-swatch-label { color: #7f849c; font-size: 11px; flex: 0 0 auto; }
|
||
|
||
/* 「最近使用」:色板弹层里 4 列 × 2 行,空的时候整块隐藏(不占位) */
|
||
.iwb-editor-color-pop .iwb-editor-recent-colors {
|
||
display: grid;
|
||
grid-template-columns: repeat(4, 18px);
|
||
grid-auto-rows: 18px;
|
||
gap: 5px;
|
||
flex: 0 0 auto;
|
||
align-content: center;
|
||
}
|
||
.iwb-editor-recent-colors[hidden] { display: none; }
|
||
.iwb-editor-color-pop .iwb-editor-recent-colors .iwb-editor-color-panel-swatch {
|
||
width: 18px;
|
||
height: 18px;
|
||
padding: 0;
|
||
border: 0;
|
||
border-radius: 50%;
|
||
cursor: pointer;
|
||
}
|
||
.iwb-editor-color-pop .iwb-editor-recent-colors .iwb-editor-color-panel-swatch:hover { transform: scale(1.12); }
|
||
|
||
/* 复制到剪贴板:与「导出」同尺寸但用低饱和色,避免两个绿色按钮抢眼 */
|
||
.iwb-editor-btn-copy { background: #313244 !important; color: #cdd6f4 !important; }
|
||
.iwb-editor-btn-copy:hover { background: #3b3d52 !important; }
|
||
|
||
/* 选项栏按钮里是中文双字标签(常规/特粗/底色),不给 nowrap 会被挤成竖排 */
|
||
.iwb-editor-optionbar-body .iwb-opt-btn { white-space: nowrap; }
|