xlerobot-sim / src /style.css
VectorW's picture
Update the web simulation
8ff66cf verified
Raw History Blame Contribute Delete
10.9 kB
:root {
--bg: #f5f5f7;
--panel: #ffffff;
--text: #1d1d1f;
--muted: #6e6e73;
--line: rgba(0, 0, 0, 0.1);
--accent: #0071e3;
--ok: #1a7f37;
--error: #b42318;
--radius: 12px;
color-scheme: light;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
/* Dark with the system, unless the page asks for a theme (index.html: ?theme=, or a message from the
page that embeds this one). */
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--bg: #111113;
--panel: #1c1c1e;
--text: #f5f5f7;
--muted: #a1a1a6;
--line: rgba(255, 255, 255, 0.12);
--accent: #2997ff;
--ok: #3fb950;
--error: #ff7b72;
color-scheme: dark;
}
}
:root[data-theme="dark"] {
--bg: #111113;
--panel: #1c1c1e;
--text: #f5f5f7;
--muted: #a1a1a6;
--line: rgba(255, 255, 255, 0.12);
--accent: #2997ff;
--ok: #3fb950;
--error: #ff7b72;
color-scheme: dark;
}
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
height: 100%;
background: var(--bg);
color: var(--text);
}
.app {
display: grid;
grid-template-columns: 1fr 320px;
height: 100vh;
}
.stage {
position: relative;
min-height: 0;
}
#view {
display: block;
width: 100%;
height: 100%;
outline: none;
}
.brand {
position: absolute;
top: 12px;
left: 12px;
padding: 6px 12px 7px;
border-radius: 12px;
background: color-mix(in srgb, var(--panel) 72%, transparent);
backdrop-filter: blur(8px);
pointer-events: none;
}
.brand h1 {
margin: 0;
font-size: 22px;
letter-spacing: -0.01em;
}
.brand p {
margin: 2px 0 0;
font-size: 13px;
color: var(--muted);
}
.view-labels span {
position: absolute;
padding: 2px 8px;
border-radius: 6px;
background: rgba(0, 0, 0, 0.55);
color: #fff;
font-size: 12px;
pointer-events: none;
}
.loading {
position: absolute;
inset: 0;
display: grid;
place-items: center;
background: var(--bg);
}
.loading[hidden] {
display: none;
}
.loading-card {
width: min(360px, 80vw);
text-align: center;
color: var(--muted);
}
.loading.failed .loading-card {
color: var(--error);
}
.progress {
height: 6px;
border-radius: 3px;
background: var(--line);
overflow: hidden;
}
.progress div {
width: 0;
height: 100%;
background: var(--accent);
transition: width 0.2s;
}
.panel {
overflow-y: auto;
padding: 16px 18px 24px;
background: var(--panel);
border-left: 1px solid var(--line);
font-size: 14px;
}
.panel section,
.panel details {
padding: 12px 0;
border-bottom: 1px solid var(--line);
}
.panel h2 {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 0 10px;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--muted);
}
.segmented {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 2px;
padding: 2px;
border-radius: 9px;
background: var(--bg);
}
.segmented button {
padding: 6px 0;
border: 0;
border-radius: 7px;
background: transparent;
color: var(--text);
font: inherit;
cursor: pointer;
}
.segmented button[aria-pressed="true"] {
background: var(--panel);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
font-weight: 600;
}
.segmented button:disabled {
color: var(--muted);
cursor: default;
}
.chips {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.chips label {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 4px 10px;
border: 1px solid var(--line);
border-radius: 999px;
cursor: pointer;
}
.task p {
margin: 0 0 8px;
}
.meter {
height: 8px;
border-radius: 4px;
background: var(--bg);
overflow: hidden;
}
.meter div {
width: 0;
height: 100%;
background: var(--accent);
}
.task.done .meter div {
background: var(--ok);
}
.lift {
margin-top: 8px !important;
color: var(--muted);
}
.badge {
display: none;
margin-left: 6px;
padding: 1px 8px;
border-radius: 999px;
background: var(--ok);
color: #fff;
font-size: 12px;
}
.task.done .badge {
display: inline-block;
}
.buttons {
display: flex;
gap: 8px;
}
.buttons button {
flex: 1;
padding: 8px 0;
border: 1px solid var(--line);
border-radius: 999px;
background: var(--panel);
color: var(--text);
font: inherit;
cursor: pointer;
}
.buttons .primary {
border-color: var(--accent);
background: var(--accent);
color: #fff;
}
.buttons button:disabled {
opacity: 0.5;
cursor: default;
}
.active-arm {
padding: 1px 8px;
border-radius: 999px;
background: var(--bg);
color: var(--text);
text-transform: none;
letter-spacing: 0;
}
.keys {
display: grid;
grid-template-columns: auto 1fr;
gap: 4px 12px;
margin: 0;
}
.keys dt {
white-space: nowrap;
}
.keys dd {
margin: 0;
color: var(--muted);
}
kbd {
padding: 1px 6px;
border: 1px solid var(--line);
border-bottom-width: 2px;
border-radius: 5px;
font: 12px ui-monospace, SFMono-Regular, Consolas, monospace;
}
summary {
cursor: pointer;
font-weight: 600;
}
.note {
color: var(--muted);
font-size: 12px;
}
.note.error {
color: var(--error);
}
.state {
width: 100%;
border-collapse: collapse;
font: 12px ui-monospace, SFMono-Regular, Consolas, monospace;
}
.state th {
padding: 2px 0;
font-weight: normal;
text-align: left;
color: var(--muted);
}
.state td {
text-align: right;
}
footer p {
margin: 14px 0 0;
color: var(--muted);
font-size: 12px;
}
a {
color: var(--accent);
}
@media (max-width: 760px) {
.app {
grid-template-columns: 1fr;
grid-template-rows: 60vh auto;
height: auto;
}
.stage {
height: 60vh;
}
.panel {
border-left: 0;
border-top: 1px solid var(--line);
}
}
/* v0.2: tabs, selects, skills, agent chat */
.tabs {
position: sticky;
top: -16px;
z-index: 2;
display: grid;
grid-template-columns: repeat(4, auto);
gap: 2px;
margin: -16px -18px 4px;
padding: 10px 12px;
background: var(--panel);
border-bottom: 1px solid var(--line);
}
.tabs button {
padding: 7px 8px;
white-space: nowrap;
border: 0;
border-radius: 8px;
background: transparent;
color: var(--muted);
font: inherit;
font-weight: 600;
cursor: pointer;
}
.tabs button[aria-selected="true"] {
background: var(--bg);
color: var(--text);
}
.tab[hidden] {
display: none;
}
select,
input[type="text"],
input:not([type]),
input[type="password"],
textarea {
width: 100%;
padding: 7px 9px;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--bg);
color: var(--text);
font: inherit;
}
textarea {
resize: vertical;
}
.row {
display: flex;
gap: 8px;
align-items: center;
}
.row select {
flex: 1;
}
.row button,
.connect button,
.link {
padding: 7px 12px;
border: 1px solid var(--line);
border-radius: 999px;
background: var(--panel);
color: var(--text);
font: inherit;
cursor: pointer;
white-space: nowrap;
}
.buttons.wrap {
flex-wrap: wrap;
margin-top: 10px;
}
.buttons.wrap button {
flex: 1 1 30%;
}
.status {
margin: 10px 0 0;
min-height: 1.4em;
color: var(--muted);
font-size: 13px;
}
.activity {
position: absolute;
top: 18px;
right: 18px;
padding: 6px 12px;
border-radius: 999px;
background: rgba(0, 0, 0, 0.6);
color: #fff;
font-size: 13px;
pointer-events: none;
}
.activity[hidden] {
display: none;
}
.hint {
position: absolute;
right: 18px;
bottom: 12px;
margin: 0;
color: var(--muted);
font-size: 12px;
pointer-events: none;
}
.sliders label {
display: grid;
gap: 2px;
margin-bottom: 8px;
font-size: 12px;
color: var(--muted);
}
.sliders input {
width: 100%;
}
.connect .hf {
width: 100%;
padding: 9px 12px;
border: 0;
background: #ffd21e;
color: #1d1d1f;
font-weight: 600;
}
.connect label {
display: grid;
gap: 4px;
margin-top: 10px;
font-size: 12px;
color: var(--muted);
}
.connect label.check {
display: flex;
align-items: center;
gap: 8px;
}
.connect label.check input {
width: auto;
}
.connect details {
margin-top: 10px;
padding: 0;
border: 0;
}
[data-provider][hidden] {
display: none; /* the provider's own fields only (.connect label would show them) */
}
#perception-status {
margin-top: 8px;
}
.bridge-row {
justify-content: space-between;
margin-top: 8px;
}
.bridge-row .status {
margin: 0;
}
#bridge-status.on {
color: var(--accent);
}
.msg.tool .who {
margin-right: 2px;
color: var(--accent);
}
.link {
padding: 0;
border: 0;
color: var(--accent);
background: none;
}
.chat-log {
display: flex;
flex-direction: column;
gap: 8px;
max-height: 46vh;
min-height: 120px;
overflow-y: auto;
margin-bottom: 10px;
}
.msg {
padding: 8px 10px;
border-radius: 10px;
line-height: 1.4;
overflow-wrap: anywhere;
}
.msg.user {
align-self: flex-end;
max-width: 85%;
background: var(--accent);
color: #fff;
}
.msg.assistant {
background: var(--bg);
}
.msg.tool {
padding: 4px 8px;
border: 1px solid var(--line);
font: 12px ui-monospace, SFMono-Regular, Consolas, monospace;
color: var(--muted);
}
.msg.tool .tool-name {
color: var(--text);
font-weight: 600;
}
.msg.tool.failed .tool-result {
color: #c0392b;
}
.msg.tool img {
display: block;
width: 100%;
border-radius: 6px;
}
.msg.error {
color: #c0392b;
font-size: 13px;
}
.examples {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-bottom: 10px;
}
.examples[hidden] {
display: none;
}
.examples button {
padding: 5px 10px;
border: 1px solid var(--line);
border-radius: 999px;
background: var(--panel);
color: var(--text);
font: inherit;
font-size: 12px;
cursor: pointer;
}
.chat-form .buttons {
margin-top: 8px;
}
code {
font: 12px ui-monospace, SFMono-Regular, Consolas, monospace;
}
@media (max-width: 760px) {
.tabs {
top: 0;
margin-top: -16px;
}
.hint {
display: none;
}
}
/* Tasks tab */
.task-instruction {
margin: 10px 0;
line-height: 1.45;
}
.instance {
display: flex;
flex: 1;
gap: 8px;
align-items: center;
color: var(--muted);
}
.instance input {
width: 4.5em;
padding: 6px 8px;
border: 1px solid var(--line);
border-radius: 8px;
background: var(--panel);
color: var(--text);
font: inherit;
}
.goals {
margin: 0;
padding: 0;
list-style: none;
}
.goals li {
display: flex;
gap: 8px;
padding: 3px 0;
line-height: 1.35;
}
.goals li::before {
content: "○";
flex: none;
width: 1em;
color: var(--muted);
}
.goals li.done::before {
content: "✓";
color: var(--ok);
font-weight: 700;
}
.score {
font-weight: 600;
letter-spacing: 0;
text-transform: none;
color: var(--text);
}
.score.success {
color: var(--ok);
}
.bddl {
max-height: 260px;
margin: 8px 0 0;
padding: 10px;
overflow: auto;
border-radius: 8px;
background: var(--bg);
font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
white-space: pre;
}