Something went wrong. Try again.
honestly just guess what it does. You're probably right.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430/* tsbutt — mobile-first, no framework. */
:root { --bg: #121216; --card: #1c1c22; --text: #e8e8ec; --muted: #9a9aa4; --accent: #7c5cff; --danger: #ff4757; --ok: #2ed573; --warn: #ffa502; --radius: 12px; /* Height of the fixed emergency-stop dock; content must clear it. */ --estop-dock: 4.4rem;}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.4; -webkit-user-select: none; user-select: none; touch-action: manipulation;}
#app { margin: 0 auto; /* Wide enough to use desktop real estate (waveforms, freehand canvas), narrow enough to keep visible margins on very large screens. */ max-width: 60rem; padding: 1rem; /* Always leave room for the fixed emergency-stop dock. */ padding-bottom: calc(var(--estop-dock) + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 0.9rem; min-height: 100dvh;}
header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;}
h1 { font-size: 1.4rem; margin: 0; }h2 { font-size: 1rem; margin: 0 0 0.5rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.card { background: var(--card); border-radius: var(--radius); padding: 1rem;}
.muted { color: var(--muted); }
.pill { padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; white-space: nowrap;}.pill-on { background: color-mix(in srgb, var(--ok) 25%, transparent); color: var(--ok); }.pill-off { background: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--warn); }.pill-bad { background: color-mix(in srgb, var(--danger) 25%, transparent); color: var(--danger); }
.banner { background: color-mix(in srgb, var(--danger) 20%, transparent); border: 1px solid var(--danger); border-radius: var(--radius); padding: 0.7rem 1rem; font-size: 0.9rem; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;}.hidden { display: none; }
button { background: var(--accent); color: white; border: none; border-radius: var(--radius); padding: 0.8rem 1.2rem; font-size: 1rem; font-weight: 600; cursor: pointer;}button:disabled { opacity: 0.4; cursor: not-allowed; }button.danger { background: var(--danger); width: 100%; padding: 1.2rem; font-size: 1.2rem;}button.ghost { background: transparent; color: var(--muted); padding: 0.4rem 0.6rem;}button.ghost:disabled { color: #55555e; }
input[type="range"] { width: 100%; height: 3rem; /* large touch target */ accent-color: var(--accent);}
/* --- direct control: per-vibrator rows ---------------------------------- */
.device-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem;}.device-name { font-size: 1rem; margin: 0 0 0.5rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}.battery { font-size: 0.85rem; white-space: nowrap; }
.vrow { background: var(--bg); border-radius: var(--radius); padding: 0.5rem 0.7rem; display: flex; flex-direction: column; gap: 0.3rem;}.vrow + .vrow { margin-top: 0.5rem; }.vlabel { font-size: 0.9rem; font-weight: 600; color: var(--text);}.vbtns { display: flex; gap: 0.5rem; }.vbtns .hold { flex: 1; padding: 0.6rem 0.4rem; font-size: 0.9rem; }/* Hold button colors are shared with every mode's compact hold buttons. */.hold-max { background: var(--accent); }.hold-stop { background: var(--danger); }.hold.holding { filter: brightness(1.35); }.empty-note { padding: 0.5rem 0.2rem; }
/* --- mode tabs ----------------------------------------------------------- */
#mode-tabs { display: flex; gap: 0.4rem;}.tab { flex: 1; background: var(--card); color: var(--muted); padding: 0.6rem 0.4rem; font-size: 0.95rem; border-radius: var(--radius);}.tab.active { background: var(--accent); color: white;}
/* --- pattern mode --------------------------------------------------------- */
.transport { display: flex; gap: 0.4rem; flex-wrap: wrap;}.transport button { flex: 1; padding: 0.6rem 0.4rem; font-size: 0.9rem; }.transport button.active { filter: brightness(1.3); }.loop-row { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.6rem; font-size: 0.9rem;}.loop-row input { width: 5rem; background: var(--bg); color: var(--text); border: 1px solid #33333c; border-radius: 8px; padding: 0.4rem; font-size: 0.95rem;}
.prow { display: flex; align-items: stretch; gap: 0.4rem; background: var(--card); border-radius: var(--radius); padding: 0.25rem 0.4rem;}.prow + .prow { margin-top: 0.25rem; }.pbtns { display: flex; flex-direction: column; gap: 0.3rem; justify-content: center;}.pbtns .glyph { width: 2.4rem; padding: 0.35rem 0; font-size: 1rem; line-height: 1;}.pwave-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; position: relative;}.wave-tag { position: absolute; top: 4px; left: 8px; font-size: 0.7rem; color: var(--muted); pointer-events: none; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}.wave { width: 100%; /* Tall enough for fine vertical adjustments. */ height: 9rem; background: var(--bg); border: 1px solid #33333c; border-radius: 8px; touch-action: none; /* drags edit the waveform instead of scrolling */ cursor: crosshair;}.wave-zero { stroke: #33333c; stroke-width: 1; vector-effect: non-scaling-stroke;}.wave-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke;}.wave-head { stroke: var(--warn); stroke-width: 2; vector-effect: non-scaling-stroke;}
/* --- freehand mode -------------------------------------------------------- */
.freehand-bar .submode { display: flex; gap: 0.4rem;}.freehand-bar .submode .tab { flex: 1; }.freehand-bar .hint { font-size: 0.8rem; margin: 0.5rem 0 0; }
#freehand-wrap { position: relative; height: min(70vh, 42rem); border-radius: var(--radius); overflow: hidden;}#freehand-canvas { width: 100%; height: 100%; display: block; background: var(--card); touch-action: none; /* drags drive vibrators instead of scrolling */ cursor: crosshair;}.fh-ring { stroke-width: 2; } /* stroke color is per-vibrator (set in app.js) */.fh-dot { stroke: color-mix(in srgb, white 60%, transparent); stroke-width: 1.5;} /* fill color is per-vibrator */.fh-label { font-size: 10px; pointer-events: none;} /* fill color is per-vibrator */.fh-handle { stroke: #33333c; stroke-width: 1.5; }.fh-handle-radius { fill: var(--warn); }.fh-handle-curve { fill: var(--ok); }#fh-selection { fill: none; stroke: var(--text); stroke-width: 2;}#fh-key { position: absolute; right: 8px; bottom: 8px; max-width: 60%; display: flex; flex-direction: column; gap: 0.15rem; background: color-mix(in srgb, var(--bg) 82%, transparent); border: 1px solid #33333c; border-radius: 8px; padding: 0.4rem 0.6rem; font-size: 0.75rem; pointer-events: none;}.fh-key-row { display: flex; align-items: center; gap: 0.4rem; white-space: nowrap;}.fh-key-swatch { flex: none; width: 0.7rem; height: 0.7rem; border-radius: 50%;}
/* --- settings panel ------------------------------------------------------- */
.icon-btn { background: transparent; color: var(--muted); padding: 0.3rem 0.5rem; font-size: 1.25rem; line-height: 1;}.icon-btn:hover:not(:disabled) { color: var(--text); }
#settings-overlay { position: fixed; inset: 0; z-index: 150; background: rgb(0 0 0 / 0.55); display: flex; align-items: flex-start; justify-content: center; padding: 3rem 1rem calc(1rem + env(safe-area-inset-bottom)); overflow-y: auto;}/* .hidden alone loses to the ID's display:flex, so re-state it here. */#settings-overlay.hidden { display: none; }.settings-panel { width: 100%; max-width: 30rem; display: flex; flex-direction: column; gap: 0.5rem;}.settings-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;}.settings-head h2 { margin: 0; color: var(--text); }.settings-label { font-weight: 600; font-size: 0.9rem; }.settings-panel .muted { margin: 0; font-size: 0.85rem; }.settings-panel code { background: var(--bg); border-radius: 4px; padding: 0 0.25rem;}#endpoint { width: 100%; background: var(--bg); color: var(--text); border: 1px solid #33333c; border-radius: 8px; padding: 0.5rem; font-size: 0.95rem; -webkit-user-select: text; user-select: text;}.row button.ghost { background: color-mix(in srgb, var(--card) 70%, transparent); }
/* --- emergency stop dock ------------------------------------------------- *//* Fixed to the bottom of the viewport in every view; nothing may cover it. */
#estop-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; padding: 0.5rem 1.25rem calc(0.5rem + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, transparent);}#estop-dock .danger { border-radius: var(--radius); /* Prominent but not overwhelming; centered with breathing room. */ max-width: 40rem; margin: 0 auto; display: block; padding: 0.9rem 1.2rem; font-size: 1.05rem;}
#log { max-height: 12rem; overflow: auto; font-size: 0.75rem; color: var(--muted); white-space: pre-wrap;}
details { font-size: 0.85rem; }summary { color: var(--muted); cursor: pointer; }