-
![Náhled obrázku]()
+
+
![Banner obrázek]()
+
`;
- // Get background style - handle both gradient and solid colors
- let backgroundStyle = '';
- if (template.background && template.background.includes('gradient')) {
- // Use the gradient from template
- backgroundStyle = `background: ${template.background};`;
- } else if (currentTemplate === 'dark') {
- // Special handling for dark theme
- backgroundStyle = 'background: #2d3748;';
- } else {
- // Use custom background or template's background color
- const bgColor = bannerBgColorPicker?.value || template?.backgroundColor || '#f8f9fa';
- backgroundStyle = `background-color: ${bgColor};`;
+ // Get all styles from template or use defaults
+ const styles = {
+ // Background styles
+ background: template.background || '',
+ backgroundColor: bannerBgColorPicker?.value || template.backgroundColor || '#f8f9fa',
+
+ // Text styles
+ color: bannerTextColorPicker?.value || template.textColor || '#212529',
+ textColor: bannerTextColorPicker?.value || template.textColor || '#212529',
+ textAlign: template.textAlign || 'left',
+ fontSize: template.fontSize ? `${template.fontSize}px` : '16px',
+
+ // Layout styles
+ padding: template.padding ? `${template.padding}px` : '20px',
+ margin: template.margin ? `${template.margin}px` : '20px',
+ borderRadius: template.borderRadius ? `${template.borderRadius}px` : '8px',
+
+ // Container styles
+ containerStyle: template.containerStyle || ''
+ };
+
+ // Special handling for specific templates
+ if (currentTemplate === 'dark') {
+ styles.background = '#2d3748';
+ styles.backgroundColor = '#2d3748';
+ styles.color = '#e2e8f0';
+ styles.textColor = '#e2e8f0';
}
+
+ // Build the background style
+ let backgroundStyle = styles.background.includes('gradient')
+ ? `background: ${styles.background};`
+ : `background-color: ${styles.backgroundColor};`;
// Create container with proper layout
bannerContent = `
@@ -1914,6 +1969,8 @@ function updateBannerPreview() {
margin: ${styles.margin};
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
min-height: 200px;
+ max-width: 1200px;
+ margin: 0 auto;
">
${imagePosition === 'left' || imagePosition === 'top' ? imgContainer : ''}
diff --git a/index.html b/index.html
index 6a7f864..d4814b2 100644
--- a/index.html
+++ b/index.html
@@ -122,20 +122,27 @@
`;
// Create image container
+ // Set max dimensions for the image
+ const maxImageWidth = imagePosition === 'left' || imagePosition === 'right' ? '40%' : '100%';
+ const maxImageHeight = '200px';
+
let imgContainer = `
-

+
`;
// Add image to content