Files
reaktor/src/index.css
Jose Luis 65a89e2b59 feat: add sequencer, piano roll modules with pre-composed chiptune melody
Add step sequencer (16-step with note/gate editing) and piano roll
(canvas-based MIDI editor with draw/erase tools). Includes a Megaman-style
melody in C minor. Chiptune preset now uses piano roll instead of keyboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 01:30:03 +01:00

249 lines
9.0 KiB
CSS

/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
--bg: #08080f;
--panel: #0e0e1a;
--surface: #14142a;
--surface2: #1a1a35;
--border: #252545;
--text: #c8cce0;
--text2: #6668a0;
--accent: #00e5ff;
--accent2: #ff6644;
--green: #44ff88;
--yellow: #ffcc00;
--purple: #aa55ff;
--red: #ff4466;
--wire-audio: #00e5ff;
--wire-control: #ff6644;
--wire-trigger: #ffcc00;
--knob-track: #333;
--knob-fill: #00e5ff;
--module-w: 180;
--port-r: 6;
}
html, body, #root {
width: 100%; height: 100%; overflow: hidden;
background: var(--bg); color: var(--text);
font-family: 'Inter', 'SF Pro', -apple-system, system-ui, sans-serif;
font-size: 12px;
-webkit-font-smoothing: antialiased;
}
/* ===== Layout ===== */
.app { display: flex; flex-direction: column; height: 100vh; }
.toolbar {
height: 40px; background: var(--panel); border-bottom: 1px solid var(--border);
display: flex; align-items: center; padding: 0 12px; gap: 8px; flex-shrink: 0;
z-index: 10;
}
.toolbar-title {
font-weight: 700; font-size: 14px; color: var(--accent);
letter-spacing: 1px; text-transform: uppercase; margin-right: 16px;
}
.toolbar-btn {
padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px;
background: var(--surface); color: var(--text2); cursor: pointer;
font-size: 11px; font-weight: 500; transition: all 0.15s;
font-family: inherit;
}
.toolbar-btn:hover { border-color: var(--accent); color: var(--text); }
.toolbar-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }
.toolbar-btn.danger { border-color: var(--red); color: var(--red); }
.toolbar-btn.danger:hover { background: var(--red); color: #000; }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.toolbar-group { display: flex; gap: 4px; align-items: center; }
.toolbar-label { color: var(--text2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.main-area { flex: 1; position: relative; overflow: hidden; }
/* ===== Node Canvas ===== */
.node-canvas {
position: absolute; inset: 0; cursor: grab;
}
.node-canvas.grabbing { cursor: grabbing; }
.node-canvas.connecting { cursor: crosshair; }
.wires-svg {
position: absolute; inset: 0; pointer-events: none; z-index: 3;
overflow: visible;
}
.wires-svg path {
fill: none; stroke-width: 2.5; stroke-linecap: round;
pointer-events: stroke; cursor: pointer;
filter: drop-shadow(0 0 3px rgba(0,229,255,0.3));
}
.wires-svg path.audio { stroke: var(--wire-audio); opacity: 0.8; }
.wires-svg path.control { stroke: var(--wire-control); opacity: 0.8; }
.wires-svg path.trigger { stroke: var(--wire-trigger); opacity: 0.8; }
.wires-svg path.temp { stroke-dasharray: 6 4; opacity: 0.5; filter: none; }
.wires-svg path:hover { stroke-width: 4; opacity: 1; filter: drop-shadow(0 0 6px rgba(0,229,255,0.6)); }
/* ===== Modules ===== */
.module {
position: absolute; width: 180px; min-width: 180px;
background: var(--surface); border: 1px solid var(--border);
border-radius: 8px; user-select: none; z-index: 2;
box-shadow: 0 4px 16px rgba(0,0,0,0.4);
transition: box-shadow 0.15s;
}
.module.selected { border-color: var(--accent); box-shadow: 0 0 20px rgba(0,229,255,0.15); }
.module:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.5); }
.module-header {
display: flex; align-items: center; gap: 6px;
padding: 6px 10px; border-bottom: 1px solid var(--border);
cursor: grab; border-radius: 8px 8px 0 0;
background: var(--surface2);
}
.module-header .type-icon { font-size: 14px; }
.module-header .type-name {
font-size: 11px; font-weight: 600; text-transform: uppercase;
letter-spacing: 0.5px; color: var(--text);
flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.module-header .close-btn {
width: 18px; height: 18px; border: none; background: transparent;
color: var(--text2); cursor: pointer; font-size: 12px; border-radius: 3px;
display: flex; align-items: center; justify-content: center;
}
.module-header .close-btn:hover { background: var(--red); color: #fff; }
.module-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
/* Ports */
.port-row {
display: flex; align-items: center; gap: 6px;
position: relative; height: 20px;
}
.port-row.input { flex-direction: row; }
.port-row.output { flex-direction: row-reverse; }
.port-dot {
width: 12px; height: 12px; border-radius: 50%;
border: 2px solid var(--border); background: var(--surface);
cursor: pointer; flex-shrink: 0; transition: all 0.15s;
position: relative; z-index: 5;
}
.port-dot.audio { border-color: var(--wire-audio); }
.port-dot.control { border-color: var(--wire-control); }
.port-dot.trigger { border-color: var(--wire-trigger); }
.port-dot:hover { transform: scale(1.3); }
.port-dot.connected { background: currentColor; }
.port-dot.audio.connected { background: var(--wire-audio); }
.port-dot.control.connected { background: var(--wire-control); }
.port-dot.trigger.connected { background: var(--wire-trigger); }
.port-dot.compatible { animation: pulse-port 0.6s infinite alternate; }
@keyframes pulse-port {
from { box-shadow: 0 0 2px currentColor; }
to { box-shadow: 0 0 8px currentColor; }
}
.port-label {
font-size: 10px; color: var(--text2); text-transform: uppercase;
letter-spacing: 0.3px; white-space: nowrap;
}
/* Knobs */
.param-row {
display: flex; align-items: center; gap: 6px;
}
.param-label {
font-size: 10px; color: var(--text2); width: 48px;
text-transform: uppercase; letter-spacing: 0.3px; flex-shrink: 0;
}
.knob-container { position: relative; width: 32px; height: 32px; flex-shrink: 0; }
.knob-svg { width: 32px; height: 32px; cursor: pointer; }
.knob-track { fill: none; stroke: var(--knob-track); stroke-width: 3; stroke-linecap: round; }
.knob-fill { fill: none; stroke-width: 3; stroke-linecap: round; }
.knob-dot { fill: var(--text); }
.param-value {
font-size: 10px; color: var(--accent); font-family: 'JetBrains Mono', monospace;
min-width: 40px; text-align: right;
}
/* Select param */
.param-select {
flex: 1; background: var(--bg); border: 1px solid var(--border);
border-radius: 3px; padding: 2px 4px; color: var(--text);
font-size: 10px; font-family: inherit; cursor: pointer;
}
.param-select:focus { outline: none; border-color: var(--accent); }
/* Scope canvas */
.scope-canvas {
width: 100%; height: 60px; border-radius: 4px;
background: #050510; border: 1px solid var(--border);
}
/* ===== Module Palette (sidebar) ===== */
.palette {
position: absolute; left: 8px; top: 8px; z-index: 20;
background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
padding: 8px; display: flex; flex-direction: column; gap: 4px;
box-shadow: 0 8px 32px rgba(0,0,0,0.5);
max-height: calc(100% - 16px); overflow-y: auto;
}
.palette-title {
font-size: 9px; font-weight: 700; color: var(--text2);
text-transform: uppercase; letter-spacing: 1px; padding: 2px 4px;
}
.palette-item {
display: flex; align-items: center; gap: 6px;
padding: 5px 8px; border-radius: 4px; cursor: pointer;
font-size: 11px; color: var(--text); transition: all 0.1s;
}
.palette-item:hover { background: var(--surface2); }
.palette-item .p-icon { font-size: 14px; width: 20px; text-align: center; }
.palette-item .p-name { font-weight: 500; }
.palette-item .p-cat { font-size: 9px; color: var(--text2); margin-left: auto; }
/* ===== Status Bar ===== */
.status-bar {
height: 24px; background: var(--panel); border-top: 1px solid var(--border);
display: flex; align-items: center; padding: 0 12px; gap: 16px;
font-size: 10px; color: var(--text2); flex-shrink: 0; z-index: 10;
}
.status-bar .status-accent { color: var(--accent); }
/* ===== Preset Modal ===== */
.modal-overlay {
position: fixed; inset: 0; background: rgba(0,0,0,0.7);
display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
padding: 20px; min-width: 360px; max-width: 500px;
box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.modal h2 { font-size: 15px; color: var(--accent); margin-bottom: 12px; }
.modal input {
width: 100%; padding: 8px 10px; background: var(--bg);
border: 1px solid var(--border); border-radius: 4px;
color: var(--text); font-size: 13px; font-family: inherit;
}
.modal input:focus { outline: none; border-color: var(--accent); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.modal-actions button { padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: inherit; }
.modal-actions .primary { background: var(--accent); color: #000; border-color: var(--accent); }
.preset-list { max-height: 200px; overflow-y: auto; margin: 8px 0; }
.preset-item {
padding: 6px 10px; cursor: pointer; border-radius: 4px;
display: flex; align-items: center; justify-content: space-between;
font-size: 12px;
}
.preset-item:hover { background: var(--surface2); }
.preset-item .preset-date { color: var(--text2); font-size: 10px; }