import {css, html, LitElement} from 'lit'; import {customElement} from 'lit/decorators/custom-element.js'; import {property} from 'lit/decorators/property.js'; import {state} from 'lit/decorators/state.js'; import * as xb from 'xrblocks'; @customElement('xrblocks-simulator-settings') export class SimulatorSettingsPanel extends LitElement implements xb.ISimulatorSettingsPanelElement { static styles = css` :host { position: fixed; bottom: 0; left: 0; z-index: 10000; font-family: system-ui, -apple-system, sans-serif; } .settings-btn { border: none; margin: 1rem; width: 3rem; height: 3rem; border-radius: 5rem; background: rgba(0, 0, 0, 0.5); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.2s ease; } .settings-btn:hover { background: rgba(0, 0, 0, 0.7); } .settings-btn svg { width: 1.5rem; height: 1.5rem; fill: currentColor; transition: transform 0.3s ease; } .settings-btn.open svg { transform: rotate(45deg); } .panel { position: absolute; bottom: 4.5rem; left: 1rem; background: rgba(0, 0, 0, 0.7); border: none; border-radius: 1.5rem; padding: 1.5rem; min-width: 16rem; color: #fff; opacity: 0; pointer-events: none; transform: translateY(10px); transition: all 0.3s ease; backdrop-filter: blur(8px); } .panel.open { opacity: 1; pointer-events: auto; transform: translateY(0); } h3 { margin: 0 0 1rem; font-size: 1.1rem; font-weight: 500; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 0.5rem; } .form-group { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.4rem; } .form-group:last-of-type { margin-bottom: 0; } label { font-size: 0.85rem; color: #ccc; } select { appearance: none; -webkit-appearance: none; background: rgba(0, 0, 0, 0.5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 0.5rem center; background-size: 1rem; border: none; color: #fff; padding: 0.5rem 2.2rem 0.5rem 1.2rem; border-radius: 5rem; font-size: 0.9rem; outline: none; cursor: pointer; } select:hover, select:focus { background-color: rgba(0, 0, 0, 0.8); } option { background: #222; color: #fff; } `; @property({type: Array}) environments: xb.SimulatorEnvironment[] = []; @property({type: Number}) activeEnvironmentIndex = 0; @property({type: String}) simulatorMode = xb.SimulatorMode.USER; @state() private _isOpen = false; private _togglePanel() { this._isOpen = !this._isOpen; } private _onEnvironmentChange(e: Event) { const select = e.target as HTMLSelectElement; const idx = parseInt(select.value, 10); this.activeEnvironmentIndex = idx; this.dispatchEvent(new xb.SetSimulatorEnvironmentEvent(idx)); } private _onModeChange(e: Event) { const select = e.target as HTMLSelectElement; const newMode = select.value as xb.SimulatorMode; this.simulatorMode = newMode; this.dispatchEvent(new xb.SetSimulatorModeEvent(newMode)); } render() { const modes = [ {label: 'User', value: xb.SimulatorMode.USER}, {label: 'Navigation', value: xb.SimulatorMode.POSE}, {label: 'Hands', value: xb.SimulatorMode.CONTROLLER}, ]; return html`

Simulator Settings

`; } }