622 lines
11 KiB
CSS
622 lines
11 KiB
CSS
:root {
|
|
--bg: #0d1117;
|
|
--panel: #161b22;
|
|
--border: #30363d;
|
|
--text: #c9d1d9;
|
|
--heading: #e6edf3;
|
|
--accent: #58a6ff;
|
|
--accent-dim: rgba(88, 166, 255, 0.12);
|
|
--input-bg: #0d1117;
|
|
--btn-bg: #238636;
|
|
--btn-hover: #2ea043;
|
|
--widget-bg: #1a1a3e;
|
|
--widget-grid: rgba(88, 166, 255, 0.15);
|
|
}
|
|
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
min-height: 100vh;
|
|
}
|
|
|
|
header {
|
|
padding: 16px 24px;
|
|
border-bottom: 1px solid var(--border);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 16px;
|
|
}
|
|
header h1 {
|
|
font-size: 18px;
|
|
color: var(--heading);
|
|
font-weight: 600;
|
|
}
|
|
header p {
|
|
font-size: 13px;
|
|
color: #8b949e;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
.header-left {
|
|
min-width: 0;
|
|
}
|
|
|
|
.mode-toggle {
|
|
display: flex;
|
|
gap: 0;
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
overflow: hidden;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.mode-btn {
|
|
padding: 6px 18px;
|
|
border: none;
|
|
background: var(--panel);
|
|
color: #8b949e;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition:
|
|
background 0.15s,
|
|
color 0.15s;
|
|
}
|
|
.mode-btn:hover {
|
|
color: var(--text);
|
|
}
|
|
.mode-btn.active {
|
|
background: var(--accent);
|
|
color: #fff;
|
|
}
|
|
|
|
.mode-hint {
|
|
font-size: 14px;
|
|
color: var(--accent);
|
|
font-weight: 500;
|
|
margin-right: 8px;
|
|
margin-left: auto;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
main {
|
|
display: grid;
|
|
grid-template-columns: 1fr 340px;
|
|
gap: 16px;
|
|
padding: 16px 24px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.panel {
|
|
background: var(--panel);
|
|
border: 1px solid var(--border);
|
|
border-radius: 8px;
|
|
padding: 16px;
|
|
}
|
|
.panel h2 {
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: #8b949e;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.panel-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
margin-bottom: 12px;
|
|
}
|
|
.panel-header h2 {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.left-col {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 16px;
|
|
}
|
|
|
|
.right-col {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 16px;
|
|
}
|
|
|
|
#svg {
|
|
width: 100%;
|
|
display: block;
|
|
border-radius: 4px;
|
|
background: #0a0e14;
|
|
user-select: none;
|
|
-webkit-user-select: none;
|
|
touch-action: none;
|
|
}
|
|
|
|
#svg image {
|
|
transition: opacity 0.15s;
|
|
}
|
|
|
|
.corner-circle {
|
|
cursor: grab;
|
|
filter: drop-shadow(0 0 4px rgba(88, 166, 255, 0.5));
|
|
transition: r 0.1s;
|
|
}
|
|
.corner-circle:hover {
|
|
r: 14;
|
|
}
|
|
.corner-circle.dragging {
|
|
cursor: grabbing;
|
|
r: 14;
|
|
}
|
|
|
|
.corner-label {
|
|
font-size: 22px;
|
|
fill: var(--text);
|
|
font-family: monospace;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.corner-coord {
|
|
font-size: 18px;
|
|
fill: #8b949e;
|
|
font-family: monospace;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.field-row {
|
|
display: flex;
|
|
gap: 12px;
|
|
align-items: center;
|
|
}
|
|
.field-row label {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
font-size: 13px;
|
|
color: #8b949e;
|
|
flex: 1;
|
|
}
|
|
.field-row label span {
|
|
min-width: 14px;
|
|
}
|
|
.field-row input {
|
|
width: 100%;
|
|
padding: 6px 8px;
|
|
background: var(--input-bg);
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
color: var(--heading);
|
|
font-size: 14px;
|
|
font-family: monospace;
|
|
outline: none;
|
|
}
|
|
.field-row input:focus {
|
|
border-color: var(--accent);
|
|
}
|
|
|
|
.corner-inputs {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
}
|
|
.corner-input-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
.corner-input-row .label {
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
color: var(--accent);
|
|
min-width: 28px;
|
|
font-family: monospace;
|
|
}
|
|
.corner-input-row label {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
font-size: 13px;
|
|
color: #8b949e;
|
|
flex: 1;
|
|
}
|
|
.corner-input-row label span {
|
|
min-width: 12px;
|
|
}
|
|
.corner-input-row input {
|
|
width: 100%;
|
|
padding: 5px 6px;
|
|
background: var(--input-bg);
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
color: var(--heading);
|
|
font-size: 13px;
|
|
font-family: monospace;
|
|
outline: none;
|
|
}
|
|
.corner-input-row input:focus {
|
|
border-color: var(--accent);
|
|
}
|
|
|
|
#cssOutput {
|
|
width: 100%;
|
|
min-height: 80px;
|
|
padding: 10px;
|
|
background: var(--input-bg);
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
color: var(--accent);
|
|
font-size: 12px;
|
|
font-family: "Cascadia Code", "Fira Code", monospace;
|
|
line-height: 1.6;
|
|
resize: vertical;
|
|
outline: none;
|
|
}
|
|
|
|
.btn-row {
|
|
display: flex;
|
|
gap: 8px;
|
|
margin-top: 8px;
|
|
}
|
|
|
|
.btn {
|
|
padding: 6px 14px;
|
|
border: none;
|
|
border-radius: 4px;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: background 0.15s;
|
|
}
|
|
.btn-copy {
|
|
background: var(--btn-bg);
|
|
color: white;
|
|
}
|
|
.btn-copy:hover {
|
|
background: var(--btn-hover);
|
|
}
|
|
.btn-reset {
|
|
background: var(--border);
|
|
color: var(--text);
|
|
}
|
|
.btn-reset:hover {
|
|
background: #484f58;
|
|
}
|
|
|
|
.btn-edit-field {
|
|
padding: 4px 12px;
|
|
border: 1px solid var(--accent);
|
|
border-radius: 4px;
|
|
background: transparent;
|
|
color: var(--accent);
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition:
|
|
background 0.15s,
|
|
color 0.15s;
|
|
}
|
|
.btn-edit-field:hover {
|
|
background: rgba(88, 166, 255, 0.1);
|
|
}
|
|
|
|
.btn-save-field {
|
|
padding: 4px 12px;
|
|
border: none;
|
|
border-radius: 4px;
|
|
background: var(--btn-bg);
|
|
color: white;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: background 0.15s;
|
|
}
|
|
.btn-save-field:hover {
|
|
background: var(--btn-hover);
|
|
}
|
|
|
|
.btn-cancel-field {
|
|
padding: 4px 12px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
background: transparent;
|
|
color: var(--text);
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: background 0.15s;
|
|
}
|
|
.btn-cancel-field:hover {
|
|
background: var(--border);
|
|
}
|
|
|
|
.field-size-stack {
|
|
display: flex;
|
|
align-items: stretch;
|
|
gap: 8px;
|
|
}
|
|
|
|
.chain-link {
|
|
display: none;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 32px;
|
|
min-height: 56px;
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
background: var(--input-bg);
|
|
color: var(--accent);
|
|
cursor: pointer;
|
|
flex-shrink: 0;
|
|
transition:
|
|
background 0.15s,
|
|
color 0.15s;
|
|
}
|
|
.chain-link:hover {
|
|
background: rgba(88, 166, 255, 0.1);
|
|
}
|
|
.chain-link.unlocked {
|
|
color: #8b949e;
|
|
}
|
|
.chain-link.visible {
|
|
display: flex;
|
|
}
|
|
|
|
.field-stack-inputs {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
flex: 1;
|
|
}
|
|
.field-stack-inputs label {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
font-size: 13px;
|
|
color: #8b949e;
|
|
}
|
|
.field-stack-inputs label span {
|
|
min-width: 14px;
|
|
}
|
|
.field-stack-inputs input {
|
|
width: 100%;
|
|
padding: 6px 8px;
|
|
background: var(--input-bg);
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
color: var(--heading);
|
|
font-size: 14px;
|
|
font-family: monospace;
|
|
outline: none;
|
|
}
|
|
.field-stack-inputs input:focus {
|
|
border-color: var(--accent);
|
|
}
|
|
.field-stack-inputs input:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.field-row input:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.field-edit-options {
|
|
display: none;
|
|
margin-top: 10px;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
}
|
|
.field-edit-options.visible {
|
|
display: flex;
|
|
}
|
|
|
|
.field-save-row {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
gap: 8px;
|
|
}
|
|
|
|
.checkbox-label {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
font-size: 12px;
|
|
color: #8b949e;
|
|
cursor: pointer;
|
|
}
|
|
.checkbox-label input[type="checkbox"] {
|
|
accent-color: var(--accent);
|
|
}
|
|
|
|
#fieldContainer {
|
|
width: 100%;
|
|
overflow: hidden;
|
|
border-radius: 4px;
|
|
background: #080b10;
|
|
border: 2px solid #1a1f2a;
|
|
position: relative;
|
|
}
|
|
|
|
.left-col.drag-over {
|
|
outline: 2px dashed var(--accent);
|
|
outline-offset: -2px;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
#field {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
transform-origin: 0 0;
|
|
background-color: #0c1018;
|
|
background-repeat: no-repeat;
|
|
background-position: center;
|
|
transition: opacity 0.15s;
|
|
}
|
|
|
|
body.file-dragging #field {
|
|
opacity: 0.1;
|
|
}
|
|
|
|
body.file-dragging #svg image {
|
|
opacity: 0.1;
|
|
}
|
|
|
|
body.file-dragging .left-col {
|
|
outline: 3px dashed rgba(88, 166, 255, 0.9);
|
|
outline-offset: -3px;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
body.file-dragging .left-col.drag-over {
|
|
outline: 5px dashed var(--accent);
|
|
outline-offset: -5px;
|
|
border-radius: 8px;
|
|
background: rgba(88, 166, 255, 0.15);
|
|
}
|
|
|
|
body.file-dragging #bgPanel {
|
|
outline: 2px dashed rgba(88, 166, 255, 0.7);
|
|
outline-offset: -2px;
|
|
}
|
|
|
|
body.file-dragging #bgPanel.drag-over {
|
|
outline: 3px dashed var(--accent);
|
|
outline-offset: -3px;
|
|
background: rgba(88, 166, 255, 0.08);
|
|
}
|
|
|
|
body.file-dragging #widgetPanel {
|
|
outline: 2px dashed rgba(88, 166, 255, 0.7);
|
|
outline-offset: -2px;
|
|
}
|
|
|
|
body.file-dragging #widgetPanel.drag-over {
|
|
outline: 3px dashed var(--accent);
|
|
outline-offset: -3px;
|
|
background: rgba(88, 166, 255, 0.08);
|
|
}
|
|
|
|
#widget {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
transform-origin: 0 0;
|
|
background-color: var(--widget-bg);
|
|
background-image:
|
|
linear-gradient(45deg, var(--widget-grid) 25%, transparent 25%, transparent 75%, var(--widget-grid) 75%),
|
|
linear-gradient(45deg, var(--widget-grid) 25%, transparent 25%, transparent 75%, var(--widget-grid) 75%);
|
|
background-size: 30px 30px;
|
|
background-position:
|
|
0 0,
|
|
15px 15px;
|
|
border: 2px solid var(--accent);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
overflow: hidden;
|
|
}
|
|
|
|
#widget span {
|
|
color: rgba(255, 255, 255, 0.7);
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
letter-spacing: 2px;
|
|
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.error-msg {
|
|
color: #f85149;
|
|
font-size: 12px;
|
|
font-style: italic;
|
|
}
|
|
|
|
body.mode-edit .left-col .panel:first-child {
|
|
display: flex;
|
|
}
|
|
body.mode-edit .left-col .panel:last-child {
|
|
display: none;
|
|
}
|
|
body.mode-edit .right-col {
|
|
display: flex;
|
|
}
|
|
|
|
body.mode-preview .left-col .panel:first-child {
|
|
display: none;
|
|
}
|
|
body.mode-preview .left-col .panel:last-child {
|
|
display: flex;
|
|
}
|
|
body.mode-preview .right-col {
|
|
display: flex;
|
|
}
|
|
|
|
body.mode-preview .left-col {
|
|
width: 100%;
|
|
}
|
|
|
|
.bg-controls {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.widget-img-controls {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
margin-top: 8px;
|
|
}
|
|
|
|
.widget-paste-input {
|
|
width: 100%;
|
|
padding: 6px 8px;
|
|
margin-top: 8px;
|
|
background: var(--input-bg);
|
|
border: 1px dashed var(--border);
|
|
border-radius: 4px;
|
|
color: #8b949e;
|
|
font-size: 13px;
|
|
outline: none;
|
|
cursor: pointer;
|
|
transition: border-color 0.15s;
|
|
}
|
|
.widget-paste-input:focus {
|
|
border-color: var(--accent);
|
|
border-style: solid;
|
|
}
|
|
|
|
#bgObjectFit {
|
|
padding: 4px 8px;
|
|
background: var(--input-bg);
|
|
border: 1px solid var(--border);
|
|
border-radius: 4px;
|
|
color: var(--heading);
|
|
font-size: 13px;
|
|
font-family: monospace;
|
|
outline: none;
|
|
cursor: pointer;
|
|
}
|
|
#bgObjectFit:focus {
|
|
border-color: var(--accent);
|
|
}
|
|
|
|
@media (max-width: 900px) {
|
|
main {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|