Voice recorder fixed
This commit is contained in:
parent
66f18a7df2
commit
4a762a3d8c
3 changed files with 43 additions and 34 deletions
|
|
@ -11,3 +11,7 @@ $chat-standard-padding-s: 16px;
|
||||||
$chat-standard-padding-xs: 8px;
|
$chat-standard-padding-xs: 8px;
|
||||||
$chat-text-size: 1px;
|
$chat-text-size: 1px;
|
||||||
$chat-button-height: 50px;
|
$chat-button-height: 50px;
|
||||||
|
|
||||||
|
$voice-recorder-color: #6f6f6f;
|
||||||
|
$voice-recording-color: red;
|
||||||
|
$voice-recorded-color: #3ae17d;
|
||||||
30
src/assets/css/components/_voice-recorder.scss
Normal file
30
src/assets/css/components/_voice-recorder.scss
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
.grow-enter-active,
|
||||||
|
.grow-leave-active {
|
||||||
|
transition-timing-function: ease-out;
|
||||||
|
transition: opacity 0.3s, border-radius 0.5s, transform 0.5s;
|
||||||
|
}
|
||||||
|
.grow-enter,
|
||||||
|
.grow-leave-to {
|
||||||
|
transform: translateX(var(--v-mic-button-initial-translate)) scaleX(var(--v-mic-button-initial-scale));
|
||||||
|
opacity: 0;
|
||||||
|
border-radius: 25px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fade-enter-active,
|
||||||
|
.fade-leave-active {
|
||||||
|
transition: opacity 0.5s;
|
||||||
|
}
|
||||||
|
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
.voice-recorder-btn {
|
||||||
|
padding: 30px;
|
||||||
|
background-color: $voice-recorder-color;
|
||||||
|
|
||||||
|
&.recording {
|
||||||
|
background-color: $voice-recording-color;
|
||||||
|
}
|
||||||
|
&.recorded {
|
||||||
|
background-color: $voice-recorded-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -17,16 +17,16 @@
|
||||||
<v-btn
|
<v-btn
|
||||||
v-if="state == states.RECORDING"
|
v-if="state == states.RECORDING"
|
||||||
id="btn-pause"
|
id="btn-pause"
|
||||||
style="background-color: white; padding: 30px"
|
|
||||||
icon
|
icon
|
||||||
|
class="voice-recorder-btn recording"
|
||||||
@click.stop="pauseRecording"
|
@click.stop="pauseRecording"
|
||||||
>
|
>
|
||||||
<v-icon color="black">stop</v-icon>
|
<v-icon color="white">stop</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-btn
|
<v-btn
|
||||||
v-else-if="state == states.RECORDED"
|
v-else-if="state == states.RECORDED"
|
||||||
id="btn-send"
|
id="btn-send"
|
||||||
style="background-color: #3ae17d; padding: 30px"
|
class="voice-recorder-btn recorded"
|
||||||
icon
|
icon
|
||||||
:disabled="!recordedFile"
|
:disabled="!recordedFile"
|
||||||
@click.stop="send"
|
@click.stop="send"
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
<v-btn
|
<v-btn
|
||||||
v-else
|
v-else
|
||||||
id="btn-record"
|
id="btn-record"
|
||||||
style="background-color: red; padding: 30px"
|
class="voice-recorder-btn"
|
||||||
icon
|
icon
|
||||||
@click.stop="startRecording"
|
@click.stop="startRecording"
|
||||||
>
|
>
|
||||||
|
|
@ -196,6 +196,7 @@ export default {
|
||||||
recordingLocked: false,
|
recordingLocked: false,
|
||||||
recordedFile: null,
|
recordedFile: null,
|
||||||
errorMessage: null,
|
errorMessage: null,
|
||||||
|
recorder: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -353,13 +354,8 @@ export default {
|
||||||
},
|
},
|
||||||
cancelRecording() {
|
cancelRecording() {
|
||||||
this.state = State.INITIAL;
|
this.state = State.INITIAL;
|
||||||
if (this.recorder) {
|
this.recorder.stop();
|
||||||
this.recorder.stopRecording();
|
this.recorder = null;
|
||||||
//this.recorder.destroy();
|
|
||||||
this.recorder = null;
|
|
||||||
}
|
|
||||||
this.stopRecordTimer();
|
|
||||||
this.recordingTime = String.fromCharCode(160); // nbsp;
|
|
||||||
this.close();
|
this.close();
|
||||||
},
|
},
|
||||||
pauseRecording() {
|
pauseRecording() {
|
||||||
|
|
@ -443,27 +439,6 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "@/assets/css/chat.scss";
|
@import "@/assets/css/chat.scss";
|
||||||
</style>
|
@import "@/assets/css/components/voice-recorder.scss";
|
||||||
<style>
|
|
||||||
.grow-enter-active,
|
|
||||||
.grow-leave-active {
|
|
||||||
transition-timing-function: ease-out;
|
|
||||||
transition: opacity 0.3s, border-radius 0.5s, transform 0.5s;
|
|
||||||
}
|
|
||||||
.grow-enter,
|
|
||||||
.grow-leave-to {
|
|
||||||
transform: translateX(var(--v-mic-button-initial-translate))
|
|
||||||
scaleX(var(--v-mic-button-initial-scale));
|
|
||||||
opacity: 0;
|
|
||||||
border-radius: 25px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fade-enter-active,
|
|
||||||
.fade-leave-active {
|
|
||||||
transition: opacity 0.5s;
|
|
||||||
}
|
|
||||||
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue