diff --git a/app/javascript/mastodon/features/explore/suggestions.js b/app/javascript/mastodon/features/explore/suggestions.js
index c094a8d934..0c6a7ef8a3 100644
--- a/app/javascript/mastodon/features/explore/suggestions.js
+++ b/app/javascript/mastodon/features/explore/suggestions.js
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
-import Account from 'mastodon/containers/account_container';
+import AccountCard from 'mastodon/features/directory/components/account_card';
import LoadingIndicator from 'mastodon/components/loading_indicator';
import { connect } from 'react-redux';
import { fetchSuggestions } from 'mastodon/actions/suggestions';
@@ -29,9 +29,9 @@ class Suggestions extends React.PureComponent {
const { isLoading, suggestions } = this.props;
return (
-
- {isLoading ? (
) : suggestions.map(suggestion => (
-
+
+ {isLoading ?
: suggestions.map(suggestion => (
+
))}
);
diff --git a/app/javascript/styles/mastodon-light/diff.scss b/app/javascript/styles/mastodon-light/diff.scss
index 8e6b0cdd5b..eb6bdea990 100644
--- a/app/javascript/styles/mastodon-light/diff.scss
+++ b/app/javascript/styles/mastodon-light/diff.scss
@@ -40,19 +40,11 @@ html {
background: lighten($ui-base-color, 12%);
}
-.filter-form,
-.directory__card__bar {
+.filter-form {
background: $white;
border-bottom: 1px solid lighten($ui-base-color, 8%);
}
-.scrollable .directory__list {
- width: calc(100% + 2px);
- margin-left: -1px;
- margin-right: -1px;
-}
-
-.directory__card,
.table-of-contents {
border: 1px solid lighten($ui-base-color, 8%);
}
@@ -75,8 +67,7 @@ html {
.column-header__back-button,
.column-header__button,
.column-header__button.active,
-.account__header__bar,
-.directory__card__extra {
+.account__header__bar {
background: $white;
}
diff --git a/app/javascript/styles/mastodon/admin.scss b/app/javascript/styles/mastodon/admin.scss
index 06ec4d37bc..42f055618b 100644
--- a/app/javascript/styles/mastodon/admin.scss
+++ b/app/javascript/styles/mastodon/admin.scss
@@ -1220,6 +1220,11 @@ a.sparkline {
background: $ui-base-color;
border-radius: 4px;
+ &__permalink {
+ color: inherit;
+ text-decoration: none;
+ }
+
&__header {
padding: 4px;
border-radius: 4px;
@@ -1236,20 +1241,22 @@ a.sparkline {
}
&__title {
- margin-top: -25px;
+ margin-top: -(15px + 8px);
display: flex;
align-items: flex-end;
&__avatar {
- padding: 15px;
+ padding: 14px;
- img {
+ img,
+ .account__avatar {
display: block;
margin: 0;
width: 56px;
height: 56px;
- background: darken($ui-base-color, 8%);
+ background-color: darken($ui-base-color, 8%);
border-radius: 8px;
+ border: 1px solid $ui-base-color;
}
}
@@ -1257,30 +1264,34 @@ a.sparkline {
color: $darker-text-color;
padding-bottom: 15px;
font-size: 15px;
+ line-height: 20px;
bdi {
display: block;
color: $primary-text-color;
- font-weight: 500;
+ font-weight: 700;
}
}
}
&__bio {
padding: 0 15px;
+ margin: 8px 0;
overflow: hidden;
text-overflow: ellipsis;
word-wrap: break-word;
- max-height: 18px * 2;
+ max-height: 21px * 2;
position: relative;
+ font-size: 15px;
+ line-height: 21px;
&::after {
display: block;
content: "";
width: 50px;
- height: 18px;
+ height: 21px;
position: absolute;
- bottom: 0;
+ bottom: 8px;
right: 15px;
background: linear-gradient(to left, $ui-base-color, transparent);
pointer-events: none;
@@ -1293,10 +1304,6 @@ a.sparkline {
&:hover {
text-decoration: underline;
-
- .fa {
- color: lighten($dark-text-color, 7%);
- }
}
&.mention {
@@ -1313,12 +1320,21 @@ a.sparkline {
&__actions {
display: flex;
+ justify-content: space-between;
align-items: center;
- padding-top: 10px;
&__button {
- flex: 0 0 auto;
+ flex-shrink: 1;
padding: 0 15px;
+ overflow: hidden;
+
+ .button {
+ min-width: 0;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ max-width: 100%;
+ }
}
}
@@ -1327,19 +1343,23 @@ a.sparkline {
display: grid;
grid-auto-columns: minmax(0, 1fr);
grid-auto-flow: column;
+ max-width: 340px;
+ min-width: 65px * 3;
&__item {
- padding: 15px;
+ padding: 15px 0;
text-align: center;
color: $primary-text-color;
font-weight: 600;
font-size: 15px;
+ line-height: 21px;
small {
display: block;
color: $darker-text-color;
font-weight: 400;
font-size: 13px;
+ line-height: 18px;
}
}
}
diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss
index b8c3dba615..5d0d44b73e 100644
--- a/app/javascript/styles/mastodon/components.scss
+++ b/app/javascript/styles/mastodon/components.scss
@@ -50,7 +50,7 @@
cursor: pointer;
display: inline-block;
font-family: inherit;
- font-size: 17px;
+ font-size: 15px;
font-weight: 500;
letter-spacing: 0;
line-height: 22px;
@@ -2333,17 +2333,7 @@ a.account__display-name {
padding: 0;
}
- .directory__list {
- display: grid;
- grid-gap: 10px;
- grid-template-columns: minmax(0, 50%) minmax(0, 50%);
-
- @media screen and (max-width: $no-gap-breakpoint) {
- display: block;
- }
- }
-
- .directory__card {
+ .account-card {
margin-bottom: 0;
}
@@ -6219,136 +6209,20 @@ a.status-card.compact:hover {
}
}
-.directory {
- &__list {
- width: 100%;
- margin: 10px 0;
- transition: opacity 100ms ease-in;
+.scrollable .account-card {
+ margin: 10px;
+ background: lighten($ui-base-color, 8%);
+}
- &.loading {
- opacity: 0.7;
- }
-
- @media screen and (max-width: $no-gap-breakpoint) {
- margin: 0;
- }
+.scrollable .account-card__title__avatar {
+ img,
+ .account__avatar {
+ border-color: lighten($ui-base-color, 8%);
}
+}
- &__card {
- box-sizing: border-box;
- margin-bottom: 10px;
-
- &__img {
- height: 125px;
- position: relative;
- background: darken($ui-base-color, 12%);
- overflow: hidden;
-
- img {
- display: block;
- width: 100%;
- height: 100%;
- margin: 0;
- object-fit: cover;
- }
- }
-
- &__bar {
- display: flex;
- align-items: center;
- background: lighten($ui-base-color, 4%);
- padding: 10px;
-
- &__name {
- flex: 1 1 auto;
- display: flex;
- align-items: center;
- text-decoration: none;
- overflow: hidden;
- }
-
- &__relationship {
- width: 23px;
- min-height: 1px;
- flex: 0 0 auto;
- }
-
- .avatar {
- flex: 0 0 auto;
- width: 48px;
- height: 48px;
- padding-top: 2px;
-
- img {
- width: 100%;
- height: 100%;
- display: block;
- margin: 0;
- border-radius: 4px;
- background: darken($ui-base-color, 8%);
- object-fit: cover;
- }
- }
-
- .display-name {
- margin-left: 15px;
- text-align: left;
-
- strong {
- font-size: 15px;
- color: $primary-text-color;
- font-weight: 500;
- overflow: hidden;
- text-overflow: ellipsis;
- }
-
- span {
- display: block;
- font-size: 14px;
- color: $darker-text-color;
- font-weight: 400;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
- }
-
- &__extra {
- background: $ui-base-color;
- display: flex;
- align-items: center;
- justify-content: center;
-
- .accounts-table__count {
- width: 33.33%;
- flex: 0 0 auto;
- padding: 15px 0;
- }
-
- .account__header__content {
- box-sizing: border-box;
- padding: 15px 10px;
- border-bottom: 1px solid lighten($ui-base-color, 8%);
- width: 100%;
- min-height: 18px + 30px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
-
- p {
- display: none;
-
- &:first-child {
- display: inline;
- }
- }
-
- br {
- display: none;
- }
- }
- }
- }
+.scrollable .account-card__bio::after {
+ background: linear-gradient(to left, lighten($ui-base-color, 8%), transparent);
}
.account-gallery__container {
@@ -6452,6 +6326,7 @@ a.status-card.compact:hover {
&__column {
padding: 10px 15px;
+ padding-bottom: 0;
}
.radio-button {
diff --git a/app/javascript/styles/mastodon/containers.scss b/app/javascript/styles/mastodon/containers.scss
index a180df437a..81459f5ba5 100644
--- a/app/javascript/styles/mastodon/containers.scss
+++ b/app/javascript/styles/mastodon/containers.scss
@@ -409,14 +409,6 @@
}
}
- .directory__card {
- border-radius: 4px;
-
- @media screen and (max-width: $no-gap-breakpoint) {
- border-radius: 0;
- }
- }
-
.page-header {
@media screen and (max-width: $no-gap-breakpoint) {
border-bottom: 0;
@@ -835,19 +827,21 @@
grid-gap: 10px;
grid-template-columns: minmax(0, 50%) minmax(0, 50%);
+ .account-card {
+ display: flex;
+ flex-direction: column;
+ }
+
@media screen and (max-width: $no-gap-breakpoint) {
display: block;
- }
- .icon-button {
- font-size: 18px;
+ .account-card {
+ margin-bottom: 10px;
+ display: block;
+ }
}
}
- .directory__card {
- margin-bottom: 0;
- }
-
.card-grid {
display: flex;
flex-wrap: wrap;
diff --git a/app/javascript/styles/mastodon/rtl.scss b/app/javascript/styles/mastodon/rtl.scss
index ea7bb5113c..98eb1511cc 100644
--- a/app/javascript/styles/mastodon/rtl.scss
+++ b/app/javascript/styles/mastodon/rtl.scss
@@ -12,11 +12,6 @@ body.rtl {
margin-left: 10px;
}
- .directory__card__bar .display-name {
- margin-left: 0;
- margin-right: 15px;
- }
-
.display-name,
.announcements__item {
text-align: right;
diff --git a/app/views/directories/index.html.haml b/app/views/directories/index.html.haml
index 04639e32c2..2b338115bd 100644
--- a/app/views/directories/index.html.haml
+++ b/app/views/directories/index.html.haml
@@ -19,37 +19,36 @@
- else
.directory__list
- @accounts.each do |account|
- .directory__card
- .directory__card__img
- = image_tag account.header.url, alt: ''
- .directory__card__bar
- = link_to TagManager.instance.url_for(account), class: 'directory__card__bar__name' do
- .avatar
- = image_tag account.avatar.url, alt: '', class: 'u-photo'
-
+ .account-card
+ = link_to TagManager.instance.url_for(account), class: 'account-card__permalink' do
+ .account-card__header
+ = image_tag account.header.url, alt: ''
+ .account-card__title
+ .account-card__title__avatar
+ = image_tag account.avatar.url, alt: ''
.display-name
%bdi
%strong.emojify.p-name= display_name(account, custom_emojify: true)
- %span= acct(account)
- .directory__card__bar__relationship.account__relationship
- = minimal_account_action_button(account)
-
- .directory__card__extra
- .account__header__content.emojify= Formatter.instance.simplified_format(account, custom_emojify: true)
-
- .directory__card__extra
- .accounts-table__count
- = friendly_number_to_human account.statuses_count
- %small= t('accounts.posts', count: account.statuses_count).downcase
- .accounts-table__count
- = friendly_number_to_human account.followers_count
- %small= t('accounts.followers', count: account.followers_count).downcase
- .accounts-table__count
- - if account.last_status_at.present?
- %time.time-ago{ datetime: account.last_status_at.to_date.iso8601, title: l(account.last_status_at.to_date) }= l account.last_status_at.to_date
- - else
- = t('accounts.never_active')
-
- %small= t('accounts.last_active')
+ %span
+ = acct(account)
+ = fa_icon('lock') if account.locked?
+ - if account.note.present?
+ .account-card__bio.emojify
+ = Formatter.instance.simplified_format(account, custom_emojify: true)
+ - else
+ .flex-spacer
+ .account-card__actions
+ .account-card__counters
+ .account-card__counters__item
+ = friendly_number_to_human account.statuses_count
+ %small= t('accounts.posts', count: account.statuses_count).downcase
+ .account-card__counters__item
+ = friendly_number_to_human account.followers_count
+ %small= t('accounts.followers', count: account.followers_count).downcase
+ .account-card__counters__item
+ = friendly_number_to_human account.following_count
+ %small= t('accounts.following', count: account.following_count).downcase
+ .account-card__actions__button
+ = account_action_button(account)
= paginate @accounts
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 2367d5ded4..1964285b05 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -72,7 +72,6 @@ en:
media: Media
moved_html: "%{name} has moved to %{new_profile_link}:"
network_hidden: This information is not available
- never_active: Never
nothing_here: There is nothing here!
people_followed_by: People whom %{name} follows
people_who_follow: People who follow %{name}