update styles and remove unnecessary stuff

This commit is contained in:
shpuld 2019-04-17 18:28:44 +03:00
parent 8ed4eb8a7f
commit 75a650aa6d
2 changed files with 22 additions and 57 deletions

View file

@ -1,7 +1,7 @@
<template> <template>
<ul class="avatars" :class="{ 'transparent-avatar': slicedAvatars.length == 15 }"> <ul class="avatars">
<li class="avatars-item" v-for="(avatar, index) in slicedAvatars" :key="`avatar-${index}`"> <li class="avatars-item" v-for="avatar in slicedAvatars">
<UserAvatar :src="avatar.profile_image_url" class="avatars-img" /> <UserAvatar :src="avatar.profile_image_url" class="avatar-small" />
</li> </li>
</ul> </ul>
</template> </template>
@ -10,53 +10,28 @@
<style lang="scss"> <style lang="scss">
@import '../../_variables.scss'; @import '../../_variables.scss';
.avatars { .avatars {
display: inline-flex; /* Causes LI items to display in row. */ display: flex;
list-style-type: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
// For hiding overflowing elements
flex-wrap: wrap;
height: 24px;
li.avatars-item { li.avatars-item {
height: 24px; margin: 0 0 5px 5px;
width: 24px;
margin: 0 5px 0 0;
&:first-child { &:first-child {
padding-left: 12px; padding-left: 10px;
} }
&:last-child { .avatar-small {
margin-right: 0;
}
.avatars-img {
border-radius: $fallback--avatarAltRadius; border-radius: $fallback--avatarAltRadius;
border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius); border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
height: 24px; height: 24px;
width: 24px; width: 24px;
background-color: $fallback--lightText;
background-color: var(--lightText, $fallback--lightText);
}
}
}
.transparent-avatar {
.avatars-item {
&:first-child {
position: relative;
.avatars-img {
&::after {
content: '';
position: absolute;
width: 100%;
height: 100%;
background-color: $fallback--faint;
background-color: var(--faint, $fallback--faint);
left: 0;
top: 0;
}
}
} }
} }
} }

View file

@ -135,19 +135,19 @@
<transition name="fade"> <transition name="fade">
<div class="favs-repeated-users" v-if="combinedFavsAndRepeatsAvatars.length > 0 && isFocused"> <div class="favs-repeated-users" v-if="combinedFavsAndRepeatsAvatars.length > 0 && isFocused">
<ul class="stats"> <div class="stats">
<li class="stat-count" v-if="statusFromGlobalRepository.rebloggedBy && statusFromGlobalRepository.rebloggedBy.length > 0"> <div class="stat-count" v-if="statusFromGlobalRepository.rebloggedBy && statusFromGlobalRepository.rebloggedBy.length > 0">
<a class="stat-title">{{ $t('settings.notification_visibility_repeats') }}</a> <a class="stat-title">{{ $t('settings.notification_visibility_repeats') }}</a>
<div class="stat-number">{{ statusFromGlobalRepository.rebloggedBy.length }}</div> <div class="stat-number">{{ statusFromGlobalRepository.rebloggedBy.length }}</div>
</li> </div>
<li class="stat-count" v-if="statusFromGlobalRepository.favoritedBy && statusFromGlobalRepository.favoritedBy.length > 0"> <div class="stat-count" v-if="statusFromGlobalRepository.favoritedBy && statusFromGlobalRepository.favoritedBy.length > 0">
<a class="stat-title">{{ $t('user_card.favorites') }}</a> <a class="stat-title">{{ $t('user_card.favorites') }}</a>
<div class="stat-number">{{ statusFromGlobalRepository.favoritedBy.length }}</div> <div class="stat-number">{{ statusFromGlobalRepository.favoritedBy.length }}</div>
</li> </div>
<li class="avatar-row"> <div class="avatar-row">
<AvatarList :avatars='combinedFavsAndRepeatsAvatars'></AvatarList> <AvatarList :avatars='combinedFavsAndRepeatsAvatars'></AvatarList>
</li> </div>
</ul> </div>
</div> </div>
</transition> </transition>
@ -631,19 +631,15 @@ a.unmute {
} }
.favs-repeated-users { .favs-repeated-users {
margin-top: 0.75em; margin-top: $status-margin;
.stats { .stats {
width: 100%; width: 100%;
margin: 0;
list-style: none;
overflow: hidden;
padding: 0;
display: flex; display: flex;
line-height: 1em; line-height: 1em;
.stat-count { .stat-count {
margin-right: 10px; margin-right: 0.8em;
.stat-title { .stat-title {
color: var(--faint, $fallback--faint); color: var(--faint, $fallback--faint);
@ -651,13 +647,7 @@ a.unmute {
text-transform: uppercase; text-transform: uppercase;
position: relative; position: relative;
margin-bottom: 3px; margin-bottom: 3px;
cursor: pointer;
line-height: 1em; line-height: 1em;
&:hover,
&:focus {
text-decoration: underline;
}
} }
.stat-number { .stat-number {