Skip to content

Commit 589983b

Browse files
Stash-KennyGKennyG
andauthored
performer-poster-backdrop: compatibility with Stash v0.31.1 (#703)
Co-authored-by: KennyG <kennyg@kennyg.com>
1 parent e1e7522 commit 589983b

4 files changed

Lines changed: 19 additions & 2 deletions

File tree

plugins/performer-poster-backdrop/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Adds a blurred poster-style backdrop behind performer headers using the performe
1111

1212
- Applies only to **Performer pages**
1313
- Uses the performer’s **poster image** as a background layer
14+
- When this plugin is active, Stash’s built-in performer **background image** (Settings → Interface → **Enable performer background image**) is hidden on that header so you only get one backdrop layer and the name block is not pushed down by a second stack.
1415
- Adjustable:
1516
- Opacity
1617
- Blur strength

plugins/performer-poster-backdrop/performer-poster-backdrop.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@
4242
overflow: hidden;
4343
}
4444

45+
/*
46+
* Stash core now renders BackgroundImage (.background-image-container) inside the same header.
47+
* Our plugin replaces that behavior; leaving both causes a stacked/double header look and can
48+
* push layout. Hide native backdrop whenever our hero is present.
49+
*/
50+
#performer-page .detail-header.full-width.pb-has-hero .background-image-container {
51+
display: none !important;
52+
}
53+
4554
/* Lift content above banner ONLY in the REAL header */
4655
#performer-page .detail-header.full-width > *:not(.pb-hero) {
4756
position: relative;

plugins/performer-poster-backdrop/performer-poster-backdrop.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,11 @@
7070
return map;
7171
}
7272

73+
const HEADER_ACTIVE_CLASS = "pb-has-hero";
74+
7375
function removeHero(el) {
7476
el?.querySelector("." + HERO_CLASS)?.remove();
77+
el?.classList.remove(HEADER_ACTIVE_CLASS);
7578
}
7679

7780
function upsertHero(header, url) {
@@ -81,6 +84,7 @@
8184
hero.className = HERO_CLASS;
8285
header.prepend(hero);
8386
}
87+
header.classList.add(HEADER_ACTIVE_CLASS);
8488
hero.style.backgroundImage = `url("${url}")`;
8589
return hero;
8690
}
@@ -144,7 +148,10 @@
144148
if (!header || !isPerformerRoute()) return removeHero(header);
145149

146150
const img = getPosterImg();
147-
if (!img) return;
151+
if (!img) {
152+
removeHero(header);
153+
return;
154+
}
148155

149156
const hero = upsertHero(header, img.currentSrc || img.src);
150157
apply(hero);

plugins/performer-poster-backdrop/performer-poster-backdrop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Performer Poster Backdrop
22
description: Adds a blurred poster backdrop to performer pages.
3-
version: 1.0.3
3+
version: 1.1.0
44
url: https://discourse.stashapp.cc/t/performer-poster-backdrop/4897
55

66
ui:

0 commit comments

Comments
 (0)