Skip to content

Commit c08028d

Browse files
committed
(UI) change microphone icon
1 parent 30bacea commit c08028d

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

src/ChatWindow/Room.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
v-if="recorder.state === 'recording'"
176176
name="microphone-off-icon"
177177
>
178-
<svg-icon name="microphone-off" />
178+
<svg-icon name="microphone-off" class="icon-microphone-off" />
179179
</slot>
180180
<slot v-else name="microphone-icon">
181181
<svg-icon name="microphone" class="icon-microphone" />
@@ -514,6 +514,7 @@ export default {
514514
if (this.recorder.state === 'recording') {
515515
this.recorder.stop()
516516
} else {
517+
this.file = null
517518
this.recordedChunk = await this.startRecording()
518519
}
519520
},
@@ -967,6 +968,19 @@ textarea {
967968
fill: var(--chat-icon-color-microphone);
968969
}
969970
971+
.icon-microphone-off {
972+
animation: scaling .8s ease-in-out infinite alternate;
973+
}
974+
975+
@keyframes scaling {
976+
0% {
977+
transform: scale(1);
978+
}
979+
100% {
980+
transform: scale(1.2);
981+
}
982+
}
983+
970984
.image-container {
971985
position: absolute;
972986
max-width: 25%;

src/ChatWindow/SvgIcon.vue

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
version="1.1"
66
width="24"
77
height="24"
8-
viewBox="0 0 24 24"
8+
:viewBox="`0 0 ${size} ${size}`"
99
>
1010
<path :id="svgId" :d="svgItem.find(item => item.name === name).path" />
1111
</svg>
@@ -20,6 +20,11 @@ export default {
2020
svgId() {
2121
const param = this.param ? '-' + this.param : ''
2222
return `chat-icon-${this.name}${param}`
23+
},
24+
size() {
25+
return this.svgItem.find(item => item.name === this.name).large
26+
? '512'
27+
: '24'
2328
}
2429
},
2530
@@ -110,13 +115,15 @@ export default {
110115
},
111116
{
112117
name: 'microphone',
118+
large: true,
113119
path:
114-
'M16 24h-8v-1h3.5v-3.018c-3.63-.256-6.5-3.287-6.5-6.982v-2h1v2.01c.005 3.307 2.692 5.99 6 5.99 3.311 0 6-2.689 6-6v-2h1v2c0 3.695-2.87 6.726-6.5 6.982v3.018h3.5v1zm-9-19c0-2.76 2.24-5 5-5s5 2.24 5 5v8c0 2.76-2.24 5-5 5s-5-2.24-5-5v-8zm9 0c0-2.208-1.792-4-4-4s-4 1.792-4 4v8c0 2.208 1.792 4 4 4s4-1.792 4-4v-8z'
120+
'M432.8,216.4v39.2c0,45.2-15.3,84.3-45.2,118.4c-29.8,33.2-67.3,52.8-111.6,57.9v40.9h78.4c5.1,0,10.2,1.7,13.6,6c4.3,4.3,6,8.5,6,13.6c0,5.1-1.7,10.2-6,13.6c-4.3,4.3-8.5,6-13.6,6H157.6c-5.1,0-10.2-1.7-13.6-6c-4.3-4.3-6-8.5-6-13.6c0-5.1,1.7-10.2,6-13.6c4.3-4.3,8.5-6,13.6-6H236v-40.9c-44.3-5.1-81.8-23.9-111.6-57.9s-45.2-73.3-45.2-118.4v-39.2c0-5.1,1.7-10.2,6-13.6c4.3-4.3,8.5-6,13.6-6s10.2,1.7,13.6,6c4.3,4.3,6,8.5,6,13.6v39.2c0,37.5,13.6,70.7,40,97.1s59.6,40,97.1,40s70.7-13.6,97.1-40c26.4-26.4,40-59.6,40-97.1v-39.2c0-5.1,1.7-10.2,6-13.6c4.3-4.3,8.5-6,13.6-6c5.1,0,10.2,1.7,13.6,6C430.2,206.2,432.8,211.3,432.8,216.4z M353.5,98v157.6c0,27.3-9.4,50.3-29,69c-19.6,19.6-42.6,29-69,29s-50.3-9.4-69-29c-19.6-19.6-29-42.6-29-69V98c0-27.3,9.4-50.3,29-69c19.6-19.6,42.6-29,69-29s50.3,9.4,69,29C344.2,47.7,353.5,71.6,353.5,98z'
115121
},
116122
{
117123
name: 'microphone-off',
124+
large: true,
118125
path:
119-
'M16 24h-8v-1h3.5v-3.018c-3.63-.256-6.5-3.287-6.5-6.982v-2h1v2.01c.005 3.307 2.692 5.99 6 5.99 3.311 0 6-2.689 6-6v-2h1v2c0 3.695-2.87 6.726-6.5 6.982v3.018h3.5v1zm-9-19c0-2.76 2.24-5 5-5s5 2.24 5 5v8c0 2.76-2.24 5-5 5s-5-2.24-5-5v-8zm9 0c0-2.208-1.792-4-4-4s-4 1.792-4 4v8c0 2.208 1.792 4 4 4s4-1.792 4-4v-8z'
126+
'M432.8,216.4v39.2c0,45.2-15.3,84.3-45.2,118.4c-29.8,33.2-67.3,52.8-111.6,57.9v40.9h78.4c5.1,0,10.2,1.7,13.6,6c4.3,4.3,6,8.5,6,13.6c0,5.1-1.7,10.2-6,13.6c-4.3,4.3-8.5,6-13.6,6H157.6c-5.1,0-10.2-1.7-13.6-6c-4.3-4.3-6-8.5-6-13.6c0-5.1,1.7-10.2,6-13.6c4.3-4.3,8.5-6,13.6-6H236v-40.9c-44.3-5.1-81.8-23.9-111.6-57.9s-45.2-73.3-45.2-118.4v-39.2c0-5.1,1.7-10.2,6-13.6c4.3-4.3,8.5-6,13.6-6s10.2,1.7,13.6,6c4.3,4.3,6,8.5,6,13.6v39.2c0,37.5,13.6,70.7,40,97.1s59.6,40,97.1,40s70.7-13.6,97.1-40c26.4-26.4,40-59.6,40-97.1v-39.2c0-5.1,1.7-10.2,6-13.6c4.3-4.3,8.5-6,13.6-6c5.1,0,10.2,1.7,13.6,6C430.2,206.2,432.8,211.3,432.8,216.4z M353.5,98v157.6c0,27.3-9.4,50.3-29,69c-19.6,19.6-42.6,29-69,29s-50.3-9.4-69-29c-19.6-19.6-29-42.6-29-69V98c0-27.3,9.4-50.3,29-69c19.6-19.6,42.6-29,69-29s50.3,9.4,69,29C344.2,47.7,353.5,71.6,353.5,98z'
120127
}
121128
]
122129
}

0 commit comments

Comments
 (0)