mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/Re-Commander.git
synced 2026-06-16 15:16:07 +00:00
telepresence and animation menus
This commit is contained in:
@@ -3,143 +3,414 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Re-Commander — Animator Mode</title>
|
||||
<title>Re-Commander — Animator</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="stylesheet" href="https://golden-layout.com/assets/css/goldenlayout-base.css">
|
||||
<link rel="stylesheet" href="https://golden-layout.com/assets/css/goldenlayout-dark-theme.css">
|
||||
<style>
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
height: 100%;
|
||||
font-family: system-ui, -apple-system, sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
#app-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
/* ── Header ── */
|
||||
header {
|
||||
flex-shrink: 0;
|
||||
background: var(--surface);
|
||||
border-bottom: 1px solid var(--border);
|
||||
padding: 8px 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
#status-dot {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
border-radius: 50%;
|
||||
background: var(--muted);
|
||||
transition: background 0.3s;
|
||||
}
|
||||
|
||||
#status-dot.ok {
|
||||
background: var(--success);
|
||||
box-shadow: 0 0 6px var(--success);
|
||||
}
|
||||
|
||||
header h1 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
#status-label {
|
||||
font-size: 12px;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
/* ── Toolbar ── */
|
||||
.toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
padding: 8px 16px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
.toolbar-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.toolbar-group button {
|
||||
padding: 6px 12px;
|
||||
font-size: 11px;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
background: var(--surface2);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
color: var(--text);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.toolbar-group button:hover {
|
||||
background: var(--accent);
|
||||
color: #000;
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
/* Top toolbar buttons - File, Edit, Playback, etc */
|
||||
.toolbar-group:nth-child(1) button,
|
||||
.toolbar-group:nth-child(2) button,
|
||||
.toolbar-group:nth-child(3) button,
|
||||
.toolbar-group:nth-child(4) button,
|
||||
.toolbar-group:nth-child(6) button {
|
||||
padding: 10px 16px;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
border: 2px solid var(--accent);
|
||||
background: linear-gradient(135deg, var(--accent)20, var(--accent)5);
|
||||
color: var(--accent);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.toolbar-group:nth-child(1) button:hover,
|
||||
.toolbar-group:nth-child(2) button:hover,
|
||||
.toolbar-group:nth-child(3) button:hover,
|
||||
.toolbar-group:nth-child(4) button:hover,
|
||||
.toolbar-group:nth-child(6) button:hover {
|
||||
background: var(--accent);
|
||||
color: #000;
|
||||
border-color: var(--accent);
|
||||
transform: scale(1.05);
|
||||
box-shadow: 0 2px 8px rgba(255,255,0,0.3);
|
||||
}
|
||||
|
||||
.toolbar-sep {
|
||||
width: 1px;
|
||||
height: 20px;
|
||||
background: var(--border);
|
||||
margin: 0 4px;
|
||||
}
|
||||
|
||||
.toolbar-spacer {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
/* ── GoldenLayout Customization ── */
|
||||
#layout-root {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.gl_container {
|
||||
background: var(--surface) !important;
|
||||
}
|
||||
|
||||
.gl_tab {
|
||||
background: var(--surface2) !important;
|
||||
color: var(--text) !important;
|
||||
border-bottom: 2px solid var(--border) !important;
|
||||
padding: 8px 12px !important;
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
.gl_tab.gl_active {
|
||||
background: var(--accent) !important;
|
||||
color: #000 !important;
|
||||
border-bottom: 2px solid var(--accent) !important;
|
||||
}
|
||||
|
||||
.gl_tab:hover {
|
||||
background: var(--surface) !important;
|
||||
}
|
||||
|
||||
.gl_tabBar {
|
||||
background: var(--surface2) !important;
|
||||
border-bottom: 1px solid var(--border) !important;
|
||||
}
|
||||
|
||||
.gl_header {
|
||||
background: var(--surface) !important;
|
||||
border-bottom: 1px solid var(--border) !important;
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
||||
.gl_splitter {
|
||||
background: var(--border) !important;
|
||||
}
|
||||
|
||||
/* ── Panel Content ── */
|
||||
.component-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.component-content > div:first-child {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.library-item {
|
||||
padding: 8px 12px;
|
||||
margin: 4px 0;
|
||||
background: var(--surface2);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.library-item:hover {
|
||||
background: var(--accent);
|
||||
color: #000;
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.library-item.selected {
|
||||
background: var(--accent);
|
||||
color: #000;
|
||||
font-weight: 600;
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.inspector-field {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.inspector-field label {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 4px;
|
||||
color: var(--muted);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.inspector-field input,
|
||||
.inspector-field select,
|
||||
.inspector-field textarea {
|
||||
width: 100%;
|
||||
padding: 6px 8px;
|
||||
background: var(--surface2);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 3px;
|
||||
color: var(--text);
|
||||
font-size: 11px;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.inspector-field input:focus,
|
||||
.inspector-field select:focus,
|
||||
.inspector-field textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 4px rgba(255, 255, 0, 0.3);
|
||||
}
|
||||
|
||||
.inspector-field button {
|
||||
width: 100%;
|
||||
padding: 8px 12px;
|
||||
margin-top: 8px;
|
||||
background: var(--accent);
|
||||
color: #000;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.inspector-field button:hover {
|
||||
transform: scale(1.02);
|
||||
box-shadow: 0 2px 6px rgba(255,255,0,0.4);
|
||||
}
|
||||
|
||||
.canvas-placeholder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
font-size: 48px;
|
||||
color: var(--muted);
|
||||
background: #000;
|
||||
}
|
||||
|
||||
#event-log {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
font-family: monospace;
|
||||
font-size: 11px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.log-entry {
|
||||
padding: 2px 0;
|
||||
border-bottom: 1px solid var(--border);
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.log-entry .ts { color: var(--muted); }
|
||||
.log-entry .evt { color: var(--accent); }
|
||||
.log-entry .evt-error { color: var(--danger); }
|
||||
.log-entry .evt-motion { color: var(--warn); }
|
||||
.log-entry .evt-entity { color: var(--success); }
|
||||
.log-entry .evt-success { color: var(--success); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app-container">
|
||||
<!-- Header -->
|
||||
<header>
|
||||
<div id="status-dot"></div>
|
||||
<h1>Re-Commander — Animator</h1>
|
||||
<span id="status-label">Connecting…</span>
|
||||
</header>
|
||||
|
||||
<header>
|
||||
<div id="status-dot"></div>
|
||||
<h1>Re<span>-Commander</span> — Animator</h1>
|
||||
<span id="status-label">Connecting…</span>
|
||||
<span id="hotword-indicator"></span>
|
||||
<button id="btn-back-home" style="margin-left: auto; padding: 5px 12px; font-size: 12px;">← Back to Home</button>
|
||||
</header>
|
||||
|
||||
<div class="main">
|
||||
|
||||
<!-- ── LEFT PANEL ── -->
|
||||
<div class="left-panel">
|
||||
|
||||
<!-- Animation Presets -->
|
||||
<div class="section">
|
||||
<div class="section-title">Animation Library</div>
|
||||
<div class="field">
|
||||
<label>Select Animation</label>
|
||||
<select id="anim-select">
|
||||
<optgroup label="── Blinks">
|
||||
<option>Eye_Blink_01</option>
|
||||
<option>Eye_Blink_02</option>
|
||||
<option>Eye_Double_Blink_01</option>
|
||||
</optgroup>
|
||||
<optgroup label="── Expressions">
|
||||
<option>eye_happy_00</option>
|
||||
<option>eye_happy_01</option>
|
||||
<option>eye_sad_01</option>
|
||||
<option>eye_scared_00</option>
|
||||
<option>Eye_Curious_01</option>
|
||||
</optgroup>
|
||||
<optgroup label="── Poses">
|
||||
<option>Eye_Look_Center_Middle_01</option>
|
||||
<option>Eye_Look_Left_Middle_01</option>
|
||||
<option>Eye_Look_Right_Middle_01</option>
|
||||
<option>Eye_Look_Center_Up_01</option>
|
||||
<option>Eye_Look_Center_Down_01</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
<button id="btn-play-anim" style="width:100%;">▶ Play Animation</button>
|
||||
<!-- Toolbar -->
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-group">
|
||||
<button id="btn-new">📄 New</button>
|
||||
<button id="btn-open">📂 Open</button>
|
||||
<button id="btn-save">💾 Save</button>
|
||||
</div>
|
||||
|
||||
<!-- Animation Sequence -->
|
||||
<div class="section">
|
||||
<div class="section-title">Animation Sequence</div>
|
||||
<div class="field">
|
||||
<textarea id="sequence-list" rows="6" placeholder="Animation1 Animation2 Animation3" style="font-family: monospace; font-size: 12px;"></textarea>
|
||||
</div>
|
||||
<div class="controls-row">
|
||||
<button id="btn-play-sequence" style="flex:1;">▶ Play Sequence</button>
|
||||
<button id="btn-stop-sequence" class="danger" style="flex:1;">■ Stop</button>
|
||||
</div>
|
||||
<div class="toolbar-sep"></div>
|
||||
|
||||
<div class="toolbar-group">
|
||||
<button id="btn-undo">↶ Undo</button>
|
||||
<button id="btn-redo">↷ Redo</button>
|
||||
</div>
|
||||
|
||||
<!-- Timeline -->
|
||||
<div class="section">
|
||||
<div class="section-title">Timeline</div>
|
||||
<div class="row">
|
||||
<div class="toolbar-sep"></div>
|
||||
|
||||
<div class="toolbar-group">
|
||||
<button id="btn-play" style="background:var(--success);border-color:var(--success);color:#000;">▶ Play</button>
|
||||
<button id="btn-pause">⏸ Pause</button>
|
||||
<button id="btn-stop" class="danger">⏹ Stop</button>
|
||||
</div>
|
||||
|
||||
<div class="toolbar-sep"></div>
|
||||
|
||||
<div class="toolbar-group">
|
||||
<button id="btn-timeline">📊 Timeline</button>
|
||||
<button id="btn-preview">👁 Preview</button>
|
||||
</div>
|
||||
|
||||
<div class="toolbar-spacer"></div>
|
||||
|
||||
<div class="toolbar-group">
|
||||
<button id="btn-settings">⚙️ Settings</button>
|
||||
<button id="btn-back-home">← Home</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- GoldenLayout Container -->
|
||||
<div id="layout-root"></div>
|
||||
</div>
|
||||
|
||||
<!-- Library Component Template -->
|
||||
<template id="tpl-library">
|
||||
<div class="component-content">
|
||||
<div id="library-list"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Canvas Component Template -->
|
||||
<template id="tpl-canvas">
|
||||
<div class="component-content">
|
||||
<div class="canvas-placeholder">🤖</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Inspector Component Template -->
|
||||
<template id="tpl-inspector">
|
||||
<div class="component-content">
|
||||
<div>
|
||||
<div class="inspector-field">
|
||||
<label>Animation Name</label>
|
||||
<input type="text" placeholder="Select animation...">
|
||||
</div>
|
||||
<div class="inspector-field">
|
||||
<label>Duration (ms)</label>
|
||||
<input type="number" value="500" min="0">
|
||||
</div>
|
||||
<div class="inspector-field">
|
||||
<label>Repeat Count</label>
|
||||
<input type="number" id="repeat-count" value="1" min="1">
|
||||
<input type="number" value="1" min="1">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="inspector-field">
|
||||
<label>Delay (ms)</label>
|
||||
<input type="number" id="anim-delay" value="500" min="0" step="100">
|
||||
<input type="number" value="0" min="0" step="100">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- /left-panel -->
|
||||
|
||||
<!-- ── CENTER PANEL ── -->
|
||||
<div class="center-panel">
|
||||
|
||||
<!-- Camera feed -->
|
||||
<div id="camera-wrap">
|
||||
<img id="camera-feed" alt="Jibo camera" style="display:none;">
|
||||
<div id="camera-no-feed">
|
||||
<div style="font-size:40px;">📹</div>
|
||||
<div>Animation Preview</div>
|
||||
<div style="font-size:11px;color:var(--muted);">Start video to see animations being played</div>
|
||||
</div>
|
||||
<div id="click-dot"></div>
|
||||
</div>
|
||||
|
||||
<!-- Playback Controls -->
|
||||
<div class="controls-row" style="justify-content:center; gap:10px; margin-top:20px;">
|
||||
<button id="btn-video-start" style="flex-basis: auto;">▶ Start Video</button>
|
||||
<button id="btn-video-stop" class="danger" style="flex-basis: auto;">■ Stop</button>
|
||||
</div>
|
||||
|
||||
</div><!-- /center-panel -->
|
||||
|
||||
<!-- ── RIGHT PANEL ── -->
|
||||
<div class="right-panel">
|
||||
<div class="tabs">
|
||||
<button class="tab-btn active" data-tab="tab-camera">Camera</button>
|
||||
<button class="tab-btn" data-tab="tab-log">Log</button>
|
||||
</div>
|
||||
|
||||
<!-- Camera tab -->
|
||||
<div class="tab-panel active" id="tab-camera">
|
||||
<div class="section-title">Video Stream</div>
|
||||
<div class="row">
|
||||
<label>Resolution</label>
|
||||
<select id="photo-res">
|
||||
<option value="highRes">HighRes</option>
|
||||
<option value="medRes">MedRes</option>
|
||||
<option value="lowRes">LowRes</option>
|
||||
<div class="inspector-field">
|
||||
<label>Easing</label>
|
||||
<select>
|
||||
<option>Linear</option>
|
||||
<option>Ease In</option>
|
||||
<option>Ease Out</option>
|
||||
<option>Ease In Out</option>
|
||||
</select>
|
||||
</div>
|
||||
<button id="btn-photo" style="width:100%;margin-bottom:10px;">📷 Take Photo</button>
|
||||
<div id="photo-strip"></div>
|
||||
</div>
|
||||
|
||||
<!-- Log tab -->
|
||||
<div class="tab-panel" id="tab-log" style="padding:0;display:flex;flex-direction:column;flex:1;">
|
||||
<div style="display:flex;justify-content:space-between;align-items:center;padding:8px 10px;border-bottom:1px solid var(--border);">
|
||||
<span class="section-title" style="margin:0;">Animation Log</span>
|
||||
<button id="btn-clear-log" style="font-size:11px;padding:3px 8px;">Clear</button>
|
||||
<div class="inspector-field">
|
||||
<button>✨ Apply Animation</button>
|
||||
</div>
|
||||
<div id="event-log"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</div><!-- /right-panel -->
|
||||
</div>
|
||||
<!-- Log Component Template -->
|
||||
<template id="tpl-log">
|
||||
<div class="component-content">
|
||||
<div id="event-log"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Photo modal -->
|
||||
<div id="photo-modal">
|
||||
<div id="photo-modal-close">✕</div>
|
||||
<img id="photo-modal-img" src="" alt="Photo">
|
||||
</div>
|
||||
|
||||
<script src="animator.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/golden-layout@2/dist/umd/index.js" defer></script>
|
||||
<script src="animator.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user