Fixed actor boolean logic, addressing missing boob, tattoo and piercing info. Removed scroll background, fixed actor photo load event and padding.

This commit is contained in:
DebaucheryLibrarian 2020-12-29 04:20:13 +01:00
parent 0f88ae324e
commit 0f052a0631
4 changed files with 29 additions and 31 deletions

View File

@ -318,13 +318,14 @@
<div class="actor-content"> <div class="actor-content">
<Scroll <Scroll
v-if="actor.avatar || (actor.photos && actor.photos.length > 0)" v-if="actor.avatar || (actor.photos && actor.photos.length > 0)"
v-slot="scroll"
:expanded="photosExpanded" :expanded="photosExpanded"
class="scroll-light"
@expand="(state) => photosExpanded = state" @expand="(state) => photosExpanded = state"
> >
<Photos <Photos
:actor="actor" :actor="actor"
:class="{ expanded: photosExpanded }" :class="{ expanded: photosExpanded }"
@load="scroll.loaded"
/> />
</Scroll> </Scroll>
@ -683,10 +684,6 @@ export default {
margin: 0 0 1rem 0; margin: 0 0 1rem 0;
} }
.photos {
background: var(--background-dim);
}
.profile-social { .profile-social {
display: none; display: none;
} }
@ -696,6 +693,7 @@ export default {
} }
.scroll { .scroll {
background: var(--background-dim);
border-bottom: solid 1px var(--shadow-hint); border-bottom: solid 1px var(--shadow-hint);
} }

View File

@ -19,7 +19,7 @@
:title="actor.avatar.credit && `© ${actor.avatar.credit}`" :title="actor.avatar.credit && `© ${actor.avatar.credit}`"
loading="lazy" loading="lazy"
class="avatar photo" class="avatar photo"
@load="$parent.$emit('load')" @load="$emit('load', $event)"
> >
</a> </a>
@ -37,7 +37,7 @@
:title="`© ${photo.credit || photo.entity.name}`" :title="`© ${photo.credit || photo.entity.name}`"
loading="lazy" loading="lazy"
class="photo" class="photo"
@load="$parent.$emit('load')" @load="$emit('load', $event)"
> >
</a> </a>
</div> </div>
@ -59,6 +59,7 @@ export default {
default: null, default: null,
}, },
}, },
emits: ['load'],
computed: { computed: {
sfw, sfw,
photos, photos,
@ -73,7 +74,6 @@ export default {
display: flex; display: flex;
box-sizing: border-box; box-sizing: border-box;
padding: .5rem 1rem; padding: .5rem 1rem;
margin: 0 1rem 0 0;
font-size: 0; font-size: 0;
&.expanded { &.expanded {
@ -100,7 +100,11 @@ export default {
} }
.photo-link { .photo-link {
margin: 0 .5rem 0 0; padding: 0 .5rem 0 0;
&:last-child {
padding: 0 1rem 0 0;
}
} }
.photo { .photo {

View File

@ -84,7 +84,7 @@ function mounted() {
this.updateScroll(); this.updateScroll();
} }
function beforeDestroy() { function beforeUnmount() {
this.$refs.content.removeEventListener('scroll', this.updateScroll); this.$refs.content.removeEventListener('scroll', this.updateScroll);
window.removeEventListener('resize', this.updateScroll); window.removeEventListener('resize', this.updateScroll);
@ -121,7 +121,7 @@ export default {
}, },
mounted, mounted,
updated, updated,
beforeDestroy, beforeUnmount,
methods: { methods: {
scroll, scroll,
loaded, loaded,
@ -133,15 +133,11 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import 'theme'; @import 'theme';
.scroll { .scroll.expanded {
background: var(--profile); padding: 0;
&.expanded { .scroll {
padding: 0; display: none;
.scroll {
display: none;
}
} }
} }

View File

@ -348,24 +348,24 @@ async function curateProfile(profile, actor) {
curatedProfile.penisGirth = Number(profile.penisGirth) || profile.penisGirth?.match?.(/\d+/)?.[0] || null; curatedProfile.penisGirth = Number(profile.penisGirth) || profile.penisGirth?.match?.(/\d+/)?.[0] || null;
curatedProfile.circumcised = (typeof profile.circumcised === 'boolean' && profile.circumcised) curatedProfile.circumcised = (typeof profile.circumcised === 'boolean' && profile.circumcised)
|| (/yes/i.test(profile.circumcised) && true) ?? (/yes/i.test(profile.circumcised) && true)
|| (/no/i.test(profile.circumcised) && false) ?? (/no/i.test(profile.circumcised) && false)
|| null; ?? null;
curatedProfile.naturalBoobs = (typeof profile.naturalBoobs === 'boolean' && profile.naturalBoobs) curatedProfile.naturalBoobs = (typeof profile.naturalBoobs === 'boolean' && profile.naturalBoobs)
|| (/yes/i.test(profile.naturalBoobs) && true) ?? (/yes/i.test(profile.naturalBoobs) && true)
|| (/no/i.test(profile.naturalBoobs) && false) ?? (/no/i.test(profile.naturalBoobs) && false)
|| null; ?? null;
curatedProfile.hasTattoos = (typeof profile.hasTattoos === 'boolean' && profile.hasTattoos) curatedProfile.hasTattoos = (typeof profile.hasTattoos === 'boolean' && profile.hasTattoos)
|| (/yes/i.test(profile.hasTattoos) && true) ?? (/yes/i.test(profile.hasTattoos) && true)
|| (/no/i.test(profile.hasTattoos) && true) ?? (/no/i.test(profile.hasTattoos) && true)
|| null; ?? null;
curatedProfile.hasPiercings = (typeof profile.hasPiercings === 'boolean' && profile.hasPiercings) curatedProfile.hasPiercings = (typeof profile.hasPiercings === 'boolean' && profile.hasPiercings)
|| (/yes/i.test(profile.hasPiercings) && true) ?? (/yes/i.test(profile.hasPiercings) && true)
|| (/no/i.test(profile.hasPiercings) && true) ?? (/no/i.test(profile.hasPiercings) && true)
|| null; ?? null;
if (argv.resolvePlace) { if (argv.resolvePlace) {
const [placeOfBirth, placeOfResidence] = await Promise.all([ const [placeOfBirth, placeOfResidence] = await Promise.all([