2021-04-21 16:32:23 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
.module-Avatar {
|
|
|
|
align-items: center;
|
|
|
|
border-radius: 100%;
|
|
|
|
display: inline-flex;
|
|
|
|
justify-content: center;
|
|
|
|
line-height: 0;
|
|
|
|
overflow: hidden;
|
2021-04-27 13:20:17 +00:00
|
|
|
position: relative;
|
2021-04-21 16:32:23 +00:00
|
|
|
user-select: none;
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
|
|
&__button {
|
|
|
|
@include button-reset;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
display: flex;
|
|
|
|
height: 100%;
|
|
|
|
justify-content: center;
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
@include keyboard-mode {
|
|
|
|
&:focus {
|
2021-05-28 16:15:17 +00:00
|
|
|
box-shadow: 0px 0px 0px 2px $color-ultramarine;
|
2021-04-21 16:32:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-27 13:20:17 +00:00
|
|
|
&__image {
|
2021-05-10 17:50:04 +00:00
|
|
|
background-position: center center;
|
2021-04-27 13:20:17 +00:00
|
|
|
background-size: cover;
|
|
|
|
display: flex;
|
|
|
|
height: 100%;
|
|
|
|
transition: filter 100ms ease-out;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__click-to-view {
|
|
|
|
@include font-body-2;
|
|
|
|
align-items: center;
|
|
|
|
background: $color-black-alpha-20;
|
|
|
|
color: $color-white;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2021-04-21 16:32:23 +00:00
|
|
|
height: 100%;
|
2021-04-27 13:20:17 +00:00
|
|
|
justify-content: center;
|
|
|
|
left: 0;
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
2021-04-21 16:32:23 +00:00
|
|
|
width: 100%;
|
2021-04-27 13:20:17 +00:00
|
|
|
|
|
|
|
&::before {
|
|
|
|
@include color-svg(
|
|
|
|
'../images/icons/v2/click-outline-24.svg',
|
|
|
|
$color-white
|
|
|
|
);
|
|
|
|
content: '';
|
|
|
|
display: block;
|
|
|
|
height: 24px;
|
|
|
|
margin-bottom: 8px;
|
|
|
|
width: 24px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background: $color-black-alpha-40;
|
|
|
|
}
|
2021-04-21 16:32:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&__label {
|
|
|
|
align-items: center;
|
|
|
|
display: flex;
|
|
|
|
font-weight: bold;
|
|
|
|
justify-content: center;
|
|
|
|
text-align: center;
|
|
|
|
text-transform: uppercase;
|
|
|
|
transition: font-size 100ms ease-out;
|
|
|
|
|
|
|
|
@include light-theme {
|
|
|
|
color: $color-white;
|
|
|
|
}
|
|
|
|
@include dark-theme {
|
|
|
|
color: $color-gray-05;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&__icon {
|
|
|
|
@mixin avatar-icon($icon) {
|
|
|
|
@include light-theme {
|
|
|
|
@include color-svg($icon, $color-white);
|
|
|
|
}
|
|
|
|
@include dark-theme {
|
|
|
|
@include color-svg($icon, $color-gray-05);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&--direct {
|
|
|
|
@include avatar-icon('../images/icons/v2/profile-outline-20.svg');
|
|
|
|
height: 60%;
|
|
|
|
width: 60%;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--group {
|
|
|
|
@include avatar-icon('../images/icons/v2/group-outline-20.svg');
|
|
|
|
height: 60%;
|
|
|
|
width: 60%;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--note-to-self {
|
|
|
|
@include avatar-icon('../images/note-28.svg');
|
|
|
|
height: 70%;
|
|
|
|
width: 70%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&__spinner-container {
|
|
|
|
padding: 4px;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--no-image {
|
2021-05-28 16:15:17 +00:00
|
|
|
background-color: $avatar-color-steel;
|
2021-04-21 16:32:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&--signal-blue {
|
2021-05-28 16:15:17 +00:00
|
|
|
background-color: $avatar-color-ultramarine;
|
|
|
|
@include dark-theme {
|
|
|
|
background-color: $avatar-color-ultramarine;
|
2021-04-21 16:32:23 +00:00
|
|
|
}
|
|
|
|
}
|
2021-05-28 16:15:17 +00:00
|
|
|
|
|
|
|
@each $color, $value in $avatar-colors {
|
2021-04-21 16:32:23 +00:00
|
|
|
&--#{$color} {
|
2021-05-28 16:15:17 +00:00
|
|
|
background-color: $value;
|
|
|
|
|
2021-04-21 16:32:23 +00:00
|
|
|
@include dark-theme {
|
|
|
|
background-color: $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|