Compare commits
No commits in common. "d42d2802985c86e5bf99fb49a85d4a1de020e830" and "b2dadf16937184deeabe9f66c751329ab5f004e2" have entirely different histories.
d42d280298
...
b2dadf1693
|
@ -104,7 +104,6 @@ const favorited = ref(props.actor.stashes.some((actorStash) => actorStash.id ===
|
||||||
border-radius: .25rem;
|
border-radius: .25rem;
|
||||||
box-shadow: 0 0 3px var(--shadow-weak-30);
|
box-shadow: 0 0 3px var(--shadow-weak-30);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: var(--background);
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
box-shadow: 0 0 3px var(--shadow-weak-20);
|
box-shadow: 0 0 3px var(--shadow-weak-20);
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="campaign">
|
|
||||||
<a
|
|
||||||
:href="campaign.url"
|
|
||||||
target="_blank"
|
|
||||||
class="campaign-link"
|
|
||||||
>
|
|
||||||
<img
|
|
||||||
v-if="campaign.banner"
|
|
||||||
:src="getBanner(campaign)"
|
|
||||||
class="campaign-banner"
|
|
||||||
>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
const props = defineProps({
|
|
||||||
campaign: {
|
|
||||||
type: Object,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(props.campaign?.banner);
|
|
||||||
|
|
||||||
function getBanner(campaign) {
|
|
||||||
if (campaign.banner.entity.type === 'network' || !campaign.banner.entity.parent) {
|
|
||||||
return `/banners/${campaign.banner.entity.slug}/${campaign.banner.id}.${campaign.banner.type || 'jpg'}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (campaign.banner.entity.type === 'channel' && campaign.banner.entity.parent?.type === 'network') {
|
|
||||||
return `/banners/${campaign.banner.entity.parent.slug}/${campaign.banner.entity.slug}/${campaign.banner.id}.${campaign.banner.type || 'jpg'}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.campaign {
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.campaign-banner {
|
|
||||||
max-height: 100%;
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
|
@ -5,7 +5,7 @@
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
v-if="entity.hasLogo"
|
v-if="entity.hasLogo"
|
||||||
:src="entity.type === 'network' || entity.isIndependent ? `/logos/${entity.slug}/thumbs/network.png` : `/logos/${entity.parent?.slug}/thumbs/${entity.slug}.png`"
|
:src="entity.type === 'network' || entity.isIndependent ? `/logos/${entity.slug}/network.png` : `/logos/${entity.parent?.slug}/${entity.slug}.png`"
|
||||||
:alt="entity.name"
|
:alt="entity.name"
|
||||||
class="logo"
|
class="logo"
|
||||||
>
|
>
|
||||||
|
@ -33,7 +33,7 @@ defineProps({
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
border-radius: .5rem;
|
border-radius: .5rem;
|
||||||
background: var(--shadow-strong-30);
|
background: var(--shadow-strong-40);
|
||||||
color: var(--text-light);
|
color: var(--text-light);
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
|
@ -438,7 +438,7 @@ function blurSearch(event) {
|
||||||
width: 1.25rem;
|
width: 1.25rem;
|
||||||
padding-left: 1rem;
|
padding-left: 1rem;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
fill: var(--glass);
|
fill: var(--glass-strong-20);
|
||||||
}
|
}
|
||||||
|
|
||||||
.notifs-trigger {
|
.notifs-trigger {
|
||||||
|
|
|
@ -105,21 +105,12 @@
|
||||||
<ul
|
<ul
|
||||||
class="scenes nolist"
|
class="scenes nolist"
|
||||||
>
|
>
|
||||||
<template v-for="item in campaignScenes">
|
<li
|
||||||
<li
|
v-for="scene in scenes"
|
||||||
v-if="item === 'campaign' && campaign"
|
:key="`scene-${scene.id}`"
|
||||||
:key="`campaign-${item.id}`"
|
>
|
||||||
>
|
<SceneTile :scene="scene" />
|
||||||
<Campaign :campaign="campaign" />
|
</li>
|
||||||
</li>
|
|
||||||
|
|
||||||
<li
|
|
||||||
v-else
|
|
||||||
:key="`scene-${item.id}`"
|
|
||||||
>
|
|
||||||
<SceneTile :scene="item" />
|
|
||||||
</li>
|
|
||||||
</template>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<Pagination
|
<Pagination
|
||||||
|
@ -136,7 +127,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, inject } from 'vue';
|
import { ref, inject } from 'vue';
|
||||||
import { parse } from 'path-to-regexp';
|
import { parse } from 'path-to-regexp';
|
||||||
|
|
||||||
import navigate from '#/src/navigate.js';
|
import navigate from '#/src/navigate.js';
|
||||||
|
@ -149,7 +140,6 @@ import ActorsFilter from '#/components/filters/actors.vue';
|
||||||
import TagsFilter from '#/components/filters/tags.vue';
|
import TagsFilter from '#/components/filters/tags.vue';
|
||||||
import ChannelsFilter from '#/components/filters/channels.vue';
|
import ChannelsFilter from '#/components/filters/channels.vue';
|
||||||
import SceneTile from '#/components/scenes/tile.vue';
|
import SceneTile from '#/components/scenes/tile.vue';
|
||||||
import Campaign from '#/components/campaigns/campaign.vue';
|
|
||||||
import Pagination from '#/components/pagination/pagination.vue';
|
import Pagination from '#/components/pagination/pagination.vue';
|
||||||
import Ellipsis from '#/components/loading/ellipsis.vue';
|
import Ellipsis from '#/components/loading/ellipsis.vue';
|
||||||
|
|
||||||
|
@ -206,11 +196,6 @@ const filters = ref({
|
||||||
actors: queryActors,
|
actors: queryActors,
|
||||||
});
|
});
|
||||||
|
|
||||||
const campaign = pageProps.campaigns?.scenes;
|
|
||||||
const campaignIndex = pageProps.campaigns?.index;
|
|
||||||
|
|
||||||
const campaignScenes = computed(() => scenes.value.flatMap((scene, index) => (index === campaignIndex ? ['campaign', scene] : scene)));
|
|
||||||
|
|
||||||
function getPath(targetScope, preserveQuery) {
|
function getPath(targetScope, preserveQuery) {
|
||||||
const path = parse(routeParams.path).map((segment) => {
|
const path = parse(routeParams.path).map((segment) => {
|
||||||
if (segment.name === 'scope') {
|
if (segment.name === 'scope') {
|
||||||
|
@ -297,7 +282,6 @@ function updateFilter(prop, value, reload = true) {
|
||||||
display: flex;
|
display: flex;
|
||||||
background: var(--background-base-10);
|
background: var(--background-base-10);
|
||||||
position: relative;
|
position: relative;
|
||||||
flex-grow: 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.scenes-header {
|
.scenes-header {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx-web",
|
"name": "traxxx-web",
|
||||||
"version": "0.25.0",
|
"version": "0.24.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"version": "0.25.0",
|
"version": "0.24.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@brillout/json-serializer": "^0.5.8",
|
"@brillout/json-serializer": "^0.5.8",
|
||||||
"@dicebear/collection": "^7.0.5",
|
"@dicebear/collection": "^7.0.5",
|
||||||
|
|
|
@ -77,5 +77,5 @@
|
||||||
"postcss-custom-media": "^10.0.2",
|
"postcss-custom-media": "^10.0.2",
|
||||||
"postcss-nesting": "^12.0.2"
|
"postcss-nesting": "^12.0.2"
|
||||||
},
|
},
|
||||||
"version": "0.25.0"
|
"version": "0.24.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@ async function login() {
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
userInput.value?.focus();
|
userInput.value.focus();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,6 @@ const popularNetworks = [
|
||||||
'hussiepass',
|
'hussiepass',
|
||||||
'julesjordan',
|
'julesjordan',
|
||||||
'kink',
|
'kink',
|
||||||
'mikeadriano',
|
|
||||||
'mofos',
|
'mofos',
|
||||||
'naughtyamerica',
|
'naughtyamerica',
|
||||||
'newsensations',
|
'newsensations',
|
||||||
|
|
|
@ -119,11 +119,13 @@ const scrollable = computed(() => children.value?.scrollWidth > children.value?.
|
||||||
.page {
|
.page {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
overflow-y: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
overflow-y: auto;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,20 +133,12 @@ const scrollable = computed(() => children.value?.scrollWidth > children.value?.
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
position: sticky;
|
|
||||||
top: 0;
|
|
||||||
z-index: 1;
|
|
||||||
color: var(--text-light);
|
color: var(--text-light);
|
||||||
background: var(--grey-dark-50);
|
background: var(--grey-dark-50);
|
||||||
|
|
||||||
.link {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
height: 2rem;
|
height: 2.5rem;
|
||||||
max-width: 15rem;
|
max-width: 15rem;
|
||||||
padding: .75rem 1rem;
|
padding: .75rem 1rem;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
|
@ -158,7 +152,6 @@ const scrollable = computed(() => children.value?.scrollWidth > children.value?.
|
||||||
.favicon {
|
.favicon {
|
||||||
display: none;
|
display: none;
|
||||||
padding: .75rem 1rem;
|
padding: .75rem 1rem;
|
||||||
height: 1.5rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.children-container {
|
.children-container {
|
||||||
|
@ -229,11 +222,7 @@ const scrollable = computed(() => children.value?.scrollWidth > children.value?.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media(--compact) {
|
@media(--small-10) {
|
||||||
.logo {
|
|
||||||
height: 1.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo-parent {
|
.logo-parent {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -241,6 +230,12 @@ const scrollable = computed(() => children.value?.scrollWidth > children.value?.
|
||||||
.favicon {
|
.favicon {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media(--compact) {
|
||||||
|
.logo {
|
||||||
|
height: 1.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
.expand-text {
|
.expand-text {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -250,16 +245,4 @@ const scrollable = computed(() => children.value?.scrollWidth > children.value?.
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media(--small-20) {
|
|
||||||
.logo {
|
|
||||||
height: 1rem;
|
|
||||||
padding: .5rem 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.favicon {
|
|
||||||
height: 1rem;
|
|
||||||
padding: .5rem 1rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -709,7 +709,6 @@ function copySummary() {
|
||||||
.detail {
|
.detail {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
flex-direction: row;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.input {
|
.input {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { fetchScenes } from '#/src/scenes.js';
|
import { fetchScenes } from '#/src/scenes.js';
|
||||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||||
import { getRandomCampaign } from '#/src/campaigns.js';
|
|
||||||
|
|
||||||
export async function onBeforeRender(pageContext) {
|
export async function onBeforeRender(pageContext) {
|
||||||
const withQuery = Object.hasOwn(pageContext.urlParsed.search, 'q');
|
const withQuery = Object.hasOwn(pageContext.urlParsed.search, 'q');
|
||||||
|
@ -19,14 +18,10 @@ export async function onBeforeRender(pageContext) {
|
||||||
tagFilter: pageContext.tagFilter,
|
tagFilter: pageContext.tagFilter,
|
||||||
}), {
|
}), {
|
||||||
page: Number(pageContext.routeParams.page) || 1,
|
page: Number(pageContext.routeParams.page) || 1,
|
||||||
limit: Number(pageContext.urlParsed.search.limit) || 29,
|
limit: Number(pageContext.urlParsed.search.limit) || 30,
|
||||||
aggregate: withQuery,
|
aggregate: withQuery,
|
||||||
}, pageContext.user);
|
}, pageContext.user);
|
||||||
|
|
||||||
// const campaignIndex = Math.floor(Math.random() * (scenes.length - 5)) + 5;
|
|
||||||
const campaignIndex = Math.floor((Math.random() * (0.5 - 0.2) + 0.2) * scenes.length);
|
|
||||||
const sceneCampaign = await getRandomCampaign({ minRatio: 0.75, maxRatio: 1.25 });
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
pageContext: {
|
pageContext: {
|
||||||
title: pageContext.routeParams.scope,
|
title: pageContext.routeParams.scope,
|
||||||
|
@ -37,10 +32,6 @@ export async function onBeforeRender(pageContext) {
|
||||||
aggActors,
|
aggActors,
|
||||||
limit,
|
limit,
|
||||||
total,
|
total,
|
||||||
campaigns: {
|
|
||||||
index: campaignIndex,
|
|
||||||
scenes: sceneCampaign,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,8 +47,6 @@ export function curateActor(actor, context = {}) {
|
||||||
name: actor.birth_country_name,
|
name: actor.birth_country_name,
|
||||||
alias: actor.birth_country_alias,
|
alias: actor.birth_country_alias,
|
||||||
},
|
},
|
||||||
city: actor.birth_city,
|
|
||||||
state: actor.birth_state,
|
|
||||||
},
|
},
|
||||||
residence: actor.residence_country_alpha2 && {
|
residence: actor.residence_country_alpha2 && {
|
||||||
country: actor.residence_country_alpha2 && {
|
country: actor.residence_country_alpha2 && {
|
||||||
|
@ -56,8 +54,6 @@ export function curateActor(actor, context = {}) {
|
||||||
name: actor.residence_country_name,
|
name: actor.residence_country_name,
|
||||||
alias: actor.residence_country_alias,
|
alias: actor.residence_country_alias,
|
||||||
},
|
},
|
||||||
city: actor.residence_city,
|
|
||||||
state: actor.residence_state,
|
|
||||||
},
|
},
|
||||||
avatar: curateMedia(actor.avatar),
|
avatar: curateMedia(actor.avatar),
|
||||||
profiles: context.profiles?.map((profile) => ({
|
profiles: context.profiles?.map((profile) => ({
|
||||||
|
|
|
@ -1,47 +0,0 @@
|
||||||
import { knexOwner as knex } from './knex.js';
|
|
||||||
import { curateEntity } from './entities.js';
|
|
||||||
|
|
||||||
function curateCampaign(campaign) {
|
|
||||||
if (!campaign) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
id: campaign.id,
|
|
||||||
url: campaign.url,
|
|
||||||
banner: campaign.banner && {
|
|
||||||
id: campaign.banner.id,
|
|
||||||
type: campaign.banner.type,
|
|
||||||
entity: campaign.banner_entity && curateEntity({ ...campaign.banner_entity, parent: campaign.banner_parent_entity }),
|
|
||||||
tags: campaign.banner_tags?.map((tag) => ({
|
|
||||||
id: tag.id,
|
|
||||||
slug: tag.slug,
|
|
||||||
name: tag.name,
|
|
||||||
})) || [],
|
|
||||||
},
|
|
||||||
affiliateId: campaign.affiliate_id,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getRandomCampaign(options = {}) {
|
|
||||||
const campaign = await knex.raw(`
|
|
||||||
SELECT
|
|
||||||
campaigns.*, row_to_json(banners) as banner, row_to_json(entities) as banner_entity, row_to_json(parents) as banner_parent_entity, json_agg(tags) filter (where tags.id is not null) as banner_tags
|
|
||||||
FROM campaigns
|
|
||||||
LEFT JOIN banners ON banners.id = campaigns.banner_id
|
|
||||||
LEFT JOIN banners_tags ON banners_tags.banner_id = banners.id
|
|
||||||
LEFT JOIN tags ON tags.id = banners_tags.tag_id
|
|
||||||
LEFT JOIN entities ON entities.id = banners.entity_id
|
|
||||||
LEFT JOIN entities as parents ON parents.id = entities.parent_id
|
|
||||||
WHERE campaigns.banner_id IS NOT NULL
|
|
||||||
AND ratio >= :minRatio
|
|
||||||
AND ratio <= :maxRatio
|
|
||||||
GROUP BY campaigns.id, banners.id, entities.id, parents.id
|
|
||||||
ORDER BY RANDOM()
|
|
||||||
`, {
|
|
||||||
minRatio: options.minRatio || 0,
|
|
||||||
maxRatio: options.maxRatio || 1000,
|
|
||||||
});
|
|
||||||
|
|
||||||
return curateCampaign(campaign.rows[0]);
|
|
||||||
}
|
|
|
@ -12,6 +12,5 @@ export function curateMedia(media) {
|
||||||
width: media.width,
|
width: media.width,
|
||||||
height: media.height,
|
height: media.height,
|
||||||
index: media.index,
|
index: media.index,
|
||||||
credit: media.credit,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
2
static
2
static
|
@ -1 +1 @@
|
||||||
Subproject commit 24d11363ef7632591ec6f49240079259f777ab9e
|
Subproject commit 31759c4a58d789bf6cfa7c96cdae32af42bdf86c
|
Loading…
Reference in New Issue