Fixed various actor filters. Improved tag bar scroll behavior.

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

View File

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

View File

@@ -94,20 +94,25 @@ const categoryTitles = {
const activeCategory = ref(null);
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();
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 closest;
}, null).category;
if (newCategory === activeCategory.value) {
return;
}
activeCategory.value = newCategory;
const activeLink = document.querySelector(`a[href="#${activeCategory.value}"]`);
activeLink.scrollIntoView({
behavior: 'smooth',
inline: 'center',
});

View File

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