Pinafore-Web-Client-Frontend/routes/_components/AccountProfile.html

210 lines
5.6 KiB
HTML
Raw Normal View History

<div class="account-profile {{headerIsMissing ? 'header-is-missing' : ''}}"
style="background-image: url({{$autoplayGifs ? profile.header : profile.header_static}});">
2018-01-28 23:17:37 +01:00
<div class="account-profile-grid-wrapper">
<div class="account-profile-backdrop"></div>
<div class="account-profile-grid">
<div class="account-profile-avatar">
<Avatar account="{{profile}}" size="big" />
2018-01-28 23:17:37 +01:00
</div>
<div class="account-profile-name">
2018-02-10 23:35:21 +01:00
<ExternalLink href="{{profile.url}}" showIcon="true" normalIconColor="true">
2018-02-19 19:59:03 +01:00
{{profile.display_name || profile.acct}}
2018-01-29 04:01:51 +01:00
</ExternalLink>
2018-01-28 23:17:37 +01:00
</div>
2018-01-29 01:34:18 +01:00
<div class="account-profile-username">
{{'@' + profile.acct}}
</div>
2018-01-28 23:17:37 +01: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
2018-02-19 19:59:03 +01:00
label="{{following ? 'Unfollow' : 'Follow'}}"
href="{{following ? '#fa-user-times' : '#fa-user-plus'}}"
pressable="true"
pressed="{{following}}"
2018-01-28 23:17:37 +01:00
big="true"
/>
{{/if}}
</div>
<div class="account-profile-note">
2018-02-12 08:07:48 +01:00
{{{massagedNote}}}
2018-01-28 23:17:37 +01:00
</div>
2018-01-28 09:29:45 +01: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 21:51:48 +01:00
background-color: #ccc;
2018-01-28 09:29:45 +01:00
}
2018-01-28 23:17:37 +01:00
.account-profile-backdrop {
2018-01-28 09:29:45 +01:00
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
z-index: 5;
}
.account-profile-grid {
display: grid;
2018-01-28 21:51:48 +01:00
grid-template-areas: "avatar name followed-by follow"
2018-01-29 01:34:18 +01:00
"avatar username username follow"
"avatar note note follow";
2018-01-28 09:49:51 +01:00
grid-template-columns: min-content auto 1fr min-content;
2018-01-28 09:29:45 +01:00
grid-column-gap: 10px;
2018-01-29 01:34:18 +01:00
grid-row-gap: 5px;
2018-01-29 01:44:13 +01:00
padding: 20px;
2018-01-28 09:29:45 +01:00
justify-content: center;
2018-01-28 23:17:37 +01:00
z-index: 10;
position: relative;
2018-01-28 09:29:45 +01:00
}
2018-01-28 23:05:48 +01:00
@supports (-webkit-backdrop-filter: blur(1px) saturate(1%)) or (backdrop-filter: blur(1px) saturate(1%)) {
2018-01-28 23:17:37 +01:00
:global(.account-profile-grid-wrapper) {
2018-01-28 23:05:48 +01: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 09:29:45 +01:00
}
}
2018-01-28 23:05:48 +01:00
@supports not ((-webkit-backdrop-filter: blur(1px) saturate(1%)) or (backdrop-filter: blur(1px) saturate(1%))) {
2018-01-28 23:17:37 +01:00
:global(.account-profile-grid-wrapper) {
2018-01-28 09:29:45 +01:00
background-color: rgba(255, 255, 255, 0.9);
}
}
2018-01-28 21:51:48 +01:00
.account-profile-followed-by {
grid-area: followed-by;
2018-01-28 09:29:45 +01:00
align-self: center;
text-transform: uppercase;
color: var(--deemphasized-text-color);
font-size: 0.8em;
}
2018-01-28 21:51:48 +01:00
.account-profile-followed-by span {
2018-01-28 09:29:45 +01:00
background: rgba(30, 30, 30, 0.2);
border-radius: 4px;
padding: 3px 5px;
2018-01-28 09:49:51 +01:00
white-space: nowrap;
2018-01-28 09:29:45 +01:00
}
.account-profile-avatar {
grid-area: avatar;
}
2018-01-29 01:34:18 +01: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 09:29:45 +01:00
.account-profile-follow {
grid-area: follow;
2018-01-29 01:34:18 +01:00
align-self: flex-start;
2018-01-28 09:29:45 +01: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 09:49:51 +01:00
min-width: 0;
2018-01-28 09:29:45 +01:00
}
2018-01-29 04:01:51 +01:00
:global(.account-profile-name a) {
2018-01-29 02:10:03 +01:00
color: var(--body-text-color);
text-decoration: none;
}
2018-01-29 04:01:51 +01:00
:global(.account-profile-name a:hover) {
2018-01-29 02:10:03 +01:00
color: var(--body-text-color);
text-decoration: underline;
}
2018-01-28 09:29:45 +01:00
.account-profile-note {
grid-area: note;
2018-01-29 01:34:18 +01:00
padding: 10px 0;
2018-01-31 07:40:40 +01:00
font-size: 0.9em;
word-wrap: break-word;
overflow: hidden;
white-space: pre-wrap;
2018-01-28 09:29:45 +01:00
}
2018-01-31 07:40:40 +01:00
2018-01-28 09:29:45 +01:00
:global(.account-profile-note p) {
2018-01-31 07:40:40 +01: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 09:29:45 +01:00
}
2018-01-29 01:34:18 +01:00
@media (max-width: 767px) {
.account-profile-name {
2018-01-31 07:40:40 +01:00
font-size: 1.3em;
2018-01-29 01:34:18 +01: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 07:40:40 +01:00
padding: 10px;
2018-01-29 01:34:18 +01:00
}
.account-profile-note {
2018-01-29 01:35:35 +01:00
padding: 5px 0;
2018-01-29 01:34:18 +01:00
}
.account-profile-username {
2018-01-31 07:40:40 +01:00
font-size: 1.1em;
2018-01-29 01:34:18 +01:00
}
.account-profile-name, .account-profile-username {
align-self: flex-start;
}
}
2018-01-28 09:29:45 +01:00
</style>
<script>
2018-01-28 21:51:48 +01:00
import IconButton from './IconButton.html'
2018-01-29 04:01:51 +01:00
import ExternalLink from './ExternalLink.html'
2018-02-09 02:56:20 +01:00
import Avatar from './Avatar.html'
import { store } from '../_store/store'
2018-01-28 21:51:48 +01:00
2018-01-28 09:29:45 +01:00
export default {
computed: {
2018-02-12 08:07:48 +01:00
headerIsMissing: (profile) => profile.header.endsWith('missing.png'),
note: (profile) => profile.note,
massagedNote: (note) => {
// GNU Social / Pleroma don't add <p> tags
if (!note.startsWith('<p>')) {
note = `<p>${note}</p>`
}
return note
2018-02-19 19:59:03 +01:00
},
following: (relationship) => relationship && relationship.following
2018-01-28 21:51:48 +01:00
},
store: () => store,
2018-01-28 21:51:48 +01:00
components: {
2018-01-29 04:01:51 +01:00
IconButton,
ExternalLink,
Avatar
2018-01-28 09:29:45 +01:00
}
}
</script>