mirror of
https://github.com/Dvorinka/PPve.git
synced 2026-06-04 04:22:58 +00:00
s
This commit is contained in:
+29
-14
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user