This commit is contained in:
Tomas Dvorak
2025-05-29 12:59:32 +02:00
parent 454ba18c5e
commit bfb8b98747
+29 -14
View File
@@ -88,7 +88,29 @@
`;
// Start building banner content
let content = '';
let content = `
<div class="banner-content" style="
padding: ${padding}px;
margin: ${margin}px;
background: ${backgroundColor};
color: ${textColor};
border-radius: ${borderRadius}px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
${style.containerStyle || ''}
position: relative;
overflow: hidden;
">
${banner.link ? `<a href="${banner.link}" target="_blank" style="
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
text-decoration: none;
color: inherit;
"></a>` : ''}
`;
// Handle image if it exists
const bannerText = banner.text || banner.Text || '';
@@ -227,19 +249,12 @@
// Text is already added in the previous conditions
// Wrap the entire content in a link if bannerLink exists
if (bannerLink) {
bannerContent.innerHTML = `
<a href="${bannerLink}" target="_blank" style="
display: block;
text-decoration: none;
color: inherit;
">
${content}
</a>
`;
} else {
bannerContent.innerHTML = content;
// Set the content and make banner visible
bannerContent.innerHTML = content;
// Apply custom font if specified in template
if (style.fontFamily) {
bannerContent.style.fontFamily = style.fontFamily;
}
// Log the content for debugging