2023-12-30 05:29:53 +00:00
|
|
|
<template>
|
|
|
|
<div class="page">
|
2024-01-07 01:35:24 +00:00
|
|
|
<Filters :results="total">
|
2023-12-30 05:29:53 +00:00
|
|
|
<div class="filter">
|
|
|
|
<input
|
|
|
|
v-model="q"
|
|
|
|
type="search"
|
|
|
|
placeholder="Search actors"
|
|
|
|
class="input search"
|
|
|
|
@search="search"
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
|
2024-01-05 23:30:30 +00:00
|
|
|
<GenderFilter
|
|
|
|
:filters="filters"
|
|
|
|
@update="updateFilter"
|
|
|
|
/>
|
2023-12-31 02:02:03 +00:00
|
|
|
|
2024-01-05 23:30:30 +00:00
|
|
|
<BirthdateFilter
|
|
|
|
:filters="filters"
|
|
|
|
@update="updateFilter"
|
|
|
|
/>
|
2023-12-31 02:02:03 +00:00
|
|
|
|
2024-01-05 23:30:30 +00:00
|
|
|
<BoobsFilter
|
|
|
|
:filters="filters"
|
2024-01-07 01:35:24 +00:00
|
|
|
:cup-range="cupRange"
|
2024-01-05 23:30:30 +00:00
|
|
|
@update="updateFilter"
|
|
|
|
/>
|
2023-12-31 02:02:03 +00:00
|
|
|
|
2024-01-05 23:30:30 +00:00
|
|
|
<PhysiqueFilter
|
|
|
|
:filters="filters"
|
|
|
|
@update="updateFilter"
|
|
|
|
/>
|
2023-12-31 02:02:03 +00:00
|
|
|
|
2024-01-05 23:30:30 +00:00
|
|
|
<CountryFilter
|
|
|
|
:filters="filters"
|
|
|
|
:countries="countries"
|
|
|
|
@update="updateFilter"
|
|
|
|
/>
|
2023-12-31 02:02:03 +00:00
|
|
|
|
2023-12-30 05:29:53 +00:00
|
|
|
<div class="filter">
|
|
|
|
<Checkbox
|
2023-12-31 02:02:03 +00:00
|
|
|
:checked="filters.avatarRequired"
|
2023-12-30 05:29:53 +00:00
|
|
|
label="Require photo"
|
2023-12-31 02:02:03 +00:00
|
|
|
@change="(checked) => updateFilter('avatarRequired', checked, true)"
|
2023-12-30 05:29:53 +00:00
|
|
|
/>
|
|
|
|
</div>
|
2024-01-05 23:30:30 +00:00
|
|
|
</Filters>
|
|
|
|
|
|
|
|
<div class="actors-container">
|
|
|
|
<div class="actors-header">
|
|
|
|
<div class="meta">
|
|
|
|
<span class="count">{{ total }} results</span>
|
2024-01-04 00:49:16 +00:00
|
|
|
|
2024-01-05 23:30:30 +00:00
|
|
|
<select
|
|
|
|
v-model="order"
|
|
|
|
class="input"
|
|
|
|
@change="search"
|
2024-01-04 00:49:16 +00:00
|
|
|
>
|
2024-01-05 23:30:30 +00:00
|
|
|
<option value="name.asc">Name</option>
|
|
|
|
<option value="likes.desc">Likes</option>
|
|
|
|
<option value="scenes.desc">Scenes</option>
|
2024-01-08 01:21:57 +00:00
|
|
|
<option
|
|
|
|
value="relevance.desc"
|
|
|
|
:disabled="!q"
|
|
|
|
>Relevance</option>
|
2024-01-05 23:30:30 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
2024-01-04 00:49:16 +00:00
|
|
|
</div>
|
2024-01-05 23:30:30 +00:00
|
|
|
|
|
|
|
<ul class="actors nolist">
|
|
|
|
<li
|
|
|
|
v-for="actor in actors"
|
|
|
|
:key="`actor-${actor.id}`"
|
|
|
|
>
|
|
|
|
<ActorTile
|
|
|
|
:actor="actor"
|
|
|
|
/>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<Pagination
|
|
|
|
:page="currentPage"
|
|
|
|
:total="total"
|
|
|
|
:redirect="false"
|
|
|
|
@navigation="paginate"
|
|
|
|
/>
|
2024-01-04 00:49:16 +00:00
|
|
|
</div>
|
2023-12-30 05:29:53 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
2024-01-05 23:30:30 +00:00
|
|
|
import { ref, inject } from 'vue';
|
2024-01-03 01:52:41 +00:00
|
|
|
import { format, subYears } from 'date-fns';
|
2023-12-30 05:29:53 +00:00
|
|
|
|
|
|
|
import navigate from '#/src/navigate.js';
|
|
|
|
import { get } from '#/src/api.js';
|
2024-01-05 23:30:30 +00:00
|
|
|
import events from '#/src/events.js';
|
2023-12-30 05:29:53 +00:00
|
|
|
|
|
|
|
import ActorTile from '#/components/actors/tile.vue';
|
2024-01-04 00:49:16 +00:00
|
|
|
import Pagination from '#/components/pagination/pagination.vue';
|
2023-12-30 05:29:53 +00:00
|
|
|
import Checkbox from '#/components/form/checkbox.vue';
|
2024-01-05 23:30:30 +00:00
|
|
|
import Filters from '#/components/filters/filters.vue';
|
|
|
|
import GenderFilter from '#/components/filters/gender.vue';
|
|
|
|
import BirthdateFilter from '#/components/filters/birthdate.vue';
|
|
|
|
import BoobsFilter from '#/components/filters/boobs.vue';
|
|
|
|
import PhysiqueFilter from '#/components/filters/physique.vue';
|
|
|
|
import CountryFilter from '#/components/filters/country.vue';
|
2023-12-30 05:29:53 +00:00
|
|
|
|
2024-01-04 00:49:16 +00:00
|
|
|
const pageContext = inject('pageContext');
|
|
|
|
const { pageProps, urlParsed, routeParams } = pageContext;
|
2023-12-31 02:02:03 +00:00
|
|
|
|
|
|
|
const q = ref(urlParsed.search.q);
|
2023-12-30 05:29:53 +00:00
|
|
|
const actors = ref([]);
|
2023-12-31 02:02:03 +00:00
|
|
|
const countries = ref(pageProps.countries);
|
2024-01-07 01:35:24 +00:00
|
|
|
const cupRange = ref(pageProps.cupRange);
|
2023-12-30 05:29:53 +00:00
|
|
|
|
2024-01-03 01:52:41 +00:00
|
|
|
actors.value = pageProps.actors;
|
2023-12-31 02:02:03 +00:00
|
|
|
|
2024-01-04 00:49:16 +00:00
|
|
|
const currentPage = ref(Number(routeParams.page));
|
|
|
|
const total = ref(Number(pageProps.total));
|
2024-01-05 23:30:30 +00:00
|
|
|
const order = ref(urlParsed.search.order || 'likes.desc');
|
2024-01-04 00:49:16 +00:00
|
|
|
|
2023-12-30 05:29:53 +00:00
|
|
|
const filters = ref({
|
2023-12-31 02:02:03 +00:00
|
|
|
gender: urlParsed.search.gender,
|
2023-12-30 05:29:53 +00:00
|
|
|
ageRequired: !!urlParsed.search.age,
|
|
|
|
age: urlParsed.search.age?.split(',').map((age) => Number(age)) || [18, 100],
|
2024-01-03 01:52:41 +00:00
|
|
|
dobRequired: !!urlParsed.search.dob,
|
|
|
|
dobType: urlParsed.search.dobt ? ({ bd: 'birthday', dob: 'dob' })[urlParsed.search.dobt] : 'birthday',
|
|
|
|
dob: urlParsed.search.dob || format(subYears(new Date(), 21), 'yyyy-MM-dd'),
|
|
|
|
country: urlParsed.search.c,
|
2023-12-31 02:02:03 +00:00
|
|
|
braSizeRequired: !!urlParsed.search.cup,
|
|
|
|
braSize: urlParsed.search.cup?.split(',') || ['A', 'Z'],
|
|
|
|
naturalBoobs: urlParsed.search.nb ? urlParsed.search.nb === 'true' : undefined,
|
2023-12-30 05:29:53 +00:00
|
|
|
heightRequired: !!urlParsed.search.height,
|
|
|
|
height: urlParsed.search.height?.split(',').map((height) => Number(height)) || [50, 220],
|
|
|
|
weightRequired: !!urlParsed.search.weight,
|
|
|
|
weight: urlParsed.search.weight?.split(',').map((weight) => Number(weight)) || [30, 200],
|
2023-12-31 02:02:03 +00:00
|
|
|
avatarRequired: !!urlParsed.search.avatar,
|
2023-12-30 05:29:53 +00:00
|
|
|
});
|
|
|
|
|
2024-01-04 00:49:16 +00:00
|
|
|
async function search(resetPage = true) {
|
|
|
|
if (resetPage) {
|
|
|
|
currentPage.value = 1;
|
|
|
|
}
|
2024-01-03 01:52:41 +00:00
|
|
|
|
2024-01-08 01:21:57 +00:00
|
|
|
if (q.value) {
|
|
|
|
order.value = 'relevance.desc';
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!q.value && order.value.includes('relevance')) {
|
|
|
|
order.value = 'likes.desc';
|
|
|
|
}
|
|
|
|
|
2023-12-30 05:29:53 +00:00
|
|
|
const query = {
|
|
|
|
q: q.value || undefined,
|
2024-01-05 23:30:30 +00:00
|
|
|
order: order.value,
|
2023-12-31 02:02:03 +00:00
|
|
|
gender: filters.value.gender || undefined,
|
2023-12-30 05:29:53 +00:00
|
|
|
age: filters.value.ageRequired ? filters.value.age.join(',') : undefined,
|
2024-01-03 01:52:41 +00:00
|
|
|
dob: filters.value.dobRequired ? filters.value.dob : undefined,
|
|
|
|
dobt: filters.value.dobRequired ? ({ birthday: 'bd', dob: 'dob' })[filters.value.dobType] : undefined,
|
2023-12-31 02:02:03 +00:00
|
|
|
cup: filters.value.braSizeRequired ? filters.value.braSize.join(',') : undefined,
|
2024-01-03 01:52:41 +00:00
|
|
|
c: filters.value.country || undefined,
|
2023-12-31 02:02:03 +00:00
|
|
|
nb: filters.value.naturalBoobs,
|
2023-12-30 05:29:53 +00:00
|
|
|
height: filters.value.heightRequired ? filters.value.height.join(',') : undefined,
|
|
|
|
weight: filters.value.weightRequired ? filters.value.weight.join(',') : undefined,
|
2023-12-31 02:02:03 +00:00
|
|
|
avatar: filters.value.avatarRequired || undefined,
|
2023-12-30 05:29:53 +00:00
|
|
|
};
|
|
|
|
|
2024-01-05 23:30:30 +00:00
|
|
|
const res = await get('/actors', {
|
|
|
|
...query,
|
|
|
|
page: currentPage.value, // client uses param rather than query pagination
|
|
|
|
});
|
2023-12-30 05:29:53 +00:00
|
|
|
|
|
|
|
actors.value = res.actors;
|
2024-01-04 00:49:16 +00:00
|
|
|
total.value = res.total;
|
|
|
|
|
2023-12-31 02:02:03 +00:00
|
|
|
countries.value = res.countries;
|
2024-01-04 00:49:16 +00:00
|
|
|
|
2024-01-05 23:30:30 +00:00
|
|
|
events.emit('scrollUp');
|
2024-01-04 00:49:16 +00:00
|
|
|
navigate(`/actors/${currentPage.value}`, query, { redirect: false });
|
|
|
|
}
|
|
|
|
|
|
|
|
function paginate({ page }) {
|
|
|
|
currentPage.value = page;
|
|
|
|
search(false);
|
2023-12-30 05:29:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function updateFilter(prop, value, reload = true) {
|
|
|
|
filters.value[prop] = value;
|
|
|
|
|
|
|
|
if (reload) {
|
|
|
|
search();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2023-12-31 02:02:03 +00:00
|
|
|
<style>
|
|
|
|
.gender-button {
|
|
|
|
&.selected .gender .icon {
|
|
|
|
fill: var(--text-light);
|
|
|
|
filter: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover:not(.selected) {
|
|
|
|
.gender .icon {
|
|
|
|
fill: var(--text-light);
|
|
|
|
}
|
|
|
|
|
|
|
|
.male .icon {
|
|
|
|
filter: drop-shadow(0 0 1px var(--male));
|
|
|
|
}
|
|
|
|
|
|
|
|
.female .icon {
|
|
|
|
filter: drop-shadow(0 0 1px var(--female));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover:not(.selected) .transsexual .icon {
|
|
|
|
fill: var(--female);
|
|
|
|
filter: drop-shadow(1px 0 0 var(--text-light)) drop-shadow(-1px 0 0 var(--text-light)) drop-shadow(0 1px 0 var(--text-light)) drop-shadow(0 -1px 0 var(--text-light)) drop-shadow(1px 0 0 var(--male)) drop-shadow(-1px 0 0 var(--male)) drop-shadow(0 1px 0 var(--male)) drop-shadow(0 -1px 0 var(--male)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.5));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2023-12-30 05:29:53 +00:00
|
|
|
<style scoped>
|
|
|
|
.page {
|
2024-01-05 23:30:30 +00:00
|
|
|
min-height: 100%;
|
2023-12-30 05:29:53 +00:00
|
|
|
display: flex;
|
2024-01-05 23:30:30 +00:00
|
|
|
align-items: stretch;
|
2023-12-30 05:29:53 +00:00
|
|
|
}
|
|
|
|
|
2024-01-05 23:30:30 +00:00
|
|
|
.actors-header {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2024-01-07 01:35:24 +00:00
|
|
|
padding: .5rem 0 .25rem 2rem;
|
2024-01-04 00:49:16 +00:00
|
|
|
}
|
|
|
|
|
2024-01-05 23:30:30 +00:00
|
|
|
.meta {
|
2024-01-04 00:49:16 +00:00
|
|
|
display: flex;
|
2024-01-05 23:30:30 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
justify-content: space-between;
|
2024-01-04 00:49:16 +00:00
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.actors-container {
|
2024-01-05 23:30:30 +00:00
|
|
|
display: flex;
|
|
|
|
flex-grow: 1;
|
|
|
|
flex-direction: column;
|
2024-01-04 00:49:16 +00:00
|
|
|
box-sizing: border-box;
|
2024-01-05 23:30:30 +00:00
|
|
|
padding: 0 1rem 1rem 1rem;
|
2023-12-30 05:29:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.actors {
|
|
|
|
display: grid;
|
|
|
|
flex-grow: 1;
|
2024-01-04 00:49:16 +00:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
|
2023-12-30 05:29:53 +00:00
|
|
|
gap: .25rem;
|
|
|
|
}
|
|
|
|
</style>
|