From 44c53f4f7625dc5a4356d36fd0df51bc61ff30fc Mon Sep 17 00:00:00 2001 From: Tomas Dvorak Date: Wed, 28 May 2025 11:39:23 +0200 Subject: [PATCH] s --- admin-dashboard.html | 40 ++++++++++++++++++++++++---------------- main.go | 8 ++++---- 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/admin-dashboard.html b/admin-dashboard.html index 05dc6f6..0b56b06 100644 --- a/admin-dashboard.html +++ b/admin-dashboard.html @@ -1303,16 +1303,15 @@ function updateBannerPreview() { const imageX = currentImageX || '0'; const imageY = currentImageY || '0'; - // Update banner container styles to match index.html + // Update banner container styles to exactly match index.html bannerPreview.style.display = 'block'; bannerPreview.style.width = '100%'; bannerPreview.style.transition = 'all 0.3s ease'; bannerPreview.style.margin = '0 auto'; - bannerPreview.style.maxWidth = '100%'; - bannerPreview.style.padding = '0'; - bannerPreview.style.borderRadius = `${bannerBorderRadius}px`; + bannerPreview.style.maxWidth = '1200px'; + bannerPreview.style.padding = '0 1rem'; - // Update banner content styles to match index.html + // Update banner content styles to exactly match index.html Object.assign(bannerPreviewContent.style, { backgroundColor: bannerBgColor, color: bannerTextColor, @@ -1322,9 +1321,7 @@ function updateBannerPreview() { margin: `${bannerMargin}px 0`, borderRadius: `${bannerBorderRadius}px`, boxShadow: '0 2px 4px rgba(0,0,0,0.1)', - display: 'block', - position: 'relative', - zIndex: '2' + display: 'block' }); // Handle content and image like in index.html @@ -1344,8 +1341,11 @@ function updateBannerPreview() { }); } - // Determine image style based on position - let imageStyle = ''; + // Apply the same border radius to the image as to the container + const imageRadius = Math.max(bannerBorderRadius, 0); + + // Determine image style based on position - exactly match index.html + let imageStyle = `max-width: 100%; max-height: 200px; border-radius: ${imageRadius}px;`; let containerStyle = 'margin-bottom: 15px;'; switch(imagePosition) { @@ -1356,18 +1356,20 @@ function updateBannerPreview() { containerStyle += 'text-align: right; float: right; margin-left: 15px;'; break; case 'custom': - containerStyle += `position: relative;`; - imageStyle = `position: relative; left: ${imageX}px; top: ${imageY}px;`; + containerStyle += 'position: relative;'; + // For custom position, use absolute positioning to ensure exact placement + imageStyle += `position: absolute; left: ${imageX}px; top: ${imageY}px;`; break; default: // center - containerStyle += `text-align: ${bannerTextAlign};`; + containerStyle += 'text-align: center; display: block;'; + break; } - // Format content with image like in index.html + // Format content with image exactly like in index.html content = `