242 lines
9.1 KiB
CSS
242 lines
9.1 KiB
CSS
|
|
/* === MASK CANVAS === */
|
|||
|
|
.mask-wrap {
|
|||
|
|
position: relative;
|
|||
|
|
aspect-ratio: 390 / 232;
|
|||
|
|
border-radius: var(--radius-sm);
|
|||
|
|
overflow: hidden;
|
|||
|
|
border: 1px solid var(--border);
|
|||
|
|
background: #f9fafb;
|
|||
|
|
cursor: grab;
|
|||
|
|
touch-action: none;
|
|||
|
|
margin-top: 6px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.mask-backdrop {
|
|||
|
|
position: fixed;
|
|||
|
|
inset: 0;
|
|||
|
|
z-index: 40;
|
|||
|
|
background: rgba(0, 0, 0, 0.3);
|
|||
|
|
backdrop-filter: blur(8px);
|
|||
|
|
}
|
|||
|
|
.mask-backdrop[hidden] { display: none; }
|
|||
|
|
|
|||
|
|
.mask-wrap.is-expanded {
|
|||
|
|
position: fixed;
|
|||
|
|
top: 50%;
|
|||
|
|
left: 50%;
|
|||
|
|
z-index: 41;
|
|||
|
|
width: min(1000px, calc(100vw - 36px));
|
|||
|
|
transform: translate(-50%, -50%);
|
|||
|
|
border-radius: var(--radius);
|
|||
|
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.mask-wrap.is-adjusting { cursor: grabbing; }
|
|||
|
|
.mask-wrap.is-editing { cursor: crosshair; }
|
|||
|
|
.mask-wrap.has-brush-cursor #maskCanvas, .mask-wrap.has-text-preview #maskCanvas { cursor: none; }
|
|||
|
|
|
|||
|
|
#maskCanvas { width: 100%; height: 100%; display: block; touch-action: none; }
|
|||
|
|
|
|||
|
|
.brush-cursor {
|
|||
|
|
position: absolute;
|
|||
|
|
width: 16px;
|
|||
|
|
height: 16px;
|
|||
|
|
border: 2px solid var(--cursor-color, #c8ccd4);
|
|||
|
|
border-radius: 50%;
|
|||
|
|
pointer-events: none;
|
|||
|
|
transform: translate(-50%, -50%);
|
|||
|
|
z-index: 5;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.brush-cursor::before {
|
|||
|
|
content: '';
|
|||
|
|
position: absolute;
|
|||
|
|
top: 50%; left: 50%;
|
|||
|
|
width: 3px; height: 3px;
|
|||
|
|
border-radius: 50%;
|
|||
|
|
background: var(--cursor-color, #c8ccd4);
|
|||
|
|
transform: translate(-50%, -50%);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.brush-cursor::after {
|
|||
|
|
content: attr(data-label);
|
|||
|
|
position: absolute;
|
|||
|
|
top: 100%; left: 50%;
|
|||
|
|
transform: translate(-50%, 4px);
|
|||
|
|
padding: 1px 5px;
|
|||
|
|
border-radius: 3px;
|
|||
|
|
background: var(--bg-elevated);
|
|||
|
|
color: var(--text);
|
|||
|
|
font-size: 12px;
|
|||
|
|
white-space: nowrap;
|
|||
|
|
border: 1px solid var(--border);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.brush-cursor.is-eraser { border-style: dashed; border-color: var(--warn); }
|
|||
|
|
.brush-cursor.is-eraser::before { background: var(--warn); }
|
|||
|
|
.brush-cursor.is-eraser::after { border-color: var(--warn); color: var(--warn); }
|
|||
|
|
.brush-cursor[hidden] { display: none; }
|
|||
|
|
|
|||
|
|
.text-placement-preview {
|
|||
|
|
position: absolute;
|
|||
|
|
z-index: 5;
|
|||
|
|
pointer-events: none;
|
|||
|
|
transform: rotate(var(--text-preview-angle, 0deg));
|
|||
|
|
opacity: 0.7;
|
|||
|
|
}
|
|||
|
|
.text-placement-preview[hidden] { display: none; }
|
|||
|
|
|
|||
|
|
.text-preview-glyph { color: var(--text-preview-color, #c8ccd4); line-height: 1; }
|
|||
|
|
.text-placement-preview.is-outline .text-preview-glyph {
|
|||
|
|
color: transparent;
|
|||
|
|
-webkit-text-stroke: 1.5px var(--text-preview-color, #c8ccd4);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.text-preview-anchor {
|
|||
|
|
position: absolute;
|
|||
|
|
top: 100%; left: 50%;
|
|||
|
|
width: 10px; height: 10px;
|
|||
|
|
border: 1.5px solid var(--warn);
|
|||
|
|
border-radius: 50%;
|
|||
|
|
background: var(--bg-base);
|
|||
|
|
transform: translate(-50%, 5px);
|
|||
|
|
}
|
|||
|
|
.text-preview-anchor::before { content: ''; position: absolute; top: 50%; left: -9px; width: 15px; height: 1px; background: var(--warn); transform: translateY(-50%); }
|
|||
|
|
.text-preview-anchor::after { content: ''; position: absolute; top: -9px; left: 50%; width: 1px; height: 15px; background: var(--warn); transform: translateX(-50%); }
|
|||
|
|
|
|||
|
|
.mask-expand {
|
|||
|
|
position: absolute;
|
|||
|
|
top: 6px; right: 6px;
|
|||
|
|
z-index: 3;
|
|||
|
|
padding: 4px 8px;
|
|||
|
|
border: 1px solid var(--border);
|
|||
|
|
border-radius: 4px;
|
|||
|
|
background: rgba(255, 255, 255, 0.85);
|
|||
|
|
color: var(--text-2);
|
|||
|
|
font-size: 13px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: background 0.15s, color 0.15s;
|
|||
|
|
}
|
|||
|
|
.mask-expand:hover { background: var(--bg-hover); color: var(--accent); }
|
|||
|
|
.mask-wrap.is-expanded .mask-expand { padding: 6px 10px; font-size: 14px; }
|
|||
|
|
.mask-wrap.is-expanded .adjust-hint { left: 12px; bottom: 12px; }
|
|||
|
|
|
|||
|
|
.adjust-hint {
|
|||
|
|
position: absolute;
|
|||
|
|
bottom: 6px; left: 6px;
|
|||
|
|
z-index: 2;
|
|||
|
|
padding: 3px 6px;
|
|||
|
|
border-radius: 3px;
|
|||
|
|
background: rgba(255, 255, 255, 0.85);
|
|||
|
|
color: var(--text-3);
|
|||
|
|
font-size: 12px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.demo-label {
|
|||
|
|
position: absolute;
|
|||
|
|
bottom: 6px; right: 6px;
|
|||
|
|
z-index: 2;
|
|||
|
|
padding: 2px 8px;
|
|||
|
|
border-radius: 999px;
|
|||
|
|
background: rgba(0, 180, 216, 0.15);
|
|||
|
|
color: var(--accent);
|
|||
|
|
font-size: 12px;
|
|||
|
|
border: 1px solid rgba(0, 180, 216, 0.3);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* === FLOATING TOOLBAR === */
|
|||
|
|
.mask-floating-toolbar {
|
|||
|
|
position: fixed;
|
|||
|
|
bottom: 12px;
|
|||
|
|
left: 50%;
|
|||
|
|
z-index: 42;
|
|||
|
|
display: flex;
|
|||
|
|
flex-wrap: wrap;
|
|||
|
|
gap: 4px;
|
|||
|
|
padding: 5px;
|
|||
|
|
border: 1px solid var(--border);
|
|||
|
|
border-radius: var(--radius);
|
|||
|
|
background: rgba(255, 255, 255, 0.9);
|
|||
|
|
backdrop-filter: blur(16px);
|
|||
|
|
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
|
|||
|
|
transform: translateX(-50%);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.mask-floating-toolbar[hidden], .float-tool-context[hidden], .float-control[hidden] { display: none !important; }
|
|||
|
|
|
|||
|
|
.float-tool-group, .float-tool-context, .float-control { display: flex; align-items: center; gap: 4px; }
|
|||
|
|
|
|||
|
|
.float-tool-button {
|
|||
|
|
display: inline-flex;
|
|||
|
|
align-items: center;
|
|||
|
|
justify-content: center;
|
|||
|
|
gap: 3px;
|
|||
|
|
min-width: 32px;
|
|||
|
|
min-height: 30px;
|
|||
|
|
padding: 4px 7px;
|
|||
|
|
border: 1px solid transparent;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
background: transparent;
|
|||
|
|
color: var(--text-2);
|
|||
|
|
font-size: 13px;
|
|||
|
|
cursor: pointer;
|
|||
|
|
transition: all 0.15s;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.float-tool-button:hover { border-color: var(--border); background: var(--bg-hover); color: var(--text); }
|
|||
|
|
.float-tool-button.active { border-color: var(--accent); background: rgba(0, 180, 216, 0.12); color: var(--accent); }
|
|||
|
|
|
|||
|
|
.float-tool-icon { font-family: "Cascadia Code", monospace; font-size: 15px; }
|
|||
|
|
.float-tool-divider { width: 1px; height: 22px; background: var(--border); }
|
|||
|
|
|
|||
|
|
.float-transform-readout {
|
|||
|
|
min-width: 64px;
|
|||
|
|
color: var(--text-3);
|
|||
|
|
font-family: "Cascadia Code", monospace;
|
|||
|
|
font-size: 12px;
|
|||
|
|
text-align: center;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.float-tool-context {
|
|||
|
|
min-height: 30px;
|
|||
|
|
padding: 2px 4px;
|
|||
|
|
border-radius: 4px;
|
|||
|
|
background: var(--bg-input);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.float-control > span { color: var(--text-3); font-size: 12px; white-space: nowrap; }
|
|||
|
|
.float-control input[type="range"] { width: 72px; accent-color: var(--accent); }
|
|||
|
|
.float-control output { min-width: 22px; color: var(--accent); font-family: "Cascadia Code", monospace; font-size: 12px; text-align: center; }
|
|||
|
|
|
|||
|
|
.float-text-input {
|
|||
|
|
width: 100px;
|
|||
|
|
height: 26px;
|
|||
|
|
padding: 0 6px;
|
|||
|
|
border: 1px solid var(--border);
|
|||
|
|
border-radius: 4px;
|
|||
|
|
background: var(--bg-input);
|
|||
|
|
color: var(--text);
|
|||
|
|
font-size: 13px;
|
|||
|
|
}
|
|||
|
|
.float-text-input:focus { border-color: var(--accent); outline: none; }
|
|||
|
|
|
|||
|
|
.float-select {
|
|||
|
|
max-width: 84px;
|
|||
|
|
height: 26px;
|
|||
|
|
padding: 0 4px;
|
|||
|
|
border: 1px solid var(--border);
|
|||
|
|
border-radius: 4px;
|
|||
|
|
background: var(--bg-input);
|
|||
|
|
color: var(--text);
|
|||
|
|
font-size: 12px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.float-color-input {
|
|||
|
|
width: 26px;
|
|||
|
|
height: 26px;
|
|||
|
|
border: 1px solid var(--border);
|
|||
|
|
border-radius: 4px;
|
|||
|
|
background: transparent;
|
|||
|
|
cursor: pointer;
|
|||
|
|
}
|