This commit is contained in:
Tomas Dvorak
2025-05-28 11:39:23 +02:00
parent a7da5ef25b
commit 44c53f4f76
2 changed files with 28 additions and 20 deletions
+24 -16
View File
@@ -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 = `
<div style="${containerStyle}" class="banner-image-container">
<img src="${currentImage}"
style="max-width: 100%; max-height: 200px; border-radius: 4px; ${imageStyle}"
style="${imageStyle}"
class="${imagePosition === 'custom' ? 'draggable-image' : ''}"
data-position="${imagePosition}"
data-x="${imageX}"
@@ -1381,6 +1383,9 @@ function updateBannerPreview() {
imagePreview.src = currentImage;
imagePreviewContainer.style.display = 'block';
}
// Add the with-image class to the banner preview for proper spacing
bannerPreview.classList.add('with-image');
} else {
// Hide the image preview container if no image
if (imagePreviewContainer) {
@@ -1391,9 +1396,12 @@ function updateBannerPreview() {
if (imagePositionControls) {
imagePositionControls.style.display = 'none';
}
// Remove the with-image class from the banner preview
bannerPreview.classList.remove('with-image');
}
// Wrap in link if provided
// Wrap in link if provided - exactly match index.html
if (bannerLink) {
content = `<a href="${bannerLink}" style="color: inherit; text-decoration: none; display: block;">${content}</a>`;
}
+4 -4
View File
@@ -248,11 +248,11 @@ func handleSubmit(w http.ResponseWriter, r *http.Request) {
}
func sendEmail(entry TripEntry, parsedDateStart, parsedDateEnd time.Time, czechMonths []string) error {
smtpHost := "smtp.gmail.com"
smtpHost := "mail.pp-kunovice.cz"
smtpPort := 465
sender := "contact.dvorak@gmail.com"
password := "mbos uxwh dhlo ezrj"
recipient := "contact.dvorak@gmail.com"
sender := "sluzebnicek@pp-kunovice.cz"
password := "7g}qznB5bj"
recipient := "sluzebnicek@pp-kunovice.cz"
m := gomail.NewMessage()
m.SetHeader("From", sender)