mirror of
https://github.com/Dvorinka/PPve.git
synced 2026-06-05 04:52:58 +00:00
s
This commit is contained in:
+28
-13
@@ -88,7 +88,29 @@
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
// Start building banner content
|
// 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
|
// Handle image if it exists
|
||||||
const bannerText = banner.text || banner.Text || '';
|
const bannerText = banner.text || banner.Text || '';
|
||||||
@@ -227,19 +249,12 @@
|
|||||||
|
|
||||||
// Text is already added in the previous conditions
|
// Text is already added in the previous conditions
|
||||||
|
|
||||||
// Wrap the entire content in a link if bannerLink exists
|
// Set the content and make banner visible
|
||||||
if (bannerLink) {
|
|
||||||
bannerContent.innerHTML = `
|
|
||||||
<a href="${bannerLink}" target="_blank" style="
|
|
||||||
display: block;
|
|
||||||
text-decoration: none;
|
|
||||||
color: inherit;
|
|
||||||
">
|
|
||||||
${content}
|
|
||||||
</a>
|
|
||||||
`;
|
|
||||||
} else {
|
|
||||||
bannerContent.innerHTML = content;
|
bannerContent.innerHTML = content;
|
||||||
|
|
||||||
|
// Apply custom font if specified in template
|
||||||
|
if (style.fontFamily) {
|
||||||
|
bannerContent.style.fontFamily = style.fontFamily;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log the content for debugging
|
// Log the content for debugging
|
||||||
|
|||||||
Reference in New Issue
Block a user