Add custom overlay image style and priority options; enhance overlay handling

This commit is contained in:
CodeDevMLH
2026-03-09 23:27:28 +01:00
parent 0a8ba042db
commit f65475673d
4 changed files with 188 additions and 48 deletions

View File

@@ -62,6 +62,8 @@ const CONFIG = {
customOverlayText: "",
customOverlayImageUrl: "",
customOverlayStyle: "Shadowed",
customOverlayImageStyle: "None",
customOverlayPriority: "Image",
enableCustomMediaIds: true,
enableSeasonalContent: false,
customMediaIds: "",
@@ -3825,14 +3827,9 @@ const slidesInit = async () => {
if (isActive) {
if (section.OverlayText || section.OverlayImageUrl) {
isSeasonOverride = true;
// If the season has an image, clear text, and vice versa.
if (section.OverlayImageUrl) {
activeOverlayImage = section.OverlayImageUrl;
activeOverlayText = null;
} else if (section.OverlayText) {
activeOverlayText = section.OverlayText;
activeOverlayImage = null;
}
// Season fully overrides global overlay, even if empty
activeOverlayImage = section.OverlayImageUrl || null;
activeOverlayText = section.OverlayText || null;
}
break;
}
@@ -3851,12 +3848,17 @@ const slidesInit = async () => {
const overlayContainer = document.createElement("div");
overlayContainer.className = "custom-overlay-container";
if (activeOverlayImage) {
const overlayPriority = CONFIG.customOverlayPriority || "Image";
const showImage = activeOverlayImage && (overlayPriority === "Image" || !activeOverlayText);
const showText = activeOverlayText && (!showImage);
if (showImage) {
const img = document.createElement("img");
img.className = "custom-overlay-image";
const imgStyle = CONFIG.customOverlayImageStyle || "None";
img.className = `custom-overlay-image custom-overlay-img-${imgStyle}`;
img.src = activeOverlayImage;
overlayContainer.appendChild(img);
} else if (activeOverlayText) {
} else if (showText) {
const p = document.createElement("p");
p.className = `custom-overlay-text custom-overlay-style-${CONFIG.customOverlayStyle || 'Shadowed'}`;
p.textContent = activeOverlayText;