330 lines
7.5 KiB
HTML
330 lines
7.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Kokoro Widget</title>
|
|
<style>
|
|
:root {
|
|
--bg-primary: #0d1220;
|
|
--bg-secondary: #141c2c;
|
|
--bg-tertiary: #1c2638;
|
|
--text-primary: #f0f2f5;
|
|
--text-secondary: #c0c8d4;
|
|
--text-muted: #8a919d;
|
|
--cyan: #12c2e9;
|
|
--purple: #c471ed;
|
|
--pink: #ff6b9d;
|
|
--teal: #2dd4bf;
|
|
--orange: #F39C12;
|
|
--border: rgba(255, 255, 255, 0.08);
|
|
}
|
|
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
|
|
body {
|
|
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
background: var(--bg-primary);
|
|
color: var(--text-primary);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 1rem;
|
|
-webkit-app-region: no-drag;
|
|
user-select: none;
|
|
}
|
|
|
|
/* Make window draggable by the panel header area */
|
|
.voice-panel {
|
|
background: var(--bg-secondary);
|
|
border: 1px solid var(--border);
|
|
border-radius: 16px;
|
|
padding: 1.5rem 2rem;
|
|
width: 300px;
|
|
text-align: center;
|
|
}
|
|
|
|
.panel-header {
|
|
-webkit-app-region: drag;
|
|
cursor: move;
|
|
margin-bottom: 0.25rem;
|
|
}
|
|
|
|
.voice-panel h1 {
|
|
font-size: 1.2rem;
|
|
font-weight: 700;
|
|
color: var(--cyan);
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.voice-panel .subtitle {
|
|
font-size: 0.75rem;
|
|
color: var(--text-muted);
|
|
margin-bottom: 1.25rem;
|
|
}
|
|
|
|
/* Status indicator */
|
|
.status {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 0.5rem;
|
|
margin-bottom: 1rem;
|
|
font-size: 0.85rem;
|
|
}
|
|
|
|
.status-dot {
|
|
width: 10px;
|
|
height: 10px;
|
|
border-radius: 50%;
|
|
background: var(--text-muted);
|
|
transition: background 0.3s, box-shadow 0.3s;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.status-dot.connected {
|
|
background: var(--teal);
|
|
box-shadow: 0 0 8px rgba(45, 212, 191, 0.4);
|
|
}
|
|
|
|
.status-dot.connecting {
|
|
background: var(--orange);
|
|
animation: pulse 1.5s infinite;
|
|
}
|
|
|
|
.status-dot.error {
|
|
background: var(--pink);
|
|
}
|
|
|
|
.status-text {
|
|
color: var(--text-secondary);
|
|
font-size: 0.85rem;
|
|
}
|
|
|
|
@keyframes pulse {
|
|
0%, 100% { opacity: 1; }
|
|
50% { opacity: 0.4; }
|
|
}
|
|
|
|
/* Speaking indicator */
|
|
.speaking-indicator {
|
|
height: 36px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 4px;
|
|
margin-bottom: 0.75rem;
|
|
opacity: 0;
|
|
transition: opacity 0.3s;
|
|
}
|
|
|
|
.speaking-indicator.active {
|
|
opacity: 1;
|
|
}
|
|
|
|
.speaking-bar {
|
|
width: 4px;
|
|
height: 8px;
|
|
background: var(--cyan);
|
|
border-radius: 2px;
|
|
}
|
|
|
|
.speaking-indicator.active .speaking-bar {
|
|
animation: bars 0.8s ease-in-out infinite;
|
|
}
|
|
|
|
.speaking-bar:nth-child(1) { animation-delay: 0s; }
|
|
.speaking-bar:nth-child(2) { animation-delay: 0.1s; }
|
|
.speaking-bar:nth-child(3) { animation-delay: 0.2s; }
|
|
.speaking-bar:nth-child(4) { animation-delay: 0.3s; }
|
|
.speaking-bar:nth-child(5) { animation-delay: 0.2s; }
|
|
.speaking-bar:nth-child(6) { animation-delay: 0.1s; }
|
|
.speaking-bar:nth-child(7) { animation-delay: 0s; }
|
|
|
|
@keyframes bars {
|
|
0%, 100% { height: 8px; }
|
|
50% { height: 26px; }
|
|
}
|
|
|
|
/* Last message */
|
|
.last-message {
|
|
font-size: 0.78rem;
|
|
color: var(--text-muted);
|
|
min-height: 1.4em;
|
|
margin-bottom: 1rem;
|
|
font-style: italic;
|
|
line-height: 1.4;
|
|
word-break: break-word;
|
|
}
|
|
|
|
/* Divider */
|
|
.divider {
|
|
border: none;
|
|
border-top: 1px solid var(--border);
|
|
margin: 0 0 1rem 0;
|
|
}
|
|
|
|
/* Volume row */
|
|
.volume-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.volume-row label {
|
|
font-size: 0.7rem;
|
|
color: var(--text-muted);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
white-space: nowrap;
|
|
min-width: 3rem;
|
|
text-align: left;
|
|
}
|
|
|
|
.volume-row input[type="range"] {
|
|
flex: 1;
|
|
accent-color: var(--cyan);
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* Settings section */
|
|
.settings-section {
|
|
border-top: 1px solid var(--border);
|
|
padding-top: 1rem;
|
|
text-align: left;
|
|
}
|
|
|
|
.settings-section h3 {
|
|
font-size: 0.65rem;
|
|
color: var(--text-muted);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.08em;
|
|
margin-bottom: 0.75rem;
|
|
}
|
|
|
|
.settings-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.settings-row label {
|
|
font-size: 0.75rem;
|
|
color: var(--text-secondary);
|
|
min-width: 2.5rem;
|
|
text-align: right;
|
|
}
|
|
|
|
.settings-row input {
|
|
flex: 1;
|
|
background: var(--bg-tertiary);
|
|
border: 1px solid var(--border);
|
|
border-radius: 6px;
|
|
padding: 0.35rem 0.5rem;
|
|
color: var(--text-primary);
|
|
font-size: 0.8rem;
|
|
font-family: inherit;
|
|
outline: none;
|
|
transition: border-color 0.2s;
|
|
}
|
|
|
|
.settings-row input:focus {
|
|
border-color: rgba(18, 194, 233, 0.5);
|
|
}
|
|
|
|
.settings-row input[type="number"]::-webkit-outer-spin-button,
|
|
.settings-row input[type="number"]::-webkit-inner-spin-button {
|
|
-webkit-appearance: none;
|
|
margin: 0;
|
|
}
|
|
|
|
.save-row {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
margin-top: 0.75rem;
|
|
}
|
|
|
|
#saveBtn {
|
|
background: var(--cyan);
|
|
color: #0d1220;
|
|
border: none;
|
|
border-radius: 6px;
|
|
padding: 0.4rem 1.1rem;
|
|
font-size: 0.8rem;
|
|
font-weight: 600;
|
|
font-family: inherit;
|
|
cursor: pointer;
|
|
transition: opacity 0.2s;
|
|
}
|
|
|
|
#saveBtn:hover {
|
|
opacity: 0.85;
|
|
}
|
|
|
|
#saveBtn:active {
|
|
opacity: 0.7;
|
|
}
|
|
|
|
#saveBtn.saved {
|
|
background: var(--teal);
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="voice-panel">
|
|
<div class="panel-header">
|
|
<h1>PAI Voice</h1>
|
|
<p class="subtitle">Voice notifications from your AI assistant</p>
|
|
</div>
|
|
|
|
<div class="status">
|
|
<span class="status-dot connecting" id="statusDot"></span>
|
|
<span class="status-text" id="statusText">Connecting...</span>
|
|
</div>
|
|
|
|
<div class="speaking-indicator" id="speakingIndicator">
|
|
<div class="speaking-bar"></div>
|
|
<div class="speaking-bar"></div>
|
|
<div class="speaking-bar"></div>
|
|
<div class="speaking-bar"></div>
|
|
<div class="speaking-bar"></div>
|
|
<div class="speaking-bar"></div>
|
|
<div class="speaking-bar"></div>
|
|
</div>
|
|
|
|
<div class="last-message" id="lastMessage">Waiting for notifications...</div>
|
|
|
|
<hr class="divider">
|
|
|
|
<div class="volume-row">
|
|
<label for="volume">Volume</label>
|
|
<input type="range" id="volume" min="0" max="100" value="80">
|
|
</div>
|
|
|
|
<div class="settings-section">
|
|
<h3>Settings</h3>
|
|
|
|
<div class="settings-row">
|
|
<label for="hostInput">Host</label>
|
|
<input type="text" id="hostInput" placeholder="localhost" value="localhost">
|
|
</div>
|
|
|
|
<div class="settings-row">
|
|
<label for="portInput">Port</label>
|
|
<input type="number" id="portInput" placeholder="8888" value="8888" min="1" max="65535">
|
|
</div>
|
|
|
|
<div class="save-row">
|
|
<button id="saveBtn">Save</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="renderer.js"></script>
|
|
</body>
|
|
</html>
|