Added rudimentary affiliate banner setup. Separated login and signup disable. Added various tag photos.

This commit is contained in:
DebaucheryLibrarian
2021-06-28 00:05:24 +02:00
parent d1480da076
commit eb7009832a
61 changed files with 548 additions and 17 deletions

View File

@@ -47,6 +47,27 @@
@close="$router.replace({ hash: undefined })"
/>
<div class="campaign-container">
<a
v-if="campaign"
:href="campaign.affiliate.url"
target="_blank"
class="campaign"
>
<img
v-if="campaign.banner.entity.type === 'network'"
:src="`/img/banners/${campaign.banner.entity.slug}/${campaign.banner.id}.jpeg`"
class="campaign-banner"
>
<img
v-if="campaign.banner.entity.type === 'channel' && campaign.banner.entity.parent?.type === 'network'"
:src="`/img/banners/${campaign.banner.entity.parent.slug}/${campaign.banner.entity.slug}/${campaign.banner.id}.jpeg`"
class="campaign-banner"
>
</a>
</div>
<FilterBar
ref="filter"
:fetch-releases="fetchReleases"
@@ -94,6 +115,15 @@ async function fetchReleases(scroll = true) {
this.hasMedia = this.tag.poster || this.tag.photos.length > 0;
this.description = this.tag.description && converter.makeHtml(escapeHtml(this.tag.description));
if (tag.banners.length > 0) {
const banner = tag.banners[Math.floor(Math.random() * tag.banners.length)];
this.campaign = {
...banner.campaigns[Math.floor(Math.random() * banner.campaigns.length)],
banner,
};
}
if (scroll && this.$refs.filter) {
this.$refs.filter.$el.scrollIntoView();
}
@@ -133,6 +163,7 @@ export default {
pageTitle: null,
hasMedia: false,
expanded: false,
campaign: null,
};
},
computed: {
@@ -172,12 +203,14 @@ export default {
@import 'theme';
.header {
display: flex;
background: var(--profile);
color: var(--text-light);
justify-content: space-between;
}
.title {
display: inline-block;
padding: .5rem 1rem;
margin: 0;
flex-shrink: 0;
@@ -200,4 +233,21 @@ export default {
.scroll {
background: var(--background-dim);
}
.campaign-container {
max-height: 90px;
padding: .5rem 1rem 0 1rem;
background: var(--background-dim);
text-align: center;
}
.campaign {
display: inline-block;
height: 100%;
.campaign-banner {
max-height: 100%;
max-width: 100%;
}
}
</style>