Files
Re-Commander/public/index.html

276 lines
6.9 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Re-Commander — Robot Selection</title>
<link rel="stylesheet" href="style.css">
<style>
body { display: flex; flex-direction: column; }
.home-container {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}
.home-content {
background: var(--surface);
border: 2px solid var(--accent);
border-radius: 12px;
padding: 40px;
max-width: 550px;
width: 100%;
box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}
.home-title {
font-size: 32px;
font-weight: 700;
margin-bottom: 12px;
text-align: center;
letter-spacing: 0.05em;
}
.home-title span {
color: var(--accent);
}
.home-subtitle {
font-size: 14px;
color: var(--muted);
text-align: center;
margin-bottom: 32px;
}
.selection-group {
margin-bottom: 24px;
}
.selection-label {
font-size: 13px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--muted);
margin-bottom: 10px;
display: block;
}
/* Previous Connections List */
.connections-list {
display: grid;
grid-template-columns: 1fr;
gap: 8px;
max-height: 200px;
overflow-y: auto;
margin-bottom: 12px;
padding: 12px;
background: var(--surface2);
border: 1px solid var(--border);
border-radius: 6px;
}
.connection-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 12px;
background: var(--bg);
border: 1px solid var(--border);
border-radius: 5px;
cursor: pointer;
transition: all 0.2s;
font-size: 13px;
}
.connection-item:hover {
border-color: var(--accent);
background: var(--surface);
}
.connection-item.selected {
background: var(--accent);
border-color: var(--accent);
color: #000;
font-weight: 600;
}
.connection-info {
display: flex;
flex-direction: column;
gap: 2px;
flex: 1;
}
.connection-name {
font-weight: 500;
}
.connection-ip {
font-size: 11px;
color: var(--muted);
}
.connection-item.selected .connection-ip {
color: rgba(0, 0, 0, 0.6);
}
.connection-delete {
padding: 4px 8px;
background: var(--danger);
border: none;
border-radius: 3px;
color: #fff;
font-size: 11px;
cursor: pointer;
margin-left: 8px;
transition: opacity 0.2s;
}
.connection-delete:hover {
opacity: 0.8;
}
/* New Connection Input */
.new-connection {
display: flex;
gap: 8px;
margin-bottom: 12px;
}
.new-connection input {
flex: 1;
padding: 8px 10px;
background: var(--surface2);
border: 1px solid var(--border);
border-radius: 5px;
color: var(--text);
font-size: 13px;
}
.new-connection input:focus {
outline: none;
border-color: var(--accent);
}
#btn-add-connection {
padding: 8px 14px;
background: var(--accent);
border: none;
border-radius: 5px;
color: #000;
font-size: 12px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
#btn-add-connection:hover {
box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}
/* Mode Selection */
.mode-buttons-grid {
display: grid;
grid-template-columns: 1fr;
gap: 8px;
}
.mode-btn {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 16px;
background: var(--surface2);
border: 2px solid var(--border);
border-radius: 6px;
color: var(--text);
cursor: pointer;
font-size: 15px;
font-weight: 500;
transition: all 0.2s;
text-align: left;
}
.mode-btn:hover {
background: var(--accent2);
border-color: var(--accent);
transform: translateX(4px);
}
.mode-btn.active {
background: var(--accent);
border-color: var(--accent);
color: #000;
font-weight: 700;
box-shadow: 0 0 16px rgba(0, 212, 255, 0.4);
}
.mode-icon {
font-size: 24px;
flex-shrink: 0;
}
.mode-label {
flex: 1;
}
#btn-launch {
width: 100%;
padding: 12px 20px;
margin-top: 28px;
background: var(--accent);
border: none;
border-radius: 6px;
color: #000;
font-size: 15px;
font-weight: 700;
cursor: pointer;
transition: all 0.2s;
text-transform: uppercase;
letter-spacing: 0.05em;
}
#btn-launch:hover:not(:disabled) {
box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
transform: translateY(-2px);
}
#btn-launch:disabled {
opacity: 0.5;
cursor: not-allowed;
}
</style>
</head>
<body>
<header>
<div id="status-dot"></div>
<h1>Re<span>-Commander</span></h1>
<span id="status-label">Connecting…</span>
</header>
<div class="home-container">
<div class="home-content">
<div class="home-title">Re<span>-Commander</span></div>
<div class="home-subtitle">Select your robot and operating mode</div>
<!-- Robot Selection -->
<div class="selection-group">
<label class="selection-label">Previous Connections</label>
<div class="connections-list" id="connections-list">
<div style="color:var(--muted);font-size:12px;text-align:center;padding:20px 0;">No saved connections</div>
</div>
<label class="selection-label" style="margin-top:16px;">Add New Robot</label>
<div class="new-connection">
<input type="text" id="robot-ip" placeholder="192.168.1.100 or robot.local">
<button id="btn-add-connection">Add</button>
</div>
</div>
<!-- Mode Selection -->
<div class="selection-group">
<label class="selection-label"> Mode</label>
<div class="mode-buttons-grid">
<button class="mode-btn" data-mode="commander" title="Commander Mode">
<span class="mode-icon">🎮</span>
<span class="mode-label">Commander</span>
</button>
<button class="mode-btn" data-mode="animator" title="Animator Mode" style="display:none;">
<span class="mode-icon">🎬</span>
<span class="mode-label">Animator</span>
</button>
<button class="mode-btn" data-mode="telepresence" title="Telepresence Mode" style="display:none;">
<span class="mode-icon">👁</span>
<span class="mode-label">Telepresence</span>
</button>
</div>
</div>
<!-- Launch Button -->
<button id="btn-launch" disabled>▶ Launch Session</button>
</div>
</div>
<script src="home.js"></script>
</body>
</html>