evazion/translate-pixiv-tags

artist tags below pixiv work thumbnail became ugly

Closed this issue · 0 comments

hdk5 commented

// Related work's artists https://www.pixiv.net/en/artworks/66475847
// New search pages: https://www.pixiv.net/en/tags/%E6%9D%B1%E6%96%B9project/artworks
// Bookmarks: https://www.pixiv.net/en/users/29310/bookmarks/artworks
// Thumbs on the index page: https://www.pixiv.net/ https://www.pixiv.net/en/
// Posts of followed artists: https://www.pixiv.net/bookmark_new_illust.php
findAndTranslate("artist", "a", {
// eslint-disable-next-line max-len
predicate: "section ul div>div:last-child:not([type='illust'])>div[aria-haspopup]:not(.ex-artist-tag)>a:last-child",
tagPosition: TAG_POSITIONS.afterParent,
asyncMode: true,
css: `
/* Fix artist tag overflowing */
div[type="illust"] ~ div:last-child {
flex-direction: column;
align-items: flex-start;
}
.ex-artist-tag[rulename='artist below illust thumb'] {
margin-left: 6px;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}`,
ruleName: "artist below illust thumb",
});

I believe this is caused by the recent pixiv html layout change that broke some other scripts too.
IIRC, the translated tags were used to be displayed under the original artists' name.
Now they are displayed to the side of it, so when either is too long, the original artist name becomes obstructed by the translated tag.