197 lines
7.2 KiB
CSS
197 lines
7.2 KiB
CSS
/* Mot trang, khong dependency. Muc tieu < 60 kB cho ca ba file. */
|
|
:root {
|
|
/* Tone SANG. Moi mau di theo cap voi mot mau tren canvas -- xem
|
|
`CANVAS` trong app.js. Doi mot ben ma quen ben kia se lam ban do chim
|
|
vao nen: o bi chiem tung duoc ve SANG cho nen toi. */
|
|
--bg: #eef1f6;
|
|
--panel: #ffffff;
|
|
--line: #ccd5e0;
|
|
--fg: #1c232c;
|
|
--dim: #66717f;
|
|
--ok: #157a56;
|
|
--warn: #8a6100;
|
|
--bad: #c0392b;
|
|
--accent: #1f6fb8;
|
|
--chip: #e3e9f1;
|
|
}
|
|
|
|
* { box-sizing: border-box; }
|
|
|
|
html, body {
|
|
margin: 0; height: 100%;
|
|
background: var(--bg); color: var(--fg);
|
|
font: 13px/1.45 ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
|
|
}
|
|
|
|
header {
|
|
display: flex; align-items: center; gap: 12px;
|
|
padding: 8px 12px; border-bottom: 1px solid var(--line);
|
|
background: var(--panel);
|
|
}
|
|
.spacer { flex: 1; }
|
|
.layers { display: flex; gap: 14px; }
|
|
.layers label { cursor: pointer; user-select: none; color: var(--dim); }
|
|
.layers input { accent-color: var(--accent); margin-right: 4px; }
|
|
|
|
.chip {
|
|
padding: 3px 10px; border-radius: 3px;
|
|
background: var(--chip); border: 1px solid var(--line);
|
|
}
|
|
.chip.ok { color: var(--ok); border-color: #9ccbb9; }
|
|
.chip.bad { color: var(--bad); border-color: #e0a9a3; }
|
|
|
|
main { display: flex; height: calc(100% - 41px); }
|
|
|
|
.canvas-wrap { position: relative; flex: 1; min-width: 0; }
|
|
canvas { display: block; width: 100%; height: 100%; cursor: grab; }
|
|
canvas:active { cursor: grabbing; }
|
|
|
|
#hint {
|
|
position: absolute; left: 10px; bottom: 8px;
|
|
color: var(--dim); font-size: 11px; pointer-events: none;
|
|
}
|
|
|
|
aside {
|
|
width: 260px; flex: none; overflow-y: auto;
|
|
border-left: 1px solid var(--line); background: var(--panel);
|
|
}
|
|
aside section { padding: 10px 12px; border-bottom: 1px solid var(--line); }
|
|
aside h2 {
|
|
margin: 0 0 6px; font-size: 11px; font-weight: 500;
|
|
letter-spacing: .08em; text-transform: uppercase; color: var(--dim);
|
|
}
|
|
aside table { width: 100%; border-collapse: collapse; }
|
|
aside td { padding: 1px 0; }
|
|
aside td:first-child { color: var(--dim); }
|
|
aside td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
|
|
|
|
.state {
|
|
padding: 5px 8px; border-radius: 3px; text-align: center;
|
|
background: var(--chip); border: 1px solid var(--line); margin-bottom: 4px;
|
|
}
|
|
.state.ok { color: var(--ok); border-color: #9ccbb9; }
|
|
.state.warn { color: var(--warn); border-color: #d9c48a; }
|
|
.state.bad { color: var(--bad); border-color: #e0a9a3; }
|
|
.detail { color: var(--dim); font-size: 11px; min-height: 16px; margin-bottom: 4px; }
|
|
|
|
.controls { display: flex; gap: 8px; }
|
|
button {
|
|
flex: 1; padding: 9px; cursor: pointer;
|
|
background: var(--chip); color: var(--fg);
|
|
border: 1px solid var(--line); border-radius: 3px;
|
|
font: inherit;
|
|
}
|
|
button:hover { border-color: var(--accent); }
|
|
button.danger { color: var(--bad); border-color: #e0a9a3; }
|
|
button.danger:hover { background: var(--bad); color: #fff; }
|
|
|
|
/* --- Joystick ---
|
|
Thay cho virtual_joystick.py (896 dong Tkinter) cua ban ROS.
|
|
Chi gui gia tri da chuan hoa [-1,1]; moi phep ramp va deadman deu o C++. */
|
|
.joy-wrap { display: flex; justify-content: center; padding: 6px 0 10px; }
|
|
|
|
.joy {
|
|
position: relative;
|
|
width: 160px; height: 160px;
|
|
border-radius: 50%;
|
|
background: radial-gradient(circle at 50% 50%, #ffffff 0%, #dfe6ef 70%);
|
|
border: 1px solid var(--line);
|
|
touch-action: none; /* tat pan/zoom cua trinh duyet khi keo */
|
|
user-select: none;
|
|
cursor: grab;
|
|
}
|
|
.joy:active { cursor: grabbing; }
|
|
|
|
/* Hai vach chu thap de thay tam va truc */
|
|
.joy-cross::before, .joy-cross::after {
|
|
content: ''; position: absolute; background: var(--line);
|
|
}
|
|
.joy-cross::before { left: 50%; top: 8%; bottom: 8%; width: 1px; transform: translateX(-50%); }
|
|
.joy-cross::after { top: 50%; left: 8%; right: 8%; height: 1px; transform: translateY(-50%); }
|
|
|
|
.joy-knob {
|
|
position: absolute; left: 50%; top: 50%;
|
|
width: 52px; height: 52px; margin: -26px 0 0 -26px;
|
|
border-radius: 50%;
|
|
background: var(--accent);
|
|
border: 2px solid #7cc0f0;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,.45);
|
|
transition: background .12s;
|
|
}
|
|
.joy.active .joy-knob { background: var(--ok); border-color: #7fe0c2; }
|
|
.joy.estop .joy-knob { background: var(--bad); border-color: #f08a82; }
|
|
|
|
.hint-sm { color: var(--dim); font-size: 11px; text-align: center; margin-top: 6px; }
|
|
|
|
.speed-row {
|
|
display: flex; align-items: center; gap: 6px;
|
|
margin-top: 5px;
|
|
}
|
|
.speed-row .slabel { flex: 1; color: var(--dim); }
|
|
.speed-row .sval {
|
|
min-width: 42px; text-align: right;
|
|
font-variant-numeric: tabular-nums;
|
|
}
|
|
.sbtn {
|
|
flex: none; width: 26px; height: 24px; padding: 0;
|
|
font-size: 15px; line-height: 1;
|
|
}
|
|
|
|
/* ============ Khung chia doi ============ */
|
|
/* Trai = THE GIOI (tuong duong Gazebo), phai = SLAM (tuong duong RViz).
|
|
Hai canvas tuyet doi chong len .canvas-wrap; JS dat chieu rong. */
|
|
/* ⚠️ An bang CSS, KHONG bang style="display:none" tren the.
|
|
Style inline thang stylesheet, nen quy tac .split ben duoi se khong bao gio
|
|
ap duoc va khung phai ĐEN XI -- da mac loi do mot lan. */
|
|
/* ⚠️ An/hien HOAN TOAN bang class tren `.canvas-wrap`, KHONG bao gio bang
|
|
style="display:none" tren the.
|
|
Style inline thang stylesheet, nen quy tac .split se khong ap duoc va khung
|
|
phai ĐEN XI -- da mac loi do mot lan voi #mainR.
|
|
|
|
Bon to hop:
|
|
(khong gi) : #main -- 2D mot khung
|
|
.three : #main3d -- 3D mot khung
|
|
.split : #main | #mainR -- 2D | 2D
|
|
.split.three : #main3d | #mainR -- 3D (Gazebo) | 2D SLAM (RViz)
|
|
.split3d : #main3d mot minh, tu cat lam doi bang scissor
|
|
-- 3D the gioi | 3D dam may SLAM */
|
|
#mainR, #main3d { display: none; }
|
|
.canvas-wrap.three #main { display: none; }
|
|
.canvas-wrap.three #main3d { display: block; }
|
|
|
|
.canvas-wrap.split #main,
|
|
.canvas-wrap.split #main3d { width: 50%; }
|
|
.canvas-wrap.split #mainR { display: block; position: absolute;
|
|
right: 0; top: 0; width: 50%; height: 100%;
|
|
border-left: 1px solid #2a3442; }
|
|
/* Chia doi 3D|3D: KHONG co canvas thu hai. `#main3d` chiem ca be ngang va
|
|
`v3dRender()` ve hai lan vao hai nua bang scissor. Duong ke giua la CSS chu
|
|
khong phai mot border cua the, vi khong co the nao o day ma vien. */
|
|
.canvas-wrap.split3d #main { display: none; }
|
|
.canvas-wrap.split3d #mainR { display: none; }
|
|
.canvas-wrap.split3d #main3d { display: block; width: 100%; }
|
|
.canvas-wrap.split3d::after {
|
|
content: ''; position: absolute; left: 50%; top: 0; bottom: 0;
|
|
width: 1px; background: #2a3442; pointer-events: none;
|
|
}
|
|
|
|
.pane-label {
|
|
position: absolute; top: 6px;
|
|
font: 11px/1.4 ui-monospace, monospace;
|
|
color: #8fa3bf; background: rgba(18,21,26,.82);
|
|
padding: 2px 7px; border-radius: 3px; pointer-events: none;
|
|
}
|
|
#labL { left: 8px; }
|
|
#labR { left: 50%; margin-left: 8px; }
|
|
|
|
/* Thanh truot toc do. `sval` la gia tri DAT, `sreal` la toc do DO DUOC. */
|
|
.speed-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
|
|
.srange { flex: 1; min-width: 70px; accent-color: var(--accent); }
|
|
.sval { font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
|
|
.sreal {
|
|
font-variant-numeric: tabular-nums; min-width: 34px; text-align: right;
|
|
color: var(--dim); font-size: 11px;
|
|
}
|
|
.viewgrp { display: inline-flex; gap: 4px; }
|
|
.viewgrp[hidden] { display: none; }
|