diff --git a/admin-dashboard.html b/admin-dashboard.html index 0b56b06..21670cf 100644 --- a/admin-dashboard.html +++ b/admin-dashboard.html @@ -1310,6 +1310,7 @@ function updateBannerPreview() { bannerPreview.style.margin = '0 auto'; bannerPreview.style.maxWidth = '1200px'; bannerPreview.style.padding = '0 1rem'; + bannerPreview.style.position = 'relative'; // Ensure proper positioning context // Update banner content styles to exactly match index.html Object.assign(bannerPreviewContent.style, { @@ -1344,8 +1345,12 @@ function updateBannerPreview() { // Apply the same border radius to the image as to the container const imageRadius = Math.max(bannerBorderRadius, 0); + // Get image dimensions + const imageWidth = parseInt(document.getElementById('bannerImageWidth')?.value || '100'); + const imageHeight = parseInt(document.getElementById('bannerImageHeight')?.value || '200'); + // Determine image style based on position - exactly match index.html - let imageStyle = `max-width: 100%; max-height: 200px; border-radius: ${imageRadius}px;`; + let imageStyle = `max-width: ${imageWidth}px; max-height: ${imageHeight}px; border-radius: ${imageRadius}px;`; let containerStyle = 'margin-bottom: 15px;'; switch(imagePosition) { @@ -1401,9 +1406,11 @@ function updateBannerPreview() { bannerPreview.classList.remove('with-image'); } - // Wrap in link if provided - exactly match index.html + // Wrap in link if provided - exactly match index.html but prevent clicks if (bannerLink) { - content = `${content}`; + content = `${content}`; } // Update content diff --git a/banner.go b/banner.go index 1a23183..4c669f9 100644 --- a/banner.go +++ b/banner.go @@ -68,6 +68,12 @@ type BannerStyle struct { Margin string `json:"margin"` BorderRadius string `json:"borderRadius"` IsVisible bool `json:"isVisible"` + ImageWidth int `json:"imageWidth"` // Width in pixels + ImageHeight int `json:"imageHeight"` // Height in pixels + ImagePosition string `json:"imagePosition"` // center, left, right, custom + ImageX int `json:"imageX"` // X position for custom + ImageY int `json:"imageY"` // Y position for custom +} ImagePosition string `json:"imagePosition"` // left, right, center, or custom ImageX string `json:"imageX"` // X position for custom placement ImageY string `json:"imageY"` // Y position for custom placement