pinafore/routes/_components/AccountProfile.html

203 lines
5.3 KiB
HTML
Raw Normal View History

2018-01-28 08:29:45 +00:00
<div class="account-profile {{headerIsMissing ? 'header-is-missing' : ''}}" style="background-image: url({{profile.header}});">
2018-01-28 22:17:37 +00:00
<div class="account-profile-grid-wrapper">
<div class="account-profile-backdrop"></div>
<div class="account-profile-grid">
<div class="account-profile-avatar">
<img src="{{profile.avatar}}" aria-hidden="true">
</div>
<div class="account-profile-name">
2018-01-29 03:01:51 +00:00
<ExternalLink href="{{profile.url}}">
2018-01-29 01:10:03 +00:00
{{profile.display_name}}
2018-01-29 03:01:51 +00:00
</ExternalLink>
2018-01-28 22:17:37 +00:00
</div>
2018-01-29 00:34:18 +00:00
<div class="account-profile-username">
{{'@' + profile.acct}}
</div>
2018-01-28 22:17:37 +00:00
<div class="account-profile-followed-by">
{{#if relationship && relationship.followed_by}}
<span>
Follows you
</span>
{{/if}}
</div>
<div class="account-profile-follow">
{{#if verifyCredentials && relationship && verifyCredentials.id !== relationship.id}}
<IconButton
label="{{relationship && relationship.following ? 'Unfollow' : 'Follow'}}"
href="{{relationship && relationship.following ? '#fa-user-times' : '#fa-user-plus'}}"
big="true"
/>
{{/if}}
</div>
<div class="account-profile-note">
{{{profile.note}}}
</div>
2018-01-28 08:29:45 +00:00
</div>
</div>
</div>
<style>
.account-profile {
position: relative;
background-size: cover;
background-position: center;
padding-top: 175px;
}
.account-profile.header-is-missing {
padding-top: 0;
2018-01-28 20:51:48 +00:00
background-color: #ccc;
2018-01-28 08:29:45 +00:00
}
2018-01-28 22:17:37 +00:00
.account-profile-backdrop {
2018-01-28 08:29:45 +00:00
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
z-index: 5;
}
.account-profile-grid {
display: grid;
2018-01-28 20:51:48 +00:00
grid-template-areas: "avatar name followed-by follow"
2018-01-29 00:34:18 +00:00
"avatar username username follow"
"avatar note note follow";
2018-01-28 08:49:51 +00:00
grid-template-columns: min-content auto 1fr min-content;
2018-01-28 08:29:45 +00:00
grid-column-gap: 10px;
2018-01-29 00:34:18 +00:00
grid-row-gap: 5px;
2018-01-29 00:44:13 +00:00
padding: 20px;
2018-01-28 08:29:45 +00:00
justify-content: center;
2018-01-28 22:17:37 +00:00
z-index: 10;
position: relative;
2018-01-28 08:29:45 +00:00
}
2018-01-28 22:05:48 +00:00
@supports (-webkit-backdrop-filter: blur(1px) saturate(1%)) or (backdrop-filter: blur(1px) saturate(1%)) {
2018-01-28 22:17:37 +00:00
:global(.account-profile-grid-wrapper) {
2018-01-28 22:05:48 +00:00
-webkit-backdrop-filter: blur(7px) saturate(110%);
backdrop-filter: blur(7px) saturate(110%);
background-color: rgba(255, 255, 255, 0.7);
2018-01-28 08:29:45 +00:00
}
}
2018-01-28 22:05:48 +00:00
@supports not ((-webkit-backdrop-filter: blur(1px) saturate(1%)) or (backdrop-filter: blur(1px) saturate(1%))) {
2018-01-28 22:17:37 +00:00
:global(.account-profile-grid-wrapper) {
2018-01-28 08:29:45 +00:00
background-color: rgba(255, 255, 255, 0.9);
}
}
2018-01-28 20:51:48 +00:00
.account-profile-followed-by {
grid-area: followed-by;
2018-01-28 08:29:45 +00:00
align-self: center;
text-transform: uppercase;
color: var(--deemphasized-text-color);
font-size: 0.8em;
}
2018-01-28 20:51:48 +00:00
.account-profile-followed-by span {
2018-01-28 08:29:45 +00:00
background: rgba(30, 30, 30, 0.2);
border-radius: 4px;
padding: 3px 5px;
2018-01-28 08:49:51 +00:00
white-space: nowrap;
2018-01-28 08:29:45 +00:00
}
.account-profile-avatar {
grid-area: avatar;
}
.account-profile-avatar img {
border-radius: 4px;
width: 100px;
height: 100px;
}
2018-01-29 00:34:18 +00:00
.account-profile-username {
grid-area: username;
color: var(--deemphasized-text-color);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
align-self: center;
}
2018-01-28 08:29:45 +00:00
.account-profile-follow {
grid-area: follow;
2018-01-29 00:34:18 +00:00
align-self: flex-start;
2018-01-28 08:29:45 +00:00
}
.account-profile-name {
grid-area: name;
font-size: 1.5em;
align-self: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
2018-01-28 08:49:51 +00:00
min-width: 0;
2018-01-28 08:29:45 +00:00
}
2018-01-29 03:01:51 +00:00
:global(.account-profile-name a) {
2018-01-29 01:10:03 +00:00
color: var(--body-text-color);
text-decoration: none;
}
2018-01-29 03:01:51 +00:00
:global(.account-profile-name a:hover) {
2018-01-29 01:10:03 +00:00
color: var(--body-text-color);
text-decoration: underline;
}
2018-01-28 08:29:45 +00:00
.account-profile-note {
grid-area: note;
2018-01-29 00:34:18 +00:00
padding: 10px 0;
2018-01-31 06:40:40 +00:00
font-size: 0.9em;
word-wrap: break-word;
overflow: hidden;
white-space: pre-wrap;
2018-01-28 08:29:45 +00:00
}
2018-01-31 06:40:40 +00:00
2018-01-28 08:29:45 +00:00
:global(.account-profile-note p) {
2018-01-31 06:40:40 +00:00
margin: 0 0 20px;
}
:global(.account-profile-note p:first-child) {
margin: 0 0 20px;
}
:global(.account-profile-note p:last-child) {
margin: 0;
2018-01-28 08:29:45 +00:00
}
2018-01-29 00:34:18 +00:00
@media (max-width: 767px) {
.account-profile-avatar img {
width: 80px;
height: 80px;
}
.account-profile-name {
2018-01-31 06:40:40 +00:00
font-size: 1.3em;
2018-01-29 00:34:18 +00:00
}
.account-profile-grid {
display: grid;
grid-template-areas: "avatar name follow"
"avatar username follow"
"avatar followed-by follow"
"note note note";
grid-template-columns: min-content minmax(auto, 1fr) min-content;
grid-template-rows: min-content min-content 1fr min-content;
2018-01-31 06:40:40 +00:00
padding: 10px;
2018-01-29 00:34:18 +00:00
}
.account-profile-note {
2018-01-29 00:35:35 +00:00
padding: 5px 0;
2018-01-29 00:34:18 +00:00
}
.account-profile-username {
2018-01-31 06:40:40 +00:00
font-size: 1.1em;
2018-01-29 00:34:18 +00:00
}
.account-profile-name, .account-profile-username {
align-self: flex-start;
}
}
2018-01-28 08:29:45 +00:00
</style>
<script>
2018-01-28 20:51:48 +00:00
import IconButton from './IconButton.html'
2018-01-29 03:01:51 +00:00
import ExternalLink from './ExternalLink.html'
2018-01-28 20:51:48 +00:00
2018-01-28 08:29:45 +00:00
export default {
computed: {
headerIsMissing: (profile) => profile.header.endsWith('missing.png')
2018-01-28 20:51:48 +00:00
},
components: {
2018-01-29 03:01:51 +00:00
IconButton,
ExternalLink
2018-01-28 08:29:45 +00:00
}
}
</script>