Fixed various actor filters. Improved tag bar scroll behavior.

This commit is contained in:
DebaucheryLibrarian 2024-03-24 18:16:10 +01:00
parent 3f266630b4
commit 28a91efd33
6 changed files with 39 additions and 18 deletions

View File

@ -70,7 +70,7 @@
>Relevance</option> >Relevance</option>
<option value="name.asc">Name</option> <option value="name.asc">Name</option>
<option value="likes.desc">Likes</option> <option value="likes.desc">Popular</option>
<option value="scenes.desc">Scenes</option> <option value="scenes.desc">Scenes</option>
</select> </select>
</div> </div>
@ -261,10 +261,19 @@ function updateFilter(prop, value, reload = true) {
align-items: stretch; align-items: stretch;
} }
.actors-container {
display: flex;
flex-grow: 1;
flex-direction: column;
box-sizing: border-box;
padding: 0 1rem 1rem 1rem;
}
.actors-header { .actors-header {
display: flex; display: flex;
align-items: center; align-items: center;
padding: .5rem 0 .25rem 2rem; padding: .5rem 0 .25rem 2.25rem;
margin-bottom: .25rem;
} }
.meta { .meta {
@ -274,14 +283,6 @@ function updateFilter(prop, value, reload = true) {
align-items: center; align-items: center;
} }
.actors-container {
display: flex;
flex-grow: 1;
flex-direction: column;
box-sizing: border-box;
padding: 0 1rem 1rem 1rem;
}
.actors { .actors {
display: grid; display: grid;
flex-grow: 1; flex-grow: 1;

View File

@ -104,7 +104,7 @@
class="menu-button nolink" class="menu-button nolink"
> >
<Icon icon="user7" /> <Icon icon="user7" />
View profile My profile
</a> </a>
</li> </li>

View File

@ -461,7 +461,7 @@ async function unstash() {
} }
.title { .title {
margin: 0 .5rem 0 0; margin: 0 .5rem 1rem 0;
line-height: 1.25; line-height: 1.25;
display: -webkit-box; display: -webkit-box;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;

View File

@ -94,20 +94,25 @@ const categoryTitles = {
const activeCategory = ref(null); const activeCategory = ref(null);
function calculateActiveCategory() { function calculateActiveCategory() {
activeCategory.value = Array.from(document.querySelectorAll('.tags')).reduce((closest, element) => { const newCategory = Array.from(document.querySelectorAll('.tags')).reduce((closest, element) => {
const { top } = element.getBoundingClientRect(); const { top } = element.getBoundingClientRect();
if (!closest || Math.abs(top) < Math.abs(closest.top)) { if (!closest || Math.abs(top - 200) < Math.abs(closest.top)) { // slight offset to include bottom category
return { category: element.dataset.category, top }; return { category: element.dataset.category, top };
} }
return closest; return closest;
}, null).category; }, null).category;
if (newCategory === activeCategory.value) {
return;
}
activeCategory.value = newCategory;
const activeLink = document.querySelector(`a[href="#${activeCategory.value}"]`); const activeLink = document.querySelector(`a[href="#${activeCategory.value}"]`);
activeLink.scrollIntoView({ activeLink.scrollIntoView({
behavior: 'smooth',
inline: 'center', inline: 'center',
}); });

View File

@ -32,6 +32,7 @@ const tagSlugs = {
'piercings', 'piercings',
], ],
lgbt: [ lgbt: [
'lesbian',
'gay', 'gay',
'bisexual', 'bisexual',
'transsexual', 'transsexual',

View File

@ -367,12 +367,24 @@ async function queryManticoreSql(filters, options, _reqUser) {
builder.whereRaw('match(\'@name :query:\', actors)', { query: filters.query }); builder.whereRaw('match(\'@name :query:\', actors)', { query: filters.query });
} }
['gender', 'country'].forEach((attribute) => { // attribute filters
['country'].forEach((attribute) => {
if (filters[attribute]) { if (filters[attribute]) {
builder.where(attribute, filters[attribute]); builder.where(attribute, filters[attribute]);
} }
}); });
if (filters.gender === 'other') {
builder.whereNull('gender');
} else if (filters.gender) {
builder.where('gender', filters.gender);
}
if (filters.age) {
builder.select('if(date_of_birth, floor((now() - date_of_birth) / 31556952), 0) as age');
}
// range filters
['age', 'height'].forEach((attribute) => { ['age', 'height'].forEach((attribute) => {
if (filters[attribute]) { if (filters[attribute]) {
builder builder
@ -396,9 +408,11 @@ async function queryManticoreSql(filters, options, _reqUser) {
const month = filters.dateOfBirth.getMonth() + 1; const month = filters.dateOfBirth.getMonth() + 1;
const day = filters.dateOfBirth.getDate(); const day = filters.dateOfBirth.getDate();
builder.select('month(date_of_birth) as month_of_birth, day(date_of_birth) as day_of_birth');
builder builder
.where('month(date_of_birth)', month) .where('month_of_birth', month)
.where('day(date_of_birth)', day); .where('day_of_birth', day);
} }
if (filters.cup) { if (filters.cup) {