feat(chat): add voice message bubbles

This commit is contained in:
2026-06-25 11:13:25 +08:00
parent 038b207964
commit cd836cda43
7 changed files with 233 additions and 3 deletions
@@ -0,0 +1,116 @@
.bubble {
display: flex;
align-items: flex-start;
gap: 10px;
width: min(280px, 100%);
padding: 12px 14px;
border-radius: 20px;
box-shadow: var(--shadow-input-box, 0 1px 2px rgba(0, 0, 0, 0.1));
}
.bubbleAi {
border-top-left-radius: 0;
background: #ffffff;
color: var(--color-text-foreground, #171717);
}
.bubbleUser {
border-top-right-radius: 0;
background: linear-gradient(
to right,
var(--color-button-gradient-start, #ff67e0),
var(--color-button-gradient-end, #ff52a2)
);
color: #ffffff;
}
.playButton {
display: inline-flex;
flex: 0 0 auto;
align-items: center;
justify-content: center;
width: 34px;
height: 34px;
border: 0;
border-radius: 50%;
background: rgba(246, 87, 160, 0.14);
color: #f657a0;
cursor: pointer;
}
.bubbleUser .playButton {
background: rgba(255, 255, 255, 0.22);
color: #ffffff;
}
.playButton:disabled {
cursor: not-allowed;
opacity: 0.6;
}
.playButton:focus-visible {
outline: 2px solid currentColor;
outline-offset: 2px;
}
.body {
display: flex;
min-width: 0;
flex: 1 1 auto;
flex-direction: column;
gap: 8px;
}
.wave {
display: flex;
align-items: center;
gap: 4px;
height: 34px;
}
.wave span {
display: block;
width: 4px;
border-radius: 999px;
background: currentColor;
opacity: 0.72;
}
.wave span:nth-child(1) {
height: 12px;
}
.wave span:nth-child(2) {
height: 22px;
}
.wave span:nth-child(3) {
height: 30px;
}
.wave span:nth-child(4) {
height: 18px;
}
.wave span:nth-child(5) {
height: 26px;
}
.text {
margin: 0;
font-size: var(--font-size-md, 14px);
line-height: 1.45;
white-space: pre-wrap;
word-break: break-word;
}
.error {
margin: 0;
color: var(--color-error, #ff4d4f);
font-size: var(--font-size-sm, 12px);
line-height: 1.4;
}
.bubbleUser .error {
color: #ffffff;
}