feat(image-annotate): v1.18.0 色板可钉住 + 右列竖向收窄 + 撤销组搬进工具条最右

This commit is contained in:
qiqi committed 2026-11-10 06:59:04 +08:00
1 parent b6d10339f6
commit a94e5be954
10 files changed
+408 -86

No files matched your search

+55 -15
View File
@@ -232,6 +232,10 @@
gap: 4px;
}
/* 撤销 / 重做 / 还原(v1.18):搬进工具条末端后需要一个 flex 容器,
否则三个 button 之间是 inline-block 的空隙,和左边 4px gap 的工具按钮对不齐。 */
.iwb-editor-history { display: flex; align-items: center; gap: 4px; }
.iwb-editor-tool, .iwb-editor-action {
background: #313244;
border: none;
@@ -1783,8 +1787,8 @@
.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;
position: absolute; z-index: 60; display: flex; flex-direction: column; align-items: stretch; gap: 7px;
padding: 9px 11px; 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);
@@ -1822,29 +1826,60 @@
.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-body { display: flex; align-items: stretch; 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-editor-color-pop .iwb-color-sv { width: 176px; height: 102px; flex: 0 0 176px; }
.iwb-editor-color-pop .iwb-color-hue { width: 16px; height: 102px; 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; }
/* ==== 右列(v1.18,用户 2026-11-10)====
设置 / 常用色 / 最近 三块竖着叠,块之间 1px 细线,不写小标题:
原来「常用色」「最近」各占一行标题 + 横向铺开,整块面板又宽又高。
现宽 133px(6 列 × 18px),三块高度加起来刚好填满左侧取色器的高度。 */
.iwb-color-pop-side {
display: flex; flex-direction: column; justify-content: space-between;
width: 133px; flex: 0 0 133px; gap: 0;
}
/* 细线分隔:只加在「块与块之间」,第一块前面不加,否则顶部多一条悬空的线 */
.iwb-color-pop-side > * + * {
border-top: 1px solid #313244; margin-top: 5px; padding-top: 5px;
}
.iwb-color-pop-fields { display: flex; align-items: center; gap: 5px; }
.iwb-editor-color-pop .iwb-editor-color-hex-input {
width: 86px; height: 28px; padding: 0 6px; text-align: center;
flex: 1 1 auto; width: 0; height: 26px; padding: 0 5px; 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;
display: grid; grid-template-columns: repeat(6, 18px); grid-auto-rows: 18px;
gap: 5px; 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;
width: 18px; height: 18px; 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:hover { transform: scale(1.14); }
.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; }
.iwb-editor-color-pop .iwb-editor-color-eye { width: 26px; height: 26px; border-radius: 6px; flex: 0 0 auto; }
/* ==== 钉住(v1.18)====
绝对定位到头部右上角:这样「无」按钮显隐都不会把图钉挤来挤去,
头部加 padding-right 让出位置,两者不会叠在一起。 */
.iwb-color-pop-head { position: relative; padding-right: 26px; }
.iwb-color-pop-pin {
position: absolute; right: 0; top: 50%; transform: translateY(-50%);
width: 22px; height: 22px; padding: 0;
display: inline-flex; align-items: center; justify-content: center;
border: 1px solid transparent; border-radius: 6px; background: transparent;
color: #9aa0b4; cursor: pointer;
}
.iwb-color-pop-pin:hover { background: #313244; color: #cdd6f4; }
/* 钉住态:琥珀色描边 + 淡底。用颜色而不是旋转表达「已钉住」,
旋转 45° 的图钉在 13px 下看起来像歪掉的问号。 */
.iwb-color-pop-pin.active {
background: rgba(232, 167, 53, 0.16); border-color: #e8a735; color: #f0b752;
}
/* ================================================================
v1.4:侧栏「快速效果」
@@ -2072,10 +2107,11 @@
/* 选项栏里色块旁边的分组标签,和「描边 / 底色」这类双字按钮区分开 */
.iwb-opt-swatch-label { color: #7f849c; font-size: 11px; flex: 0 0 auto; }
/* 「最近使用」:色板弹层里 4 列 × 2 行,空的时候整块隐藏(不占位) */
/* 「最近使用」:色板弹层里与常用色同一套 6 列 18px 网格(v1.18 起上限 6 个,正好一行),
空的时候整块隐藏(不占位)。 */
.iwb-editor-color-pop .iwb-editor-recent-colors {
display: grid;
grid-template-columns: repeat(4, 18px);
grid-template-columns: repeat(6, 18px);
grid-auto-rows: 18px;
gap: 5px;
flex: 0 0 auto;
@@ -2133,7 +2169,11 @@
/* 弹层是横排一行;右栏窄,改成竖排:调色器全宽 → HEX 一行 → 常用色 → 最近。
结构完全一样(同一份 DOM),差异全在这里用容器选择器覆盖。 */
.iwb-editor-colors .iwb-color-pop-head { flex-wrap: wrap; gap: 5px; }
.iwb-editor-colors .iwb-color-pop-head { flex-wrap: wrap; gap: 5px; padding-right: 0; }
/* 右栏不需要「钉住」(它本来就常驻),也不需要 v1.18 那层 side 容器:
display:contents 把它拆掉,子元素直接参与 body 的竖排 flex,和改版前一样。 */
.iwb-editor-colors .iwb-color-pop-pin { display: none; }
.iwb-editor-colors .iwb-color-pop-side { display: contents; }
.iwb-editor-colors .iwb-color-pop-tab { padding: 0 8px; }
.iwb-editor-colors .iwb-color-pop-body { flex-direction: column; align-items: stretch; gap: 8px; }
.iwb-editor-colors .iwb-color-pop-sep { display: none; }