Spaces:
Running

audio / frontend /index.html
michdubai's picture
Update frontend/index.html
7a3bd13 verified
Raw History Blame Contribute Delete
8.81 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Gemini Live Studio</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, user-scalable=yes">
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="/static/css/styles.css">
<link rel="manifest" href="/static/manifest.json">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Gemini Live">
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🔮</text></svg>">
</head>
<body>
<div class="app-layout">
<aside class="sidebar" id="sidebar">
<div class="sidebar-header">
<div class="logo-group">
<div class="logo pulse">G</div>
<h2>Control Center</h2>
</div>
<button id="toggleSidebarMobile" class="btn-icon sidebar-close" title="Close panel">✕</button>
</div>
<div class="sidebar-content">
<div class="form-group">
<label for="systemPrompt" class="form-label">System Prompt</label>
<textarea id="systemPrompt" class="form-control" rows="3" placeholder="Enter system instructions for Gemini...">You are a friendly AI Assistant.</textarea>
</div>
<div class="form-group">
<label for="modelSelect" class="form-label">Model</label>
<select id="modelSelect" class="form-control">
<option value="models/gemini-2.5-flash-native-audio-latest" selected>Gemini 2.5 Flash Native Audio</option>
<option value="models/gemini-3.1-flash-live-preview">Gemini 3.1 Flash Live Preview</option>
<option value="models/gemini-2.5-pro-exp-03-25">Gemini 2.5 Pro</option>
</select>
</div>
<div class="form-group">
<label for="voice" class="form-label">Voice</label>
<select id="voice" class="form-control">
<option value="Puck">Puck</option>
<option value="Charon">Charon</option>
<option value="Kore">Kore</option>
<option value="Fenrir">Fenrir</option>
<option value="Aoede">Aoede</option>
</select>
</div>
<div class="switch-container">
<label class="switch-wrapper">
<input type="checkbox" id="enableGoogleSearch" checked>
<span class="switch-slider"></span>
<span class="switch-label">Tool Usage (Search)</span>
</label>
<label class="switch-wrapper">
<input type="checkbox" id="allowInterruptions">
<span class="switch-slider"></span>
<span class="switch-label">Allow Interruptions</span>
</label>
</div>
<div class="advanced-panel">
<button id="toggleAdvanced" class="btn btn-subtle btn-block">
<span>⚙️ Advanced Settings</span>
<span id="advancedChevron" class="chevron">▼</span>
</button>
<div id="advancedContent" class="advanced-content hidden">
<div class="form-group">
<label class="form-label">Response Modalities</label>
<div class="checkbox-group">
<label><input type="checkbox" id="modalityAudio" checked> Audio</label>
<!-- <label><input type="checkbox" id="modalityText"> Text</label> -->
</div>
</div>
<div class="form-group">
<label for="toolExecutionMode" class="form-label">Tool Execution</label>
<select id="toolExecutionMode" class="form-control">
<option value="blocking">Blocking (wait for result)</option>
<option value="nonblocking">Non-blocking (async)</option>
</select>
</div>
<div class="form-group">
<label class="form-label">Function Tools (JSON Schema)</label>
<textarea id="toolsJson" class="form-control mono" rows="4" placeholder='[{"name":"get_weather","description":"...","parameters":{...}}]'></textarea>
</div>
</div>
</div>
<div class="indicators">
<label class="form-label">Live Indicators</label>
<div class="indicator-row">
<div class="indicator" id="connIndicator" title="Connection">
<span class="indicator-dot"></span>
<span class="indicator-label">WS</span>
</div>
<div class="indicator" id="micIndicator" title="Microphone">
<span class="indicator-dot"></span>
<span class="indicator-label">MIC</span>
</div>
<div class="indicator" id="audioOutIndicator" title="Audio Output">
<span class="indicator-dot"></span>
<span class="indicator-label">OUT</span>
</div>
<div class="indicator" id="videoIndicator" title="Video Stream">
<span class="indicator-dot"></span>
<span class="indicator-label">VID</span>
</div>
</div>
</div>
</div>
<div class="sidebar-footer">
<button id="themeToggle" class="btn-theme" title="Toggle theme">🌙</button>
</div>
</aside>
<main class="chat-container">
<header class="chat-header">
<button id="toggleSidebar" class="btn-icon" title="Toggle Configuration Dashboard">☰</button>
<div class="session-info">
<span class="status-badge disconnected" id="statusBadge">Disconnected</span>
</div>
<div class="header-actions">
<button id="switchCameraBtn" class="btn btn-subtle" style="display: none;" title="Switch camera">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16">
<path d="M23 4v6h-6"/>
<path d="M1 20v-6h6"/>
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10"/>
<path d="M20.49 15a9 9 0 0 1-14.85 3.36L1 14"/>
</svg>
Switch Camera
</button>
</div>
</header>
<section class="chat-messages" id="messages">
<div class="system-welcome">
<h3>Gemini Multimodal Real-Time Interface</h3>
<p>Activate your microphone or push string payloads down the active WebSocket pipe to interact with Gemini.</p>
</div>
</section>
<div id="videoContainer" class="floating-video-panel hidden">
<div class="video-wrapper">
<video id="videoElem" autoplay playsinline muted width="320" height="240"></video>
<canvas id="canvasElem" class="hidden" width="320" height="240"></canvas>
</div>
</div>
<footer class="chat-input-bar">
<div class="input-wrapper">
<button id="startAudioBtn" class="btn-mic" title="Start Audio Chat">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="24" height="24">
<path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z"/>
<path d="M19 10v2a7 7 0 0 1-14 0v-2"/>
<line x1="12" y1="19" x2="12" y2="22"/>
<line x1="8" y1="22" x2="16" y2="22"/>
</svg>
</button>
<textarea id="textInput" rows="1" placeholder="Send input text"></textarea>
<div class="input-actions">
<button id="btnMore" class="btn-more" title="More options">+</button>
<button id="sendTextBtn" class="btn-send" title="Transmit Text Packet">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="22" y1="2" x2="11" y2="13"></line>
<polygon points="22 2 15 22 11 13 2 9 22 2"></polygon>
</svg>
</button>
</div>
</div>
<div id="morePanel" class="more-panel hidden">
<button id="btnAttach" class="btn btn-secondary">📎 Files</button>
<button id="startCameraBtn" class="btn btn-secondary">📷 Video</button>
<button id="startScreenBtn" class="btn btn-secondary">🖥️ Screen</button>
<button id="stopButton" class="btn btn-danger" disabled>⏹ Stop</button>
</div>
<div id="fileUploadStatus" class="file-status input-status hidden"></div>
<input type="file" id="fileInput" class="hidden" accept=".pdf,.txt,.md,.html,.mp3,.wav,.ogg,.flac,.mp4,.webm,.mov,.jpeg,.jpg,.png,.webp,.gif">
</footer>
</main>
</div>
<div id="toastContainer" class="toast-container"></div>
<script type="module" src="/static/js/main.js?v=3"></script>
</body>
</html>