Separated actor profile header for permanent display when scrolling.

This commit is contained in:
2020-01-23 04:32:22 +01:00
parent 5a51e20966
commit e8c6d7def6
2 changed files with 165 additions and 84 deletions

View File

@@ -5,6 +5,50 @@
>
<FilterBar :fetch-releases="fetchActor" />
<div class="actor-header">
<h2 class="header-name">
{{ actor.name }}
<span
v-if="actor.gender"
class="header-gender"
:class="{ [actor.gender]: true }"
><Icon :icon="actor.gender" /></span>
</h2>
<li
v-if="actor.aliases.length"
class="bio-item"
>
<dfn class="bio-label">Also known as</dfn>
<span>{{ actor.aliases.join(', ') }}</span>
</li>
<div
v-if="actor.social && actor.social.length > 0"
class="social header-social"
>
<a
v-for="social in actor.social"
:key="`social-${social.id}`"
v-tooltip.bottom="social.url"
:href="social.url"
target="_blank"
rel="noopener noreferrer"
class="social-link"
>
<Icon
v-if="social.platform"
:icon="social.platform"
/>
<Icon
v-else
icon="link"
/>
</a>
</div>
</div>
<div class="actor-inner">
<div class="profile">
<a
@@ -21,23 +65,6 @@
</a>
<ul class="bio nolist">
<li class="bio-header">
<h2 class="bio-name">{{ actor.name }}</h2>
<span
v-if="actor.gender"
class="bio-gender"
:class="{ [actor.gender]: true }"
><Icon :icon="actor.gender" /></span>
</li>
<li
v-if="actor.aliases.length"
class="bio-item"
>
<dfn class="bio-label">Also known as</dfn>
<span>{{ actor.aliases.join(', ') }}</span>
</li>
<li
v-if="actor.birthdate"
class="bio-item"
@@ -182,37 +209,10 @@
<li class="bio-item scraped">Updated on {{ formatDate(actor.scrapedAt, 'YYYY-MM-DD HH:mm') }}</li>
</ul>
<div class="extra">
<p
v-if="actor.description"
class="description"
>{{ actor.description }}</p>
<li
v-if="actor.social && actor.social.length > 0"
class="social"
>
<a
v-for="social in actor.social"
:key="`social-${social.id}`"
v-tooltip.bottom="social.url"
:href="social.url"
target="_blank"
rel="noopener noreferrer"
class="social-link"
>
<Icon
v-if="social.platform"
:icon="social.platform"
/>
<Icon
v-else
icon="link"
/>
</a>
</li>
</div>
<p
v-if="actor.description"
class="description"
>{{ actor.description }}</p>
</div>
@@ -250,7 +250,7 @@ function scrollPhotos(event) {
}
async function mounted() {
this.fetchActor();
await this.fetchActor();
if (this.actor) {
this.pageTitle = this.actor.name;
@@ -282,6 +282,40 @@ export default {
<style lang="scss" scoped>
@import 'theme';
.actor-header {
display: flex;
justify-content: space-between;
align-items: center;
color: $highlight-extreme;
background: $profile;
padding: .75rem 1rem;
}
.header-name {
padding: 0;
margin: 0;
display: inline-flex;
justify-content: space-between;
flex-shrink: 0;
}
.header-gender {
display: inline-block;
margin: 0 0 0 .25rem;
transform: translate(0, .1rem);
.icon {
width: 1.25rem;
height: 1.25rem;
}
}
.header-social {
overflow: hidden;
white-space: nowrap;
margin: 0 1rem 0 0;
}
.actor-inner {
height: 100%;
display: flex;
@@ -298,7 +332,6 @@ export default {
display: flex;
flex-direction: row;
flex-shrink: 0;
padding: 1rem 0 0 0;
.avatar-link {
font-size: 0;
@@ -333,7 +366,7 @@ export default {
}
.bio-item {
width: calc(50% - 2rem);
width: calc(50% - 4rem);
display: flex;
justify-content: space-between;
box-sizing: border-box;
@@ -390,6 +423,10 @@ export default {
height: 1.25rem;
}
}
.header-gender,
.bio-gender {
&.female .icon {
fill: $female;
}
@@ -437,15 +474,12 @@ export default {
font-size: .8rem;
}
.extra {
flex-grow: 1;
max-width: 40rem;
}
.description {
max-width: 30rem;
max-height: 12rem;
position: relative;
display: block;
flex-grow: 1;
box-sizing: border-box;
margin: 0 2rem 0 0;
line-height: 1.5;
@@ -461,12 +495,11 @@ export default {
.social {
display: block;
margin: 1rem 0;
}
.social-link {
display: inline-block;
padding: 0 1rem 0 0;
padding: 0 0 0 1rem;
.icon {
color: $highlight;
@@ -515,8 +548,7 @@ export default {
}
@media(max-width: $breakpoint3) {
.profile .avatar-link,
.extra {
.profile .avatar-link {
display: none;
}
@@ -541,6 +573,7 @@ export default {
@media(max-width: $breakpoint) {
.profile {
height: auto;
flex-direction: column;
padding: 0 0 .5rem 0;
}
@@ -551,8 +584,9 @@ export default {
margin: 0;
}
.bio-header {
margin: 1rem 0;
.bio-item {
width: auto;
margin: 0;
}
.city,
@@ -565,9 +599,15 @@ export default {
.scraped {
display: none;
}
}
.social {
padding: 0 1rem;
@media(max-width: $breakpoint0) {
.header-social {
display: none;
}
.header-name {
flex-grow: 1;
}
}
</style>