Added working minimum cup size slider.

This commit is contained in:
DebaucheryLibrarian 2021-03-02 02:30:44 +01:00
parent d6bebd8fec
commit 408066aba0
4 changed files with 16 additions and 5 deletions

View File

@ -79,7 +79,8 @@
class="range" class="range"
type="range" type="range"
min="0" min="0"
max="10" max="6"
@change="updateFilters"
> >
<span <span
@ -148,6 +149,7 @@ import Gender from './gender.vue';
import Pagination from '../pagination/pagination.vue'; import Pagination from '../pagination/pagination.vue';
const toggleValues = [true, undefined, false]; const toggleValues = [true, undefined, false];
const cupSizes = ['A', 'B', 'C', 'D', 'E', 'F', 'G'];
function updateFilters() { function updateFilters() {
this.$router.push({ this.$router.push({
@ -155,6 +157,7 @@ function updateFilters() {
params: this.$route.params, params: this.$route.params,
query: { query: {
naturalBoobs: toggleValues[this.naturalBoobs], naturalBoobs: toggleValues[this.naturalBoobs],
cup: [cupSizes[this.boobSize]],
}, },
}); });
} }
@ -172,6 +175,7 @@ async function fetchActors(scroll) {
pageNumber: Number(this.$route.params.pageNumber) || 1, pageNumber: Number(this.$route.params.pageNumber) || 1,
letter: this.letter.replace('all', ''), letter: this.letter.replace('all', ''),
gender: curatedGender === 'other' ? null : curatedGender, gender: curatedGender === 'other' ? null : curatedGender,
cup: [...cupSizes.slice(this.boobSize)],
naturalBoobs: toggleValues[this.naturalBoobs] ?? null, naturalBoobs: toggleValues[this.naturalBoobs] ?? null,
}); });
@ -220,7 +224,7 @@ export default {
totalCount: 0, totalCount: 0,
limit: 50, limit: 50,
letters: ['all'].concat(Array.from({ length: 26 }, (value, index) => String.fromCharCode(index + 97).toUpperCase())), letters: ['all'].concat(Array.from({ length: 26 }, (value, index) => String.fromCharCode(index + 97).toUpperCase())),
boobSize: 0, boobSize: cupSizes.indexOf(this.$route.query.cup || 'A'),
naturalBoobs: naturalBoobs > -1 ? naturalBoobs : 1, naturalBoobs: naturalBoobs > -1 ? naturalBoobs : 1,
}; };
}, },

View File

@ -174,9 +174,9 @@ export default {
box-sizing: border-box; box-sizing: border-box;
padding: .5rem; padding: .5rem;
color: var(--text-light); color: var(--text-light);
background: var(--shadow); background: var(--darken);
font-size: .9rem; font-size: .9rem;
text-shadow: 0 0 3px var(--shadow); text-shadow: 0 0 3px var(--darken);
white-space: normal; white-space: normal;
line-height: 1.25; line-height: 1.25;
transform: translateY(100%); transform: translateY(100%);

View File

@ -3,7 +3,6 @@
<div <div
ref="trigger" ref="trigger"
class="trigger noselect" class="trigger noselect"
@mouseenter="toggle"
@click.stop="toggle" @click.stop="toggle"
> >
<slot /> <slot />

View File

@ -267,16 +267,20 @@ function initActorActions(store, router) {
letter, letter,
gender, gender,
naturalBoobs, naturalBoobs,
cup,
}) { }) {
const genderFilter = (gender === null && 'gender: { isNull: true }') const genderFilter = (gender === null && 'gender: { isNull: true }')
|| (gender === 'all' && ' ') || (gender === 'all' && ' ')
|| `gender: { equalTo: "${gender}" }`; || `gender: { equalTo: "${gender}" }`;
console.log(cup);
const { connection: { actors, totalCount } } = await graphql(` const { connection: { actors, totalCount } } = await graphql(`
query Actors( query Actors(
$limit: Int, $limit: Int,
$offset: Int = 0, $offset: Int = 0,
$letter: String! = "", $letter: String! = "",
$cup: [String!]
$naturalBoobs: Boolean, $naturalBoobs: Boolean,
) { ) {
connection: actorsConnection( connection: actorsConnection(
@ -293,6 +297,9 @@ function initActorActions(store, router) {
naturalBoobs: { naturalBoobs: {
equalTo: $naturalBoobs equalTo: $naturalBoobs
} }
cup: {
in: $cup
}
${genderFilter} ${genderFilter}
} }
) { ) {
@ -347,6 +354,7 @@ function initActorActions(store, router) {
offset: Math.max(0, (pageNumber - 1)) * limit, offset: Math.max(0, (pageNumber - 1)) * limit,
limit, limit,
letter, letter,
cup,
naturalBoobs, naturalBoobs,
}); });