diff --git a/src/assets/avatar.scss b/src/assets/avatar.scss new file mode 100644 index 000000000..a543a5fe7 --- /dev/null +++ b/src/assets/avatar.scss @@ -0,0 +1,62 @@ +/** + * @copyright Copyright (c) 2020 Joas Schilling + * + * @author Joas Schilling + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +@import 'variables.scss'; + + +@mixin avatar-mixin($size: 32px) { + .avatar-#{$size} { + position: sticky; + top: 0; + width: $size; + height: $size; + line-height: $size; + font-size: $size / 2; + border-radius: 50%; + + &.icon { + padding: 20px 10px 10px 10px; + border-radius: 50%; + height: $size; + width: $size; + background-color: var(--color-background-darker); + } + + &.bot { + padding-left: 5px; + line-height: $size; + border-radius: 50%; + background-color: var(--color-background-darker); + } + + &.guest { + line-height: $size; + font-size: $size / 2; + color: $color-guests-avatar; + background-color: $color-background-guests-avatar; + padding: 0; + display: block; + text-align: center; + margin-left: auto; + margin-right: auto; + } + } +} diff --git a/src/components/CallView/CallView.vue b/src/components/CallView/CallView.vue index e89ad8d2a..39b3c934e 100644 --- a/src/components/CallView/CallView.vue +++ b/src/components/CallView/CallView.vue @@ -438,11 +438,6 @@ export default { width: 100%; } -.videoContainer ::v-deep .avatar-container .avatardiv--unknown { - // Force grey background for guest avatars - background-color: #b9b9b9 !important; -} - .videoContainer ::v-deep .avatar-container .avatardiv { display: block; margin-left: auto; diff --git a/src/components/CallView/LocalVideo.vue b/src/components/CallView/LocalVideo.vue index 26d9e5b64..9afd44517 100644 --- a/src/components/CallView/LocalVideo.vue +++ b/src/components/CallView/LocalVideo.vue @@ -28,11 +28,11 @@ :disable-tooltip="true" :user="userId" :display-name="displayName" /> - +
+ {{ firstLetterOfGuestName }} +
+ + diff --git a/src/components/CallView/Video.vue b/src/components/CallView/Video.vue index b6caefdab..2eaa7244f 100644 --- a/src/components/CallView/Video.vue +++ b/src/components/CallView/Video.vue @@ -33,12 +33,11 @@ :user="model.attributes.userId" :display-name="model.attributes.name" :class="avatarClass" /> - +
+ {{ firstLetterOfGuestName }} +
{{ participantName }} @@ -118,6 +117,10 @@ export default { return (this.useConstrainedLayout && !this.sharedData.promoted) ? 64 : 128 }, + avatarSizeClass() { + return 'avatar-' + this.avatarSize + 'px' + }, + avatarClass() { return { 'icon-loading': this.model.attributes.connectionState !== ConnectionState.CONNECTED && this.model.attributes.connectionState !== ConnectionState.COMPLETED && this.model.attributes.connectionState !== ConnectionState.FAILED_NO_RESTART, @@ -125,7 +128,7 @@ export default { }, firstLetterOfGuestName() { - return this.model.attributes.name || '?' + return (this.model.attributes.name || '?').substring(0, 1) }, participantName() { @@ -241,6 +244,10 @@ export default { filter: drop-shadow(1px 1px 4px var(--color-box-shadow)); } +@import '../../assets/avatar.scss'; +@include avatar-mixin(64px); +@include avatar-mixin(128px); + .mediaIndicator { position: absolute; width: 100%; diff --git a/src/components/MessagesList/MessagesGroup/AuthorAvatar.vue b/src/components/MessagesList/MessagesGroup/AuthorAvatar.vue index e7645b3a5..7520ee36d 100644 --- a/src/components/MessagesList/MessagesGroup/AuthorAvatar.vue +++ b/src/components/MessagesList/MessagesGroup/AuthorAvatar.vue @@ -25,17 +25,17 @@ :user="authorId" :display-name="displayName" />
+ class="avatar-32px guest"> X
+ class="avatar-32px guest"> {{ firstLetterOfGuestName }}
+ class="avatar-32px bot"> >_
@@ -86,39 +86,10 @@ export default { diff --git a/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue b/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue index ca08e5194..f1f417149 100644 --- a/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue +++ b/src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue @@ -29,14 +29,14 @@ @click="handleClick">
+ class="avatar-32px guest"> {{ firstLetterOfGuestName }}
@@ -258,10 +258,6 @@ export default {