Files

807 lines
18 KiB
CSS

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');
* {
box-sizing: border-box;
}
:root {
/* Physical dimensions in millimeters */
--scale: 4.5; /* 1mm = 4.5px on screen to make it comfortably visible */
--u-mm: 19.05; /* Standard 1U center-to-center spacing */
--key-cap-mm: 18; /* Typical mechanical keycap base width */
--gap-mm: calc(var(--u-mm) - var(--key-cap-mm)); /* 1.05mm gap */
--display-w-mm: 89.5;
--display-h-mm: 13.5;
--toggle-size-mm: 9.4;
--dist-top-mm: 10.6;
/* Colors */
--bg-color: #0f172a;
--display-bg: #000000;
--seg-unlit: rgba(255, 51, 51, 0.08);
--seg-lit: #ff3333;
--key-bg: #1e293b;
--key-border: #334155;
--text-color: #f8fafc;
}
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: flex-start; /* Prevents shifting when layout grows */
min-height: 100vh;
background-color: var(--bg-color);
color: var(--text-color);
font-family: 'Orbitron', sans-serif;
}
.main-wrapper {
display: flex;
gap: 50px;
align-items: stretch;
margin-top: 2vh; /* Use a small relative top margin instead of body padding */
}
/* --- Global Controls --- */
.global-controls {
background: #111827;
border: 1px solid #374151;
border-radius: 8px;
padding: 15px;
display: flex;
flex-direction: column;
gap: 12px;
color: #94a3b8;
font-family: sans-serif;
font-size: 12px;
box-shadow: 0 10px 25px rgba(0,0,0,0.8), inset 0 2px 5px rgba(255, 255, 255, 0.05);
width: 100%;
}
.hidden {
display: none !important;
}
.control-label {
display: flex;
align-items: center;
justify-content: space-between;
gap: 6px;
cursor: pointer;
user-select: none;
}
.slider-group {
display: flex;
flex-direction: column;
gap: 4px;
}
.styled-slider {
width: 100%;
cursor: pointer;
}
/* --- Lighting Studio --- */
.lighting-studio {
background: #111827;
border: 2px solid #374151;
border-radius: 12px;
padding: 20px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), inset 0 2px 5px rgba(255, 255, 255, 0.05);
color: #94a3b8;
font-family: sans-serif;
font-size: 12px;
}
.studio-section {
background: #1e293b;
border: 1px solid #475569;
border-radius: 8px;
padding: 12px;
margin-bottom: 5px;
}
.styled-color {
width: 40px;
height: 24px;
border: none;
border-radius: 4px;
cursor: pointer;
padding: 0;
background: none;
}
.device-container {
background: #111827;
border: 2px solid #374151;
border-radius: 12px;
/* Outer bezel margin around the device */
padding: calc(8 * var(--scale) * 1px);
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), inset 0 2px 5px rgba(255, 255, 255, 0.05);
width: fit-content;
display: flex;
flex-direction: column;
align-items: center; /* Center display over the numpad since display is wider */
}
/* --- Real Life Custom SVG 7-Segment Display --- */
.display-container {
background: var(--display-bg);
border: calc(0.5 * var(--scale) * 1px) solid #1f2937;
border-radius: calc(0.5 * var(--scale) * 1px);
padding: calc(0.5 * var(--scale) * 1px);
/* Physical dimensions mapped exactly to CSS */
width: calc(var(--display-w-mm) * var(--scale) * 1px);
height: calc(var(--display-h-mm) * var(--scale) * 1px);
/* Exact physical distance to top row */
margin-bottom: calc(var(--dist-top-mm) * var(--scale) * 1px);
box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9), 0 0 5px rgba(0,0,0,0.5);
display: flex;
justify-content: space-evenly;
align-items: center;
overflow: hidden;
}
.digit {
height: 90%;
width: auto;
max-width: 8%;
transform: skewX(-8deg);
}
.seg {
fill: var(--seg-unlit);
transition: fill 0.05s ease;
stroke: none;
}
.seg.lit {
fill: var(--seg-lit);
filter: drop-shadow(0 0 2px var(--seg-lit));
}
/* --- Numpad Layout --- */
.numpad {
display: grid;
/* Accurately size grid columns and rows based on keycap mm and gap mm */
grid-template-columns: repeat(4, calc(var(--key-cap-mm) * var(--scale) * 1px));
grid-auto-rows: calc(var(--key-cap-mm) * var(--scale) * 1px);
gap: calc(var(--gap-mm) * var(--scale) * 1px);
}
.key {
background: linear-gradient(145deg, #273449, #1a2332);
border: 1px solid var(--key-border);
border-radius: calc(1 * var(--scale) * 1px); /* Subtle physical keycap rounding */
color: #94a3b8; /* Dimmer text when unlit */
font-family: 'Orbitron', sans-serif;
font-size: calc(4.5 * var(--scale) * 1px);
font-weight: 700;
cursor: pointer;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4), inset 0 2px 2px rgba(255, 255, 255, 0.1);
transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
user-select: none;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
--led-color: #0ea5e9; /* Default cyan backlight, modifiable via JS */
}
.key:hover {
background: linear-gradient(145deg, #334155, #273449);
border-color: #475569;
}
.key:active,
.key.pressed {
transform: translateY(2px);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.6);
background: #0f172a;
}
.key.action { font-size: calc(2.8 * var(--scale) * 1px); }
.key.tall {
grid-row: span 2;
height: auto;
}
/* --- Paint Mode States --- */
.is-painting .key {
cursor: crosshair;
}
.is-painting .key:hover {
filter: brightness(1.3);
box-shadow: inset 0 0 10px rgba(14, 165, 233, 0.5);
}
/* Visualization of configured paint colors (separate from live LED state) */
.show-paint-colors .key {
border-bottom: 2px solid var(--paint-color, #1e293b);
box-shadow: inset 0 0 12px var(--paint-color, transparent);
}
.key.wide { grid-column: span 2; }
/* Special Top Row Keys */
.empty {
pointer-events: none;
}
.key.solid-orange {
--led-color: #ea580c; /* Default match to cap color */
background: #ea580c;
border-color: #9a3412;
}
.key.solid-orange:hover {
background: #f97316;
border-color: #c2410c;
}
.key.solid-red {
--led-color: #dc2626; /* Default match to cap color */
background: #dc2626;
border-color: #991b1b;
}
.key.solid-red:hover {
background: #ef4444;
border-color: #b91c1c;
}
/* The physical 9.4mm rounded square toggleable button */
.key.toggleable {
width: calc(var(--toggle-size-mm) * var(--scale) * 1px);
height: calc(var(--toggle-size-mm) * var(--scale) * 1px);
border-radius: calc(1.5 * var(--scale) * 1px); /* Rounded square */
justify-self: center;
align-self: center;
font-size: calc(2.5 * var(--scale) * 1px);
border: calc(0.3 * var(--scale) * 1px) solid #0f172a;
}
.key.toggleable.active {
background: #059669;
border-color: #064e3b;
transform: translateY(2px);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.6);
color: #fff;
}
/* --- Hardware Lighting States --- */
/* Normal Keys: Lightable font + Underglow */
.key.led-on {
color: #ffffff; /* Fully lit text */
text-shadow: 0 0 calc(1 * var(--scale) * 1px) var(--led-color),
0 0 calc(3 * var(--scale) * 1px) var(--led-color);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4),
inset 0 2px 2px rgba(255, 255, 255, 0.1),
0 0 calc(3 * var(--scale) * 1px) var(--led-color);
}
/* Solid Orange: Underglow only */
.key.solid-orange {
color: #ffffff; /* Font is always white on solid caps */
}
.key.solid-orange.led-on {
text-shadow: none; /* No font lighting */
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4),
inset 0 2px 2px rgba(255, 255, 255, 0.1),
0 0 calc(4 * var(--scale) * 1px) var(--led-color);
}
/* Solid Red: Underglow only */
.key.solid-red {
color: #ffffff; /* Font is always white on solid caps */
}
.key.solid-red.led-on {
text-shadow: none; /* No font lighting */
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4),
inset 0 2px 2px rgba(255, 255, 255, 0.1),
0 0 calc(4 * var(--scale) * 1px) var(--led-color);
}
/* --- Terminal UI --- */
.terminal-container {
background: #111827;
border: 2px solid #374151;
border-radius: 12px;
padding: 20px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), inset 0 2px 5px rgba(255, 255, 255, 0.05);
width: 100%;
flex: 1 1 0; /* Grow, shrink, basis 0 to prevent intrinsic height expansion */
min-height: 0;
display: flex;
flex-direction: column;
gap: 15px;
color: #94a3b8;
font-family: sans-serif;
font-size: 12px;
}
.term-header {
padding: 10px 15px;
background: #1e293b;
font-family: 'Orbitron', sans-serif;
font-size: 14px;
font-weight: bold;
border-bottom: 1px solid #334155;
color: #94a3b8;
}
.ws-status {
font-size: 10px;
padding: 3px 6px;
border-radius: 12px;
text-transform: uppercase;
font-weight: bold;
}
.ws-status.connected {
background: rgba(34, 197, 94, 0.2);
color: #4ade80;
border: 1px solid #22c55e;
}
.ws-status.disconnected {
background: rgba(239, 68, 68, 0.2);
color: #f87171;
border: 1px solid #ef4444;
}
.term-output {
flex: 1 1 0; /* Grow, shrink, basis 0 */
min-height: 0;
background: #0f172a;
border: 1px solid #1e293b;
border-radius: 6px;
padding: 10px;
overflow-y: auto;
font-family: monospace;
font-size: 14px;
display: flex;
flex-direction: column;
gap: 6px;
box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}
.term-line {
word-break: break-all;
line-height: 1.4;
}
.term-line.rx { color: #38bdf8; } /* Receive: Blue */
.term-line.tx { color: #4ade80; } /* Transmit: Green */
.term-line .prefix { font-weight: bold; margin-right: 8px; opacity: 0.5; color: #f8fafc; }
.term-input-wrapper {
display: flex;
gap: 10px;
}
.term-input {
flex-grow: 1;
background: #1e293b;
border: 1px solid #374151;
border-radius: 6px;
padding: 12px;
color: #f8fafc;
font-family: monospace;
font-size: 14px;
outline: none;
transition: border-color 0.2s, box-shadow 0.2s;
}
.term-input:focus {
border-color: #38bdf8;
box-shadow: 0 0 5px rgba(56, 189, 248, 0.3);
}
.term-btn {
background: linear-gradient(145deg, #3b82f6, #2563eb);
color: white;
border: 1px solid #1d4ed8;
border-radius: 6px;
padding: 0 20px;
font-family: 'Orbitron', sans-serif;
font-weight: bold;
cursor: pointer;
transition: all 0.2s;
}
.term-btn:hover {
background: linear-gradient(145deg, #60a5fa, #3b82f6);
}
.term-btn:active {
transform: translateY(2px);
}
/* --- Custom Context Menu --- */
.context-menu {
position: absolute;
background: #1e293b;
border: 1px solid #475569;
border-radius: 8px;
box-shadow: 0 10px 25px rgba(0,0,0,0.8), inset 0 1px 1px rgba(255,255,255,0.1);
padding: 12px;
z-index: 1000;
color: #f8fafc;
font-family: sans-serif;
min-width: 250px;
}
.context-menu.hidden {
display: none;
}
.context-header {
font-size: 13px;
margin-bottom: 10px;
color: #94a3b8;
border-bottom: 1px solid #334155;
padding-bottom: 6px;
}
.context-body {
display: flex;
flex-direction: column;
gap: 8px;
}
.ctx-select {
background: #0f172a;
color: #f8fafc;
border: 1px solid #475569;
padding: 6px;
border-radius: 4px;
outline: none;
font-size: 13px;
width: 100%;
}
.ctx-btn {
background: linear-gradient(145deg, #0ea5e9, #0284c7);
color: white;
border: 1px solid #0369a1;
padding: 6px;
border-radius: 4px;
cursor: pointer;
font-weight: bold;
transition: all 0.1s;
}
.ctx-btn:hover { background: linear-gradient(145deg, #38bdf8, #0ea5e9); }
.ctx-btn:active { transform: translateY(1px); }
/* Macro Editor Modal */
.macro-modal {
background: rgba(15, 23, 42, 0.95);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 12px;
padding: 20px;
width: 800px;
max-width: 90vw;
max-height: 90vh;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
display: flex;
flex-direction: column;
}
.macro-modal-header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid rgba(255,255,255,0.1);
padding-bottom: 10px;
margin-bottom: 15px;
}
.macro-modal-header h2 {
margin: 0;
color: #e2e8f0;
font-size: 1.25rem;
}
.macro-modal-body {
display: flex;
gap: 20px;
flex: 1;
min-height: 0; /* Important for flex child scrolling */
overflow-y: auto;
padding-right: 10px; /* Leave space for scrollbar */
}
.macro-slots {
flex: 0 0 200px;
border-right: 1px solid rgba(255,255,255,0.1);
padding-right: 15px;
display: flex;
flex-direction: column;
}
.macro-slots h3 {
margin: 0 0 10px 0;
font-size: 1rem;
color: #94a3b8;
}
#macro-slot-list {
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 8px;
}
.macro-slot-item {
background: rgba(255,255,255,0.05);
border: 1px solid rgba(255,255,255,0.1);
padding: 10px;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s;
display: flex;
flex-direction: column;
}
.macro-slot-item:hover {
background: rgba(255,255,255,0.1);
}
.macro-slot-item.selected {
background: rgba(14, 165, 233, 0.2);
border-color: #0ea5e9;
}
.macro-slot-name {
font-weight: 600;
color: #f8fafc;
margin-bottom: 4px;
}
.macro-slot-status {
font-size: 11px;
color: #94a3b8;
}
.macro-editor {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
.macro-editor-header {
display: flex;
gap: 15px;
margin-bottom: 15px;
}
.macro-sequence-container {
flex: 1;
background: rgba(0,0,0,0.2);
border: 1px solid rgba(255,255,255,0.05);
border-radius: 6px;
display: flex;
flex-direction: column;
min-height: 0;
}
.macro-sequence-header {
display: flex;
padding: 10px 15px;
border-bottom: 1px solid rgba(255,255,255,0.1);
font-size: 12px;
font-weight: 600;
color: #94a3b8;
background: rgba(255,255,255,0.02);
}
#macro-sequence-list {
flex: 1;
overflow-y: auto;
padding: 10px;
display: flex;
flex-direction: column;
gap: 8px;
}
.macro-action-row {
display: flex;
gap: 10px;
align-items: center;
background: rgba(255,255,255,0.05);
padding: 8px;
border-radius: 4px;
}
.macro-action-row > * {
flex: 1;
}
.macro-action-row > .controls {
flex: 0 0 80px;
display: flex;
gap: 5px;
justify-content: center;
}
.macro-action-row .controls button {
background: rgba(255,255,255,0.1);
border: none;
color: #e2e8f0;
width: 24px;
height: 24px;
border-radius: 4px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
}
.macro-action-row .controls button:hover {
background: rgba(255,255,255,0.2);
}
.macro-action-row .controls button.delete:hover {
background: #ef4444;
}
.macro-modal-footer {
margin-top: 15px;
padding-top: 15px;
border-top: 1px solid rgba(255,255,255,0.1);
}
/* Searchable Dropdown CSS */
.searchable-dropdown {
position: relative;
width: 100%;
}
.searchable-dropdown-input {
width: 100%;
box-sizing: border-box;
padding: 6px 10px;
background: rgba(15, 23, 42, 0.6);
border: 1px solid rgba(255, 255, 255, 0.1);
color: #f8fafc;
border-radius: 4px;
font-size: 13px;
cursor: pointer;
}
.searchable-dropdown-input:focus {
outline: none;
border-color: #38bdf8;
background: rgba(15, 23, 42, 0.8);
}
.searchable-dropdown-list {
position: absolute;
top: 100%;
left: 0;
right: 0;
background: #1e293b;
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 4px;
max-height: 200px;
overflow-y: auto;
z-index: 1000;
display: none;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}
.searchable-dropdown.open .searchable-dropdown-list {
display: block;
}
.searchable-dropdown-list-item {
padding: 6px 10px;
cursor: pointer;
font-size: 12px;
color: #e2e8f0;
}
.searchable-dropdown-list-item:hover {
background: #334155;
}
.searchable-dropdown-list-item.selected {
background: #0ea5e9;
color: white;
}
#macro-modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.6);
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
}
#macro-modal-overlay.hidden {
display: none;
}
/* Fix searchable dropdown font to match term-input */
.searchable-dropdown-input {
font-family: inherit;
height: 32px;
}
/* Fix delay input styling to match searchable dropdown exactly */
input[type="number"].term-input {
font-family: inherit;
height: 32px;
padding: 6px 10px;
background: rgba(15, 23, 42, 0.6);
border: 1px solid rgba(255, 255, 255, 0.1);
color: #f8fafc;
border-radius: 4px;
font-size: 13px;
box-sizing: border-box;
}
/* Ensure controls have slightly larger buttons */
.macro-action-row .controls button {
width: 28px;
height: 28px;
font-size: 14px;
}
/* Make Add Action button thicker */
#macro-add-action-btn {
padding: 10px 20px;
font-size: 14px;
width: auto;
min-width: 150px;
}
/* Make Apply button thicker */
#macro-apply-btn {
padding: 12px;
font-size: 15px;
font-weight: 600;
}
/* Override font for readability across all dropdowns and inputs */
.searchable-dropdown-input,
.searchable-dropdown-list-item,
input[type="number"].term-input,
.ctx-select,
.term-input {
font-family: 'Inter', 'Roboto', 'Segoe UI', sans-serif !important;
}
/* Close Button */
.close-btn {
cursor: pointer;
font-size: 24px;
font-weight: bold;
color: #94a3b8;
transition: color 0.2s;
user-select: none;
}
.close-btn:hover {
color: #ef4444;
}
/* Apply overlay centering to BOTH modals */
#macro-modal-overlay,
#sys-modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.6);
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
}
#macro-modal-overlay.hidden,
#sys-modal-overlay.hidden {
display: none;
}