2021-03-10 20:36:58 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2021-07-09 20:27:16 +00:00
|
|
|
$audio-attachment-button-size: 36px;
|
|
|
|
$audio-attachment-button-margin-big: 12px;
|
|
|
|
$audio-attachment-button-margin-small: 4px;
|
|
|
|
|
2021-03-10 20:36:58 +00:00
|
|
|
.module-message__audio-attachment {
|
|
|
|
display: flex;
|
2021-07-09 20:27:16 +00:00
|
|
|
flex-direction: column;
|
|
|
|
margin-top: 2px;
|
|
|
|
}
|
2021-03-10 20:36:58 +00:00
|
|
|
|
2021-07-09 20:27:16 +00:00
|
|
|
.module-message__audio-attachment__button-and-waveform {
|
|
|
|
display: flex;
|
2021-03-10 20:36:58 +00:00
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
2021-07-09 20:27:16 +00:00
|
|
|
margin-bottom: 5px;
|
2021-03-10 20:36:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* The separator between audio and text */
|
|
|
|
.module-message__audio-attachment--with-content-below {
|
|
|
|
border-bottom: 1px solid $color-white-alpha-20;
|
|
|
|
padding-bottom: 12px;
|
|
|
|
margin-bottom: 7px;
|
|
|
|
|
2021-07-09 20:27:16 +00:00
|
|
|
&.module-message__audio-attachment--incoming {
|
2021-03-10 20:36:58 +00:00
|
|
|
@include light-theme {
|
|
|
|
border-color: $color-black-alpha-20;
|
|
|
|
}
|
2022-08-18 15:43:44 +00:00
|
|
|
|
2021-05-28 16:15:17 +00:00
|
|
|
@include dark-theme {
|
2021-03-10 20:36:58 +00:00
|
|
|
border-color: $color-white-alpha-20;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.module-message__container--outgoing & {
|
2021-05-28 16:15:17 +00:00
|
|
|
border-color: $color-white-alpha-20;
|
2021-03-10 20:36:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.module-message__audio-attachment--with-content-above {
|
|
|
|
margin-top: 6px;
|
|
|
|
}
|
|
|
|
|
2022-08-18 15:43:44 +00:00
|
|
|
.module-message__audio-attachment__controls {
|
|
|
|
display: flex;
|
|
|
|
flex: 1;
|
2022-08-31 20:42:09 +00:00
|
|
|
margin-right: 4px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.module-message__audio-attachment__dot {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: flex-start;
|
|
|
|
transition: width 100ms ease-out;
|
|
|
|
|
|
|
|
&:before {
|
|
|
|
content: '';
|
|
|
|
display: block;
|
|
|
|
width: 6px;
|
|
|
|
height: 6px;
|
|
|
|
border-radius: 100%;
|
|
|
|
transition: background 100ms ease-out;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--unplayed {
|
|
|
|
width: 14px;
|
|
|
|
}
|
|
|
|
&--played {
|
|
|
|
width: 0px;
|
|
|
|
}
|
|
|
|
.module-message__audio-attachment--incoming & {
|
|
|
|
&--unplayed:before {
|
|
|
|
@include light-theme {
|
|
|
|
background: $color-gray-60;
|
|
|
|
}
|
|
|
|
@include dark-theme {
|
|
|
|
background: $color-gray-25;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.module-message__audio-attachment--outgoing & {
|
|
|
|
&--unplayed:before {
|
|
|
|
background: $color-white-alpha-80;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&--played:before {
|
|
|
|
background: transparent;
|
|
|
|
}
|
2022-08-18 15:43:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.module-message__audio-attachment__playback-rate-button {
|
|
|
|
@include button-reset;
|
|
|
|
@include font-body-2-bold;
|
|
|
|
|
2022-08-31 20:42:09 +00:00
|
|
|
width: 38px;
|
|
|
|
height: 18px;
|
|
|
|
text-align: center;
|
|
|
|
font-weight: 700;
|
2022-08-18 15:43:44 +00:00
|
|
|
border-radius: 4px;
|
2022-08-31 20:42:09 +00:00
|
|
|
font-size: 11px;
|
|
|
|
padding: 1px 2px;
|
|
|
|
margin: -2px 0;
|
2022-08-18 15:43:44 +00:00
|
|
|
line-height: 16px;
|
2022-08-31 20:42:09 +00:00
|
|
|
letter-spacing: 0.05px;
|
|
|
|
user-select: none;
|
|
|
|
|
|
|
|
.module-message__audio-attachment--incoming & {
|
|
|
|
@include light-theme {
|
|
|
|
color: $color-gray-60;
|
|
|
|
background: $color-black-alpha-08;
|
|
|
|
}
|
|
|
|
@include dark-theme {
|
|
|
|
color: $color-gray-25;
|
|
|
|
background: $color-white-alpha-08;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.module-message__audio-attachment--outgoing & {
|
|
|
|
color: $color-white-alpha-80;
|
|
|
|
background: $color-white-alpha-20;
|
|
|
|
}
|
2022-08-18 15:43:44 +00:00
|
|
|
}
|
|
|
|
|
2021-03-16 00:59:48 +00:00
|
|
|
.module-message__audio-attachment__button,
|
|
|
|
.module-message__audio-attachment__spinner {
|
2021-03-10 20:36:58 +00:00
|
|
|
@include button-reset;
|
|
|
|
|
2021-07-09 20:27:16 +00:00
|
|
|
flex-shrink: 0;
|
|
|
|
width: $audio-attachment-button-size;
|
|
|
|
height: $audio-attachment-button-size;
|
|
|
|
margin-right: $audio-attachment-button-margin-big;
|
|
|
|
|
2021-03-10 20:36:58 +00:00
|
|
|
outline: none;
|
|
|
|
border-radius: 18px;
|
|
|
|
|
2021-07-09 20:27:16 +00:00
|
|
|
@media (min-width: 0px) and (max-width: 799px) {
|
|
|
|
margin-right: $audio-attachment-button-margin-small;
|
|
|
|
}
|
|
|
|
|
2021-03-10 20:36:58 +00:00
|
|
|
&::before {
|
|
|
|
display: block;
|
|
|
|
height: 100%;
|
|
|
|
content: '';
|
|
|
|
}
|
|
|
|
|
2021-03-16 00:59:48 +00:00
|
|
|
@mixin audio-icon($name, $icon, $color) {
|
2021-03-10 20:36:58 +00:00
|
|
|
&--#{$name}::before {
|
2021-03-16 00:59:48 +00:00
|
|
|
@include color-svg('../images/icons/v2/#{$icon}.svg', $color, false);
|
2021-03-10 20:36:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-16 00:59:48 +00:00
|
|
|
@mixin all-audio-icons($color) {
|
|
|
|
@include audio-icon(play, play-solid-20, $color);
|
|
|
|
@include audio-icon(pause, pause-solid-20, $color);
|
|
|
|
@include audio-icon(download, arrow-down-20, $color);
|
|
|
|
@include audio-icon(pending, audio-spinner-arc-22, $color);
|
|
|
|
}
|
|
|
|
|
2021-03-17 17:08:22 +00:00
|
|
|
&--pending {
|
|
|
|
cursor: auto;
|
|
|
|
}
|
|
|
|
|
2021-03-16 00:59:48 +00:00
|
|
|
&--pending::before {
|
2021-09-28 22:12:19 +00:00
|
|
|
animation: rotate 1000ms linear infinite;
|
2021-03-16 00:59:48 +00:00
|
|
|
}
|
|
|
|
|
2021-03-10 20:36:58 +00:00
|
|
|
.module-message__audio-attachment--incoming & {
|
|
|
|
@include light-theme {
|
|
|
|
background: $color-white;
|
|
|
|
|
2021-03-16 00:59:48 +00:00
|
|
|
@include all-audio-icons($color-gray-60);
|
2021-03-10 20:36:58 +00:00
|
|
|
}
|
2022-08-18 15:43:44 +00:00
|
|
|
|
2021-05-28 16:15:17 +00:00
|
|
|
@include dark-theme {
|
2021-03-10 20:36:58 +00:00
|
|
|
background: $color-gray-60;
|
|
|
|
|
2021-03-16 00:59:48 +00:00
|
|
|
@include all-audio-icons($color-gray-15);
|
2021-03-10 20:36:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.module-message__audio-attachment--outgoing & {
|
2021-05-28 16:15:17 +00:00
|
|
|
background: $color-white-alpha-20;
|
|
|
|
@include all-audio-icons($color-white);
|
2021-03-10 20:36:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.module-message__audio-attachment__waveform {
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2021-03-23 21:03:16 +00:00
|
|
|
cursor: pointer;
|
2021-03-10 20:36:58 +00:00
|
|
|
|
|
|
|
outline: 0;
|
|
|
|
}
|
|
|
|
|
2021-05-13 21:49:51 +00:00
|
|
|
.module-message__audio-attachment__button,
|
2022-08-18 15:43:44 +00:00
|
|
|
.module-message__audio-attachment__playback-rate-button,
|
2021-05-13 21:49:51 +00:00
|
|
|
.module-message__audio-attachment__spinner,
|
|
|
|
.module-message__audio-attachment__waveform {
|
|
|
|
&:focus {
|
|
|
|
@include keyboard-mode {
|
2021-05-28 16:15:17 +00:00
|
|
|
outline: 2px solid $color-ultramarine;
|
2021-05-13 21:49:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.module-message__audio-attachment--outgoing & {
|
|
|
|
&:focus {
|
|
|
|
@include keyboard-mode {
|
|
|
|
outline: 2px solid $color-white-alpha-60;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-10 20:36:58 +00:00
|
|
|
.module-message__audio-attachment__waveform__bar {
|
|
|
|
display: inline-block;
|
|
|
|
|
|
|
|
width: 2px;
|
|
|
|
border-radius: 2px;
|
|
|
|
transition: height 250ms, background 250ms;
|
|
|
|
|
|
|
|
&:not(:first-of-type) {
|
|
|
|
margin-left: 2px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.module-message__audio-attachment--incoming & {
|
|
|
|
@include light-theme {
|
|
|
|
background: $color-black-alpha-40;
|
2022-08-18 15:43:44 +00:00
|
|
|
|
2021-03-10 20:36:58 +00:00
|
|
|
&--active {
|
|
|
|
background: $color-black-alpha-80;
|
|
|
|
}
|
|
|
|
}
|
2022-08-18 15:43:44 +00:00
|
|
|
|
2021-05-28 16:15:17 +00:00
|
|
|
@include dark-theme {
|
2021-03-10 20:36:58 +00:00
|
|
|
background: $color-white-alpha-40;
|
2022-08-18 15:43:44 +00:00
|
|
|
|
2021-03-10 20:36:58 +00:00
|
|
|
&--active {
|
|
|
|
background: $color-white-alpha-70;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.module-message__audio-attachment--outgoing & {
|
2021-05-28 16:15:17 +00:00
|
|
|
background: $color-white-alpha-40;
|
2022-08-18 15:43:44 +00:00
|
|
|
|
2021-05-28 16:15:17 +00:00
|
|
|
&--active {
|
|
|
|
background: $color-white-alpha-80;
|
2021-03-10 20:36:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-07-09 20:27:16 +00:00
|
|
|
.module-message__audio-attachment__metadata {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
|
2022-03-09 21:45:18 +00:00
|
|
|
@media (min-width: 0px) and (max-width: 799px) {
|
2021-07-09 20:27:16 +00:00
|
|
|
margin-left: $audio-attachment-button-size +
|
2022-03-09 21:45:18 +00:00
|
|
|
$audio-attachment-button-margin-small;
|
2021-07-09 20:27:16 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-22 18:15:59 +00:00
|
|
|
.module-message__audio-attachment__countdown {
|
2021-07-27 15:42:25 +00:00
|
|
|
@include font-caption;
|
2022-08-31 20:42:09 +00:00
|
|
|
width: $audio-attachment-button-size;
|
2021-03-23 21:03:16 +00:00
|
|
|
user-select: none;
|
2022-08-31 20:42:09 +00:00
|
|
|
text-align: center;
|
|
|
|
white-space: nowrap;
|
|
|
|
margin-right: 12px;
|
2021-03-10 20:36:58 +00:00
|
|
|
|
|
|
|
.module-message__audio-attachment--incoming & {
|
|
|
|
@include light-theme {
|
2021-07-27 15:42:25 +00:00
|
|
|
$color: $color-black-alpha-60;
|
|
|
|
color: $color;
|
2022-08-18 15:43:44 +00:00
|
|
|
|
2021-07-27 15:42:25 +00:00
|
|
|
&--unplayed:after {
|
|
|
|
background: $color;
|
|
|
|
}
|
2021-03-10 20:36:58 +00:00
|
|
|
}
|
2022-08-18 15:43:44 +00:00
|
|
|
|
2021-05-28 16:15:17 +00:00
|
|
|
@include dark-theme {
|
2021-07-27 15:42:25 +00:00
|
|
|
$color: $color-white-alpha-80;
|
|
|
|
color: $color;
|
2022-08-18 15:43:44 +00:00
|
|
|
|
2021-07-27 15:42:25 +00:00
|
|
|
&--unplayed:after {
|
|
|
|
background: $color;
|
|
|
|
}
|
2021-03-10 20:36:58 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.module-message__audio-attachment--outgoing & {
|
2021-05-28 16:15:17 +00:00
|
|
|
color: $color-white-alpha-80;
|
2021-07-27 15:42:25 +00:00
|
|
|
|
|
|
|
&--unplayed:after {
|
|
|
|
background: $color-white-alpha-80;
|
|
|
|
}
|
2021-03-10 20:36:58 +00:00
|
|
|
}
|
|
|
|
}
|