Files
engine-v5-pipecat-core/examples/webpage/styles.css
2026-05-21 13:08:40 +08:00

517 lines
8.8 KiB
CSS

:root {
color-scheme: dark;
--bg: #0b0d12;
--bg-elevated: #131722;
--bg-soft: #1a2030;
--border: #232a3b;
--text: #e6e9f2;
--text-dim: #95a0bb;
--accent: #4f8cff;
--accent-strong: #6aa1ff;
--user: #2f7ff0;
--assistant: #2a3145;
--danger: #ff5577;
--success: #2dd28b;
--warning: #ffb84d;
--radius: 14px;
--shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
"Helvetica Neue", Arial, sans-serif;
}
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
height: 100%;
background: radial-gradient(
1200px 600px at 80% -10%,
rgba(79, 140, 255, 0.18),
transparent 60%
),
radial-gradient(
900px 500px at -10% 110%,
rgba(45, 210, 139, 0.12),
transparent 60%
),
var(--bg);
color: var(--text);
}
body {
display: flex;
justify-content: center;
padding: 24px;
}
.app {
display: grid;
grid-template-rows: auto 1fr auto;
gap: 16px;
width: min(880px, 100%);
height: calc(100vh - 48px);
background: var(--bg-elevated);
border: 1px solid var(--border);
border-radius: 20px;
box-shadow: var(--shadow);
padding: 18px;
}
/* Header ---------------------------------------------------------------- */
.app__header {
display: grid;
grid-template-columns: auto 1fr auto;
align-items: center;
gap: 16px;
padding-bottom: 14px;
border-bottom: 1px solid var(--border);
}
.brand {
display: flex;
align-items: center;
gap: 10px;
}
.brand h1 {
font-size: 16px;
margin: 0;
letter-spacing: 0.2px;
}
.brand__dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: var(--accent);
box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.18);
}
.connection {
display: flex;
align-items: end;
gap: 8px;
min-width: 0;
}
.connection__field {
display: flex;
flex-direction: column;
gap: 4px;
min-width: 0;
flex: 1;
}
.connection__field span {
font-size: 11px;
color: var(--text-dim);
text-transform: uppercase;
letter-spacing: 0.8px;
}
.connection__field input {
background: var(--bg-soft);
color: var(--text);
border: 1px solid var(--border);
border-radius: 10px;
padding: 8px 10px;
font: inherit;
font-size: 13px;
outline: none;
min-width: 240px;
}
.connection__field input:focus {
border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}
.status {
display: flex;
align-items: center;
gap: 8px;
font-size: 13px;
color: var(--text-dim);
white-space: nowrap;
}
.status__dot {
width: 9px;
height: 9px;
border-radius: 50%;
background: var(--text-dim);
}
.status__dot--idle {
background: var(--text-dim);
}
.status__dot--connecting {
background: var(--warning);
animation: pulse 1.2s ease-in-out infinite;
}
.status__dot--connected {
background: var(--success);
}
.status__dot--error {
background: var(--danger);
}
/* Chat ------------------------------------------------------------------ */
.chat {
overflow: hidden;
background: var(--bg);
border: 1px solid var(--border);
border-radius: var(--radius);
display: flex;
flex-direction: column;
}
.chat__log {
flex: 1;
overflow-y: auto;
padding: 18px;
display: flex;
flex-direction: column;
gap: 10px;
scroll-behavior: smooth;
}
.chat__empty {
margin: auto;
text-align: center;
color: var(--text-dim);
}
.chat__empty p {
margin: 4px 0;
}
.chat__hint code {
background: var(--bg-soft);
border: 1px solid var(--border);
border-radius: 6px;
padding: 1px 6px;
font-size: 12px;
}
.bubble {
max-width: 78%;
padding: 10px 14px;
border-radius: 14px;
line-height: 1.45;
font-size: 14px;
white-space: pre-wrap;
word-wrap: break-word;
animation: bubble-in 0.16s ease-out;
}
.bubble--user {
background: var(--user);
color: #fff;
align-self: flex-end;
border-bottom-right-radius: 4px;
}
.bubble--assistant {
background: var(--assistant);
color: var(--text);
align-self: flex-start;
border-bottom-left-radius: 4px;
}
.bubble--assistant.bubble--interrupted {
opacity: 0.75;
border-left: 2px solid var(--warning);
}
.bubble--system {
align-self: center;
background: transparent;
color: var(--text-dim);
font-size: 12px;
border: 1px dashed var(--border);
padding: 6px 10px;
border-radius: 999px;
}
.bubble__role {
display: block;
font-size: 10px;
text-transform: uppercase;
letter-spacing: 0.8px;
opacity: 0.7;
margin-bottom: 4px;
}
/* Controls -------------------------------------------------------------- */
.controls {
display: grid;
gap: 10px;
padding: 14px 16px 6px;
border-top: 1px solid var(--border);
}
.meter {
height: 6px;
background: var(--bg-soft);
border-radius: 999px;
overflow: hidden;
}
.meter__fill {
height: 100%;
width: 0%;
background: linear-gradient(90deg, var(--success), var(--accent));
transition: width 80ms linear;
}
.composer {
display: flex;
align-items: flex-end;
gap: 8px;
}
.composer__input {
flex: 1;
resize: none;
background: var(--bg-soft);
color: var(--text);
border: 1px solid var(--border);
border-radius: 12px;
padding: 10px 12px;
font: inherit;
font-size: 14px;
line-height: 1.4;
outline: none;
min-height: 42px;
max-height: 180px;
overflow-y: auto;
}
.composer__input:focus {
border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}
.composer__input:disabled {
opacity: 0.55;
cursor: not-allowed;
}
.composer__send {
padding: 10px 18px;
border-radius: 12px;
min-width: 84px;
align-self: flex-end;
}
.composer__send:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.controls__row {
display: flex;
align-items: center;
gap: 14px;
}
.mic-btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 9px 14px;
border-radius: 999px;
background: var(--bg-soft);
color: var(--text);
border: 1px solid var(--border);
font: inherit;
font-weight: 600;
cursor: pointer;
transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease,
border-color 0.15s ease;
}
.mic-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.mic-btn:not(:disabled):hover {
border-color: var(--accent);
}
.mic-btn:not(:disabled):active {
transform: scale(0.98);
}
.mic-btn[aria-pressed="true"] {
background: var(--danger);
border-color: var(--danger);
color: #fff;
box-shadow: 0 0 0 6px rgba(255, 85, 119, 0.18);
}
.mic-btn__icon {
display: block;
}
.indicators {
display: flex;
gap: 12px;
margin-left: auto;
}
.indicator {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 12px;
color: var(--text-dim);
}
.indicator__dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--bg-soft);
border: 1px solid var(--border);
}
.indicator.is-active .indicator__dot--mic {
background: var(--success);
border-color: var(--success);
box-shadow: 0 0 0 4px rgba(45, 210, 139, 0.2);
}
.indicator.is-active .indicator__dot--bot {
background: var(--accent);
border-color: var(--accent);
box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.22);
animation: pulse 1s ease-in-out infinite;
}
.indicator.is-active .indicator__label {
color: var(--text);
}
.btn {
appearance: none;
border: 1px solid var(--border);
background: var(--bg-soft);
color: var(--text);
padding: 9px 14px;
border-radius: 10px;
font: inherit;
font-size: 13px;
cursor: pointer;
transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover {
border-color: var(--accent);
}
.btn--primary {
background: var(--accent);
color: #fff;
border-color: var(--accent);
}
.btn--primary:hover {
background: var(--accent-strong);
border-color: var(--accent-strong);
}
.btn--primary.is-disconnect {
background: transparent;
color: var(--danger);
border-color: var(--danger);
}
.btn--ghost {
background: transparent;
}
.hint {
margin: 4px 2px 0;
font-size: 12px;
color: var(--text-dim);
}
.hint kbd {
background: var(--bg-soft);
border: 1px solid var(--border);
border-bottom-width: 2px;
border-radius: 4px;
padding: 0 5px;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 11px;
color: var(--text);
}
/* Animations ------------------------------------------------------------ */
@keyframes pulse {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.55;
}
}
@keyframes bubble-in {
from {
opacity: 0;
transform: translateY(4px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Responsive ------------------------------------------------------------ */
@media (max-width: 720px) {
body {
padding: 0;
}
.app {
height: 100vh;
border-radius: 0;
border: none;
padding: 12px;
}
.app__header {
grid-template-columns: 1fr;
}
.connection {
flex-direction: column;
align-items: stretch;
}
.status {
justify-content: flex-end;
}
.indicators {
margin-left: 0;
}
}