fix: use native Lampa.Background only, drop CSS background (Lampa owns it)
This commit is contained in:
1 parent
121b9405ec
commit
6c3e9c1866
1 file changed
+4
-40
@@ -339,18 +339,8 @@
|
||||
};
|
||||
|
||||
this.destroy = function () {
|
||||
// Reset the background we set via CSS fallback so it doesn't linger
|
||||
// after leaving the detail page (Lampa manages .background natively).
|
||||
// Let Lampa clear the background natively.
|
||||
try {
|
||||
var bgel = document.querySelector('.background');
|
||||
if (bgel) {
|
||||
bgel.style.backgroundImage = '';
|
||||
bgel.style.filter = '';
|
||||
bgel.style.transform = '';
|
||||
bgel.style.opacity = '';
|
||||
bgel.style.boxShadow = '';
|
||||
bgel.style.transition = '';
|
||||
}
|
||||
if (Lampa.Background && Lampa.Background.immediately) Lampa.Background.immediately('');
|
||||
} catch (e) {}
|
||||
};
|
||||
@@ -378,18 +368,8 @@
|
||||
}
|
||||
},
|
||||
back: function () {
|
||||
// Clear our CSS background immediately (before the
|
||||
// back transition), matching native Lampa behaviour.
|
||||
// Let Lampa clear the background natively (matches built-in pages).
|
||||
try {
|
||||
var bgel = document.querySelector('.background');
|
||||
if (bgel) {
|
||||
bgel.style.backgroundImage = '';
|
||||
bgel.style.filter = '';
|
||||
bgel.style.transform = '';
|
||||
bgel.style.opacity = '';
|
||||
bgel.style.boxShadow = '';
|
||||
bgel.style.transition = '';
|
||||
}
|
||||
if (Lampa.Background && Lampa.Background.immediately) Lampa.Background.immediately('');
|
||||
} catch (e) {}
|
||||
Lampa.Activity.backward();
|
||||
@@ -426,10 +406,8 @@
|
||||
// builds them lazily). Retry a couple of times, but never re-add the
|
||||
// controller or steal focus once it's already set.
|
||||
apply();
|
||||
// Detail background: blurred fanart, matching Lampa's native canvas blur.
|
||||
// Lampa.Background.immediately() is throttled / gated by settings, so we
|
||||
// also set the .background element directly. Mimic Lampa's look:
|
||||
// heavy blur + darken + slight scale so edges don't show.
|
||||
// Use Lampa's native background (canvas blur + fade), exactly like a
|
||||
// built-in movie page. Do NOT touch .background via CSS — Lampa owns it.
|
||||
try {
|
||||
var dm = resolveMovie((comp.activity && comp.activity.object) || selected);
|
||||
var bg = resolve(dm.img || dm.poster || dm.cover);
|
||||
@@ -437,20 +415,6 @@
|
||||
if (bg && Lampa.Background && Lampa.Background.immediately) {
|
||||
Lampa.Background.immediately(bg);
|
||||
}
|
||||
var bgel = document.querySelector('.background');
|
||||
if (bg && bgel) {
|
||||
// Plain full-bleed background, no blur/fade effects.
|
||||
// Darkened via brightness so text stays readable.
|
||||
bgel.style.transition = 'none';
|
||||
bgel.style.backgroundImage = 'url("' + bg + '")';
|
||||
bgel.style.backgroundSize = 'cover';
|
||||
bgel.style.backgroundPosition = 'center';
|
||||
bgel.style.backgroundRepeat = 'no-repeat';
|
||||
bgel.style.filter = 'brightness(0.4)';
|
||||
bgel.style.transform = 'none';
|
||||
bgel.style.boxShadow = 'none';
|
||||
bgel.style.opacity = '1';
|
||||
}
|
||||
} catch (e) { console.log('[mymovies] bg err', e); }
|
||||
if (!$('.mymovies-detail .full-start-new__buttons .full-start__button.selector').length) {
|
||||
setTimeout(apply, 300);
|
||||
|
||||
Reference in new issue
Block a user