2021-03-17 05:43:59 +00:00
|
|
|
/*
|
|
|
|
Copyright 2021 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
.mx_VoiceRecordComposerTile_stop {
|
|
|
|
// 28px plus a 2px border makes this a 32px square (as intended)
|
|
|
|
width: 28px;
|
|
|
|
height: 28px;
|
|
|
|
border: 2px solid $voice-record-stop-border-color;
|
|
|
|
border-radius: 32px;
|
|
|
|
margin-right: 16px; // between us and the send button
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
content: '';
|
|
|
|
width: 14px;
|
|
|
|
height: 14px;
|
|
|
|
position: absolute;
|
2021-03-17 05:54:33 +00:00
|
|
|
top: 7px;
|
|
|
|
left: 7px;
|
2021-03-17 05:43:59 +00:00
|
|
|
border-radius: 2px;
|
|
|
|
background-color: $voice-record-stop-symbol-color;
|
|
|
|
}
|
|
|
|
}
|
2021-03-25 23:12:26 +00:00
|
|
|
|
2021-04-27 03:08:51 +00:00
|
|
|
.mx_VoiceRecordComposerTile_delete {
|
|
|
|
width: 14px; // w&h are size of icon
|
|
|
|
height: 18px;
|
|
|
|
vertical-align: middle;
|
|
|
|
margin-right: 7px; // distance from left edge of waveform container (container has some margin too)
|
|
|
|
background-color: $muted-fg-color;
|
|
|
|
mask-repeat: no-repeat;
|
|
|
|
mask-size: contain;
|
|
|
|
mask-image: url('$(res)/img/element-icons/trashcan.svg');
|
|
|
|
}
|
|
|
|
|
2021-03-25 23:12:26 +00:00
|
|
|
.mx_VoiceRecordComposerTile_waveformContainer {
|
2021-04-21 03:43:55 +00:00
|
|
|
padding: 6px; // makes us 4px taller than the send/stop button
|
|
|
|
padding-right: 5px; // there's 1px from the waveform itself, so account for that
|
2021-03-25 23:12:26 +00:00
|
|
|
background-color: $voice-record-waveform-bg-color;
|
|
|
|
border-radius: 12px;
|
2021-04-21 03:30:21 +00:00
|
|
|
margin: 6px; // force the composer area to put a gutter around us
|
2021-03-25 23:12:26 +00:00
|
|
|
margin-right: 12px; // isolate from stop button
|
|
|
|
|
|
|
|
// Cheat at alignment a bit
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
position: relative; // important for the live circle
|
|
|
|
|
|
|
|
color: $voice-record-waveform-fg-color;
|
|
|
|
font-size: $font-14px;
|
|
|
|
|
2021-04-21 03:43:55 +00:00
|
|
|
&.mx_VoiceRecordComposerTile_recording {
|
|
|
|
padding-left: 16px; // +10px for the live circle, +6px for regular padding
|
2021-04-14 21:08:11 +00:00
|
|
|
|
2021-04-21 03:43:55 +00:00
|
|
|
&::before {
|
|
|
|
animation: recording-pulse 2s infinite;
|
|
|
|
|
|
|
|
content: '';
|
|
|
|
background-color: $voice-record-live-circle-color;
|
|
|
|
width: 10px;
|
|
|
|
height: 10px;
|
|
|
|
position: absolute;
|
|
|
|
left: 8px;
|
|
|
|
top: 16px; // vertically center
|
|
|
|
border-radius: 10px;
|
|
|
|
}
|
2021-03-25 23:12:26 +00:00
|
|
|
}
|
|
|
|
|
2021-04-21 03:43:55 +00:00
|
|
|
.mx_Waveform {
|
|
|
|
// We want the bars to be 2px shorter than the play/pause button in the waveform control
|
|
|
|
height: 28px; // default is 30px, so we're subtracting the 2px border off the bars
|
|
|
|
|
|
|
|
.mx_Waveform_bar {
|
|
|
|
background-color: $voice-record-waveform-fg-color;
|
|
|
|
}
|
2021-03-25 23:12:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.mx_Clock {
|
2021-04-21 03:43:55 +00:00
|
|
|
padding-right: 4px; // isolate from waveform
|
|
|
|
padding-left: 8px; // isolate from live circle
|
|
|
|
width: 40px; // we're not using a monospace font, so fake it
|
2021-03-25 23:12:26 +00:00
|
|
|
}
|
|
|
|
}
|
2021-04-14 21:08:11 +00:00
|
|
|
|
2021-04-15 16:04:15 +00:00
|
|
|
// The keyframes are slightly weird here to help make a ramping/punch effect
|
|
|
|
// for the recording dot. We start and end at 100% opacity to help make the
|
|
|
|
// dot feel a bit like a real lamp that is blinking: the animation ends up
|
|
|
|
// spending a lot of its time showing a steady state without a fade effect.
|
|
|
|
// This lamp effect extends into why the 0% opacity keyframe is not in the
|
|
|
|
// midpoint: lamps take longer to turn off than they do to turn on, and the
|
|
|
|
// extra frames give it a bit of a realistic punch for when the animation is
|
|
|
|
// ramping back up to 100% opacity.
|
2021-04-15 16:49:39 +00:00
|
|
|
//
|
|
|
|
// Target animation timings: steady for 1.5s, fade out for 0.3s, fade in for 0.2s
|
|
|
|
// (intended to be used in a loop for 2s animation speed)
|
2021-04-14 21:08:11 +00:00
|
|
|
@keyframes recording-pulse {
|
|
|
|
0% {
|
2021-04-14 21:10:57 +00:00
|
|
|
opacity: 1;
|
2021-04-14 21:08:11 +00:00
|
|
|
}
|
2021-04-15 16:49:39 +00:00
|
|
|
35% {
|
2021-04-14 21:10:57 +00:00
|
|
|
opacity: 0;
|
2021-04-14 21:08:11 +00:00
|
|
|
}
|
2021-04-15 16:49:39 +00:00
|
|
|
65% {
|
2021-04-14 21:10:57 +00:00
|
|
|
opacity: 1;
|
2021-04-14 21:08:11 +00:00
|
|
|
}
|
|
|
|
}
|