@@ -82,13 +86,49 @@
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+
+
+
+
@@ -110,7 +154,7 @@
@@ -352,15 +420,20 @@ onBeforeUnmount(() => {
margin: .5rem 0 0;
display: flex;
padding: .5rem;
+ position: relative;
box-shadow: 0 .5rem 1.5rem rgba(15, 23, 42, .12);
+ transition: border-color .2s, box-shadow .2s;
align-items: stretch;
border-radius: 1.25rem;
flex-direction: column;
.input-wrap {
+ gap: .375rem;
+ display: flex;
position: relative;
flex: 1;
min-width: 0;
+ flex-direction: column;
}
.input {
@@ -368,80 +441,118 @@ onBeforeUnmount(() => {
width: 100%;
padding: 0 .25rem;
min-width: 0;
+
+ &.voice-input-hidden {
+ visibility: hidden;
+ }
}
- .voice-hit {
- inset: 0;
- z-index: 1;
- position: absolute;
- touch-action: none;
- -webkit-tap-highlight-color: transparent;
- }
-
- .voice-panel {
- inset: 0;
- gap: .25rem;
+ .voice-transcript {
+ left: 50%;
+ gap: .5rem;
+ width: 100%;
+ z-index: 3;
display: flex;
- z-index: 2;
padding: .5rem .75rem;
position: absolute;
- user-select: none;
- border-radius: .75rem;
+ box-sizing: border-box;
+ bottom: calc(100% + .5rem);
+ align-items: center;
pointer-events: none;
+ border: 1px solid var(--td-brand-color);
background: var(--td-bg-color-container);
+ box-shadow: 0 .5rem 1.5rem rgba(15, 23, 42, .16);
+ animation: voice-transcript-in .16s ease-out;
+ border-radius: 1rem;
+ transform: translateX(-50%);
+ }
+
+ .voice-wave {
+ gap: .1875rem;
+ height: 1rem;
+ display: flex;
+ flex: none;
+ align-items: center;
+
+ span {
+ width: .125rem;
+ height: 100%;
+ border-radius: .125rem;
+ background: var(--td-brand-color);
+ animation: voice-wave .9s ease-in-out infinite;
+ animation-delay: calc(var(--i) * .1s);
+ transform: scaleY(.3);
+ transform-origin: center;
+ }
+ }
+
+ .voice-text,
+ .voice-placeholder {
+ margin: 0;
+ flex: 1;
+ min-width: 0;
+ word-break: break-word;
+ }
+
+ .voice-text {
+ display: -webkit-box;
+ overflow: hidden;
+ color: var(--td-text-color-primary);
+ font-size: .875rem;
+ line-height: 1.4;
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ }
+
+ .voice-placeholder {
+ overflow: hidden;
+ color: var(--td-text-color-placeholder);
+ font-size: .75rem;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+
+ .voice-hold {
+ inset: 0;
+ gap: .375rem;
+ z-index: 1;
+ display: flex;
+ padding: 0 .75rem;
+ position: absolute;
+ color: var(--td-brand-color);
+ font-size: .875rem;
+ font-weight: 500;
+ transition: color .15s, border-color .15s;
+ border: 0;
+ border-bottom: 1px solid var(--td-component-border);
+ background: transparent;
+ border-radius: 0;
align-items: center;
- flex-direction: column;
justify-content: center;
+ touch-action: none;
+ user-select: none;
+ -webkit-tap-highlight-color: transparent;
- .voice-wave {
- gap: .1875rem;
- height: 1.25rem;
- display: flex;
- align-items: center;
-
- span {
- width: .1875rem;
- height: 30%;
- border-radius: .125rem;
- background: var(--td-brand-color);
- animation: voice-wave .9s ease-in-out infinite;
- animation-delay: calc(var(--i) * .1s);
- }
- }
-
- .voice-text {
- overflow: hidden;
- margin: .375rem 0 0;
- font-size: .8125rem;
- text-align: center;
- line-height: 1.4;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- }
-
- .voice-hint {
- margin: .25rem 0 0;
- color: var(--td-text-color-secondary);
- font-size: .6875rem;
+ &.active {
+ color: var(--td-brand-color);
+ border-bottom-color: var(--td-brand-color);
}
&.cancel {
- .voice-text,
- .voice-hint {
- color: var(--td-error-color);
- }
+ color: var(--td-error-color);
+ border-bottom-color: var(--td-error-color);
+ }
- .voice-wave span {
- background: var(--td-error-color);
- }
+ &:disabled {
+ opacity: .55;
}
}
.actions {
- --td-button-border-radius: .75rem;
+ --td-button-border-radius: 1rem;
gap: .5rem;
+ min-height: 2rem;
margin-top: .375rem;
display: flex;
align-items: center;
@@ -452,23 +563,58 @@ onBeforeUnmount(() => {
display: flex;
align-items: center;
}
-
- .send {
- padding: 0 1rem;
- }
}
}
+
+ &.voice-active .form {
+ border-color: var(--td-brand-color);
+
+ &::after {
+ content: "";
+ inset: -.125rem;
+ border: 1px solid var(--td-brand-color);
+ position: absolute;
+ animation: voice-breathe 1s ease-in-out 0s infinite;
+ will-change: transform, opacity;
+ border-radius: inherit;
+ pointer-events: none;
+ transform-origin: center;
+ }
+ }
+}
+
+@keyframes voice-breathe {
+ 0%,
+ 100% {
+ opacity: .6;
+ transform: scaleX(1) scaleY(1);
+ }
+
+ 50% {
+ opacity: .2;
+ transform: scaleX(1.02) scaleY(1.08);
+ }
}
@keyframes voice-wave {
0%,
100% {
- height: 25%;
opacity: .5;
+ transform: scaleY(.3);
}
50% {
- height: 100%;
+ opacity: 1;
+ transform: scaleY(1);
+ }
+}
+
+@keyframes voice-transcript-in {
+ from {
+ opacity: 0;
+ }
+
+ to {
opacity: 1;
}
}