Add selectable cloud gallery feature and nonsense configuration warning for zero photos

This commit is contained in:
Jannik committed 2026-11-12 00:00:07 +01:00
1 parent aaa58081ec
commit ffbeb2fa51
3 files changed
+268 -14

No files matched your search

+48
View File
@@ -2517,6 +2517,54 @@ body {
color: #fff;
}
/* Nonsense Warning: 0 Photos & Kein Cloud-Upload */
.calc-nonsense-warning {
background: rgba(239, 68, 68, 0.12);
border: 2px solid #ef4444;
border-radius: 16px;
padding: 20px 24px;
margin: 24px 0 28px 0;
display: none;
align-items: flex-start;
gap: 16px;
box-shadow: 0 0 25px rgba(239, 68, 68, 0.35);
animation: fadeIn 0.3s ease-out;
}
.calc-nonsense-warning.visible {
display: flex;
}
.calc-nonsense-warning.shake {
animation: badgeShake 0.4s ease-in-out;
}
.calc-nonsense-warning i {
font-size: 28px;
color: #ef4444;
flex-shrink: 0;
margin-top: 2px;
}
.calc-nonsense-warning-text h4 {
font-size: 16px;
color: #fca5a5;
font-weight: 700;
margin-bottom: 6px;
}
.calc-nonsense-warning-text p {
font-size: 14px;
color: #f1f5f9;
margin: 0;
line-height: 1.55;
}
.calc-nonsense-warning-text strong {
color: #fff;
text-decoration: underline;
}
@media (max-width: 768px) {
.calc-cloud-notice,
.calc-period-notice,
+199 -13
View File
@@ -108,8 +108,8 @@
</div>
</div>
<div class="calc-base-fee-right">
<div class="calc-base-fee-check-item"><i class="fa-solid fa-circle-check"></i> Fotobox &amp; Tablet mit Schnappix-Software</div>
<div class="calc-base-fee-check-item"><i class="fa-solid fa-circle-check"></i> Thermosublimations-Fotodrucker &amp; Stativ</div>
<div class="calc-base-fee-check-item"><i class="fa-solid fa-circle-check"></i> Fotobox &amp; Tablet mit Schnappix-App</div>
<div class="calc-base-fee-check-item"><i class="fa-solid fa-circle-check"></i> Fotodrucker &amp; Stativ</div>
<div class="calc-base-fee-check-item"><i class="fa-solid fa-circle-check"></i> Fotohintergrund inklusive (0 €)</div>
<div class="calc-base-fee-check-item"><i class="fa-solid fa-circle-check"></i> Digitale Cloud-Galerie ohne Aufpreis (0 €)</div>
</div>
@@ -297,6 +297,79 @@
</div>
</div>
<!-- Cloud Selector Section (Mit oder Ohne Cloud-Galerie) -->
<div class="bg-select-section" id="section-cloud-select" style="margin-top: 30px;">
<div class="bg-select-header">
<div style="display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;">
<h3><i class="fa-solid fa-cloud-arrow-down"></i> 3. Digitale Cloud-Galerie: Online-Fotospeicher gewünscht?</h3>
<span class="selection-status-badge" id="status-badge-cloud"><i class="fa-solid fa-circle-exclamation"></i> Bitte auswählen</span>
</div>
<p>Möchtest du nach dem Event alle gemachten Schnappschüsse bequem in einer sicheren Cloud zum Download bereitgestellt bekommen? (Kostenlos: <strong>0&nbsp;€</strong>):</p>
</div>
<div class="bg-grid" style="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));">
<!-- Option 1: Mit Cloud-Galerie -->
<label class="bg-card featured-card" id="card-with-cloud">
<input type="radio" name="selected_cloud" value="Mit Cloud-Galerie (Alle Fotos digital)" required>
<div class="bg-swatch" style="height: 120px; background: linear-gradient(135deg, rgba(40, 223, 255, 0.18), rgba(255, 43, 214, 0.15), rgba(5, 5, 16, 0.95));">
<div style="text-align: center;">
<i class="fa-solid fa-cloud-arrow-down bg-swatch-icon" style="font-size: 38px; margin-bottom: 6px; color: var(--accent-color);"></i>
<span style="font-size: 13px; font-weight: 600; display: block; color: #fff;">Online Cloud-Galerie</span>
</div>
<div class="bg-check-tag"><i class="fa-solid fa-check"></i></div>
</div>
<div class="bg-card-info">
<div class="bg-card-title-row">
<span class="bg-card-title">Mit Cloud-Galerie</span>
<span class="bg-card-free-tag">0 €</span>
</div>
<p class="bg-card-desc">
Ausnahmslos alle gemachten Fotos (auch ungedruckte!) werden nach deiner Party in einer sicheren Cloud bereitgestellt. Du und deine Gäste erhalten einen privaten Zugangslink zum bequemen Anschauen &amp; Herunterladen in voller Auflösung.
</p>
</div>
</label>
<!-- Option 2: Ohne Cloud-Galerie -->
<label class="bg-card" id="card-without-cloud">
<input type="radio" name="selected_cloud" value="Ohne Cloud-Galerie (Kein Online-Speicher)" required>
<div class="bg-swatch swatch-none" style="height: 120px;">
<div style="text-align: center;">
<i class="fa-solid fa-ban bg-swatch-icon" style="font-size: 38px; margin-bottom: 6px; color: #94a3b8;"></i>
<span style="font-size: 13px; font-weight: 600; display: block; color: #94a3b8;">Kein Online-Speicher</span>
</div>
<div class="bg-check-tag"><i class="fa-solid fa-check"></i></div>
</div>
<div class="bg-card-info">
<div class="bg-card-title-row">
<span class="bg-card-title">Ohne Cloud-Galerie</span>
<span class="bg-card-free-tag">0 €</span>
</div>
<p class="bg-card-desc">
Die Fotos werden nach dem Event nicht online hochgeladen. Nach der Rückgabe der Fotobox werden die Daten vom Tablet gelöscht.
</p>
</div>
</label>
</div>
<!-- Info notice for email requirement -->
<div style="margin-top: 15px; font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 8px;">
<i class="fa-solid fa-envelope-circle-check" style="color: var(--accent-color);"></i>
<span><strong>Wichtig für die Zustellung:</strong> Für den Versand des Zugangslinks zur Cloud-Galerie wird am Ende deine E-Mail-Adresse benötigt – <strong>ohne E-Mail ist kein digitaler Versand der Fotos möglich!</strong></span>
</div>
</div>
<!-- Nonsense Warning Banner: 0 Fotos & Kein Cloud-Upload -->
<div class="calc-nonsense-warning" id="calc-nonsense-warning">
<i class="fa-solid fa-triangle-exclamation"></i>
<div class="calc-nonsense-warning-text">
<h4>⚠️ Diese Konfiguration macht keinen Sinn!</h4>
<p>
Du hast <strong>0 gedruckte Fotos</strong> und <strong>keinen Cloud-Upload</strong> ausgewählt. Dadurch kommst du an <strong>überhaupt keine Fotos</strong> von deinem Event heran (weder gedruckt noch digital)!<br>
Bitte wähle entweder eine gewünschte Anzahl an <strong>gedruckten Fotos</strong> mit dem Schieberegler oder aktiviere die <strong>kostenlose Cloud-Galerie (0&nbsp;€)</strong>, damit deine Bilder nicht verloren gehen.
</p>
</div>
</div>
<!-- Breakdown Receipt -->
<div class="calc-breakdown-card">
<div class="calc-breakdown-title">
@@ -325,8 +398,8 @@
</div>
<div class="calc-breakdown-row">
<span><i class="fa-solid fa-check" style="color: #10b981; margin-right: 8px;"></i> Digitale Cloud-Galerie (alle Fotos, inkl. ungedruckte Bilder)</span>
<span style="color: #10b981; font-weight: 600;">0 € (Inklusive)</span>
<span id="breakdown-cloud-label"><i class="fa-solid fa-circle-question" style="color: #f59e0b; margin-right: 8px;"></i> Digitale Cloud-Galerie: <span style="color: #f59e0b;">Noch nicht ausgewählt</span></span>
<span style="color: #fbbf24; font-weight: 500; font-size: 13px;" id="breakdown-cloud-cost">Auswahl erforderlich</span>
</div>
<div class="calc-breakdown-row total-row">
@@ -384,7 +457,7 @@
<div class="calc-liability-text">
<h4>Haftung &amp; wichtige Mietbedingungen <span class="calc-liability-badge"><i class="fa-solid fa-triangle-exclamation"></i> Mieter haftet bei Schäden</span></h4>
<p>
<strong>Pflegliche Behandlung &amp; Haftung:</strong> Die Fotobox, der Drucker und sämtliches Zubehör werden vor jeder Übergabe frisch gereinigt und auf einwandfreie Funktion geprüft. <strong>Bei Beschädigung, unsachgemäßer Handhabung oder Verlust der Box/Komponenten haftet der Mieter</strong> in vollem Umfang für die anfallenden Reparatur- bzw. Wiederbeschaffungskosten (in der Regel über die private Haftpflichtversicherung abgedeckt).<br>
<strong>Pflegliche Behandlung &amp; Haftung:</strong> Die Fotobox, der Drucker und sämtliches Zubehör werden vor jeder Übergabe auf einwandfreie Funktion geprüft. <strong>Bei Beschädigung, unsachgemäßer Handhabung oder Verlust der Box/Komponenten haftet der Mieter</strong> in vollem Umfang für die anfallenden Reparatur- bzw. Wiederbeschaffungskosten (in der Regel über die private Haftpflichtversicherung abgedeckt).<br>
<span style="display: inline-block; margin-top: 6px; color: #ffca28; font-size: 13px;">
<i class="fa-solid fa-circle-info" style="margin-right: 4px;"></i> <strong>Privatverkauf:</strong> Dies ist ein reines Angebot von privat an privat. Ich stelle keine Rechnung aus und weise keine Mehrwertsteuer aus.
</span>
@@ -415,6 +488,9 @@
<div class="form-group">
<label for="cust-email">Deine E-Mail Adresse *</label>
<input type="email" id="cust-email" name="email" placeholder="mail@example.com" required>
<small style="color: var(--text-muted); font-size: 12px; margin-top: 5px; display: block; line-height: 1.45;">
<i class="fa-solid fa-cloud" style="color: var(--accent-color); margin-right: 4px;"></i> <strong>Wichtig für deine Fotos:</strong> An diese E-Mail wird der Link zur Cloud-Galerie gesendet (ohne E-Mail ist kein digitaler Versand der Fotos möglich).
</small>
</div>
<div class="form-group">
@@ -447,7 +523,7 @@
<!-- Live Summary Box -->
<div class="booking-summary-banner">
<div class="booking-summary-details">
Konfiguration: <strong id="summary-badge-photos">54 Fotos (1 Paket)</strong> • Hintergrund: <strong id="summary-badge-bg" style="color: #fbbf24;">Bitte wählen</strong> • Aufstellung: <strong id="summary-badge-tripod" style="color: #fbbf24;">Bitte wählen</strong>
Konfiguration: <strong id="summary-badge-photos">54 Fotos (1 Paket)</strong> • Hintergrund: <strong id="summary-badge-bg" style="color: #fbbf24;">Bitte wählen</strong> • Aufstellung: <strong id="summary-badge-tripod" style="color: #fbbf24;">Bitte wählen</strong> • Cloud: <strong id="summary-badge-cloud" style="color: #fbbf24;">Bitte wählen</strong>
</div>
<div class="booking-summary-price" id="summary-badge-total">
Gesamt: 65 €
@@ -570,6 +646,7 @@
const summaryBadgePhotos = document.getElementById('summary-badge-photos');
const summaryBadgeBg = document.getElementById('summary-badge-bg');
const summaryBadgeTripod = document.getElementById('summary-badge-tripod');
const summaryBadgeCloud = document.getElementById('summary-badge-cloud');
const summaryBadgeTotal = document.getElementById('summary-badge-total');
// Tripod Elements
@@ -581,6 +658,16 @@
const breakdownTripodLabel = document.getElementById('breakdown-tripod-label');
const breakdownTripodCost = document.getElementById('breakdown-tripod-cost');
// Cloud Elements
const sectionCloudSelect = document.getElementById('section-cloud-select');
const statusBadgeCloud = document.getElementById('status-badge-cloud');
const cloudRadios = document.querySelectorAll('input[name="selected_cloud"]');
const cardWithCloud = document.getElementById('card-with-cloud');
const cardWithoutCloud = document.getElementById('card-without-cloud');
const breakdownCloudLabel = document.getElementById('breakdown-cloud-label');
const breakdownCloudCost = document.getElementById('breakdown-cloud-cost');
const calcNonsenseWarning = document.getElementById('calc-nonsense-warning');
// Lightbox Elements
const bgImgContainer = document.getElementById('bg-img-container');
const lightboxModal = document.getElementById('bg-lightbox-modal');
@@ -630,6 +717,19 @@
let currentTotalPrice = 65;
let currentBackground = null;
let currentTripod = null;
let currentCloud = null;
function checkNonsenseState() {
const isNonsense = (currentPhotos === 0 && currentCloud && currentCloud.includes('Ohne'));
if (calcNonsenseWarning) {
if (isNonsense) {
calcNonsenseWarning.classList.add('visible');
} else {
calcNonsenseWarning.classList.remove('visible');
}
}
return isNonsense;
}
// Calculate upcoming Saturday dynamically
function getUpcomingSaturdayFormatted() {
@@ -727,12 +827,17 @@
// Update Price Breakdown & Capacity Box
if (numPhotos === 0) {
breakdownPrintLabel.innerHTML = '<i class="fa-solid fa-check" style="color: #10b981; margin-right: 8px;"></i> Druckmaterial (0 Fotos / rein digital)';
breakdownPrintLabel.innerHTML = '<i class="fa-solid fa-check" style="color: #10b981; margin-right: 8px;"></i> Druckmaterial (0 Fotos / keine Ausdrucke)';
breakdownPrintCost.textContent = '0 €';
calloutTitle.innerHTML = '<i class="fa-solid fa-mobile-screen" style="margin-right: 6px;"></i> Rein digitale Fotobox-Nutzung';
calloutDesc.innerHTML = 'Du mietest die Box ohne Fotodrucke. Alle Fotos werden während deines Events digital auf dem Tablet gespeichert und stehen dir anschließend in der Cloud zur Verfügung.';
summaryBadgePhotos.textContent = '0 Fotos (rein digital)';
if (currentCloud && currentCloud.includes('Ohne')) {
calloutTitle.innerHTML = '<i class="fa-solid fa-triangle-exclamation" style="color: #ef4444; margin-right: 6px;"></i> Keine Fotos ausgewählt!';
calloutDesc.innerHTML = '<span style="color: #fca5a5;"><strong>Achtung:</strong> Du hast 0 Ausdrucke und die Cloud-Galerie abgewählt. Bei dieser Buchung erhältst du keinerlei Fotos von deinem Event!</span>';
} else {
calloutTitle.innerHTML = '<i class="fa-solid fa-mobile-screen" style="margin-right: 6px;"></i> Rein digitale Fotobox-Nutzung';
calloutDesc.innerHTML = 'Du mietest die Box ohne Fotodrucke vor Ort. Alle Fotos werden während deines Events digital auf dem Tablet gespeichert und stehen dir anschließend in der Cloud zur Verfügung.';
}
summaryBadgePhotos.textContent = '0 Fotos (keine Ausdrucke)';
} else {
const packWord = packs === 1 ? 'Paket' : 'Pakete';
breakdownPrintLabel.innerHTML = `<i class="fa-solid fa-check" style="color: #10b981; margin-right: 8px;"></i> Druckmaterial (${packs} × 54er ${packWord} = ${roundedPhotos} Fotos)`;
@@ -773,6 +878,7 @@
badge.classList.remove('is-snapped');
}
checkNonsenseState();
updateDirectMailLink();
}
@@ -797,10 +903,43 @@
updateDirectMailLink();
}
function updateCloud(cloudName) {
currentCloud = cloudName;
if (statusBadgeCloud) {
statusBadgeCloud.className = 'selection-status-badge selected';
statusBadgeCloud.innerHTML = '<i class="fa-solid fa-circle-check"></i> Ausgewählt';
}
if (breakdownCloudLabel) {
if (cloudName.includes('Ohne')) {
breakdownCloudLabel.innerHTML = '<i class="fa-solid fa-ban" style="color: #94a3b8; margin-right: 8px;"></i> Digitale Cloud-Galerie: Abgewählt (kein Online-Speicher)';
} else {
breakdownCloudLabel.innerHTML = '<i class="fa-solid fa-check" style="color: #10b981; margin-right: 8px;"></i> Digitale Cloud-Galerie (alle Fotos, inkl. ungedruckte Bilder)';
}
}
if (breakdownCloudCost) {
if (cloudName.includes('Ohne')) {
breakdownCloudCost.textContent = '0 € (Abgewählt)';
breakdownCloudCost.style.color = 'var(--text-muted)';
breakdownCloudCost.style.fontWeight = 'normal';
} else {
breakdownCloudCost.textContent = '0 € (Inklusive)';
breakdownCloudCost.style.color = '#10b981';
breakdownCloudCost.style.fontWeight = '600';
}
}
if (summaryBadgeCloud) {
summaryBadgeCloud.textContent = cloudName.includes('Ohne') ? 'Ohne Cloud' : 'Mit Cloud';
summaryBadgeCloud.style.color = '#fff';
}
checkNonsenseState();
updateDirectMailLink();
}
function updateDirectMailLink() {
if (directMailLink) {
const bgText = currentBackground || 'Noch nicht ausgewählt (bitte abstimmen)';
const tripodText = currentTripod || 'Noch nicht ausgewählt (bitte abstimmen)';
const cloudText = currentCloud || 'Noch nicht ausgewählt (bitte abstimmen)';
const subject = encodeURIComponent('Unverbindliche Anfrage Fotobox (Schnappix)');
const body = encodeURIComponent(
`Hallo Jannik,\n\nich habe eine unverbindliche Anfrage zum Verleih deiner Fotobox.\n\n` +
@@ -808,6 +947,7 @@
`- Drucke: ${currentRoundedPhotos} Fotos (${currentPacks} Paket(e) à 54 Fotos)\n` +
`- Hintergrund: ${bgText}\n` +
`- Aufstellung: ${tripodText}\n` +
`- Cloud-Galerie: ${cloudText}\n` +
`- Voraussichtlicher Preis: ${currentTotalPrice} €\n\n` +
`Meine Frage / Wünsche:\n`
);
@@ -967,12 +1107,23 @@
});
});
// Cloud Radio selection handler
cloudRadios.forEach(radio => {
radio.addEventListener('change', (e) => {
if (cardWithCloud) cardWithCloud.classList.remove('selected');
if (cardWithoutCloud) cardWithoutCloud.classList.remove('selected');
const parentCard = e.target.closest('.bg-card');
if (parentCard) parentCard.classList.add('selected');
updateCloud(e.target.value);
});
});
// Handle Booking Form Submit
if (bookingForm) {
bookingForm.addEventListener('submit', async (e) => {
e.preventDefault();
// Validation for Background & Tripod selection
// Validation for Background, Tripod & Cloud selection
if (!currentBackground) {
if (statusBadgeBg) {
statusBadgeBg.classList.add('error-shake');
@@ -997,6 +1148,29 @@
return;
}
if (!currentCloud) {
if (statusBadgeCloud) {
statusBadgeCloud.classList.add('error-shake');
setTimeout(() => statusBadgeCloud.classList.remove('error-shake'), 600);
}
if (sectionCloudSelect) {
sectionCloudSelect.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
alert('Bitte wähle zuerst aus, ob du die kostenlose digitale Cloud-Galerie wünschst oder abbestellst.');
return;
}
// Nonsense configuration validation: 0 prints + declined cloud
if (checkNonsenseState()) {
if (calcNonsenseWarning) {
calcNonsenseWarning.classList.add('error-shake');
setTimeout(() => calcNonsenseWarning.classList.remove('error-shake'), 600);
calcNonsenseWarning.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
alert('Diese Konfiguration macht keinen Sinn: Bei 0 gedruckten Fotos und ohne Cloud-Galerie erhältst du überhaupt keine Fotos von deinem Event! Bitte wähle entweder Fotodrucke oder die kostenlose Cloud-Galerie aus.');
return;
}
const custName = document.getElementById('cust-name').value.trim();
const custEmail = document.getElementById('cust-email').value.trim();
const custPhone = document.getElementById('cust-phone').value.trim();
@@ -1024,6 +1198,7 @@
packages: currentPacks,
background: currentBackground,
tripod: currentTripod,
cloud: currentCloud,
total_price: `${currentTotalPrice} €`,
notes: custNotes
};
@@ -1045,16 +1220,19 @@
bookingAlert.style.display = 'block';
bookingAlertTitle.innerHTML = '<i class="fa-solid fa-circle-check"></i> Anfrage erfolgreich übermittelt!';
bookingAlertMsg.innerHTML = `
Vielen Dank, <strong>${custName}</strong>! Deine unverbindliche Anfrage für den <strong>${custDate}</strong> (${currentRoundedPhotos} Fotos, Hintergrund: "${currentBackground}", ${currentTripod}) wurde erfolgreich übermittelt.<br>
Vielen Dank, <strong>${custName}</strong>! Deine unverbindliche Anfrage für den <strong>${custDate}</strong> (${currentRoundedPhotos} Fotos, Hintergrund: "${currentBackground}", ${currentTripod}, ${currentCloud}) wurde erfolgreich übermittelt.<br>
Ich prüfe die Verfügbarkeit zum Wunschtermin und melde mich zeitnah persönlich bei dir unter <strong>${custEmail}</strong> oder <strong>${custPhone}</strong> zur Abstimmung!
`;
bookingForm.reset();
currentBackground = null;
currentTripod = null;
currentCloud = null;
bgCards.forEach(c => c.classList.remove('selected'));
if (tripodCardWith) tripodCardWith.classList.remove('selected');
if (tripodCardTable) tripodCardTable.classList.remove('selected');
if (cardWithCloud) cardWithCloud.classList.remove('selected');
if (cardWithoutCloud) cardWithoutCloud.classList.remove('selected');
if (statusBadgeBg) {
statusBadgeBg.className = 'selection-status-badge';
statusBadgeBg.innerHTML = '<i class="fa-solid fa-circle-exclamation"></i> Bitte auswählen';
@@ -1063,12 +1241,20 @@
statusBadgeTripod.className = 'selection-status-badge';
statusBadgeTripod.innerHTML = '<i class="fa-solid fa-circle-exclamation"></i> Bitte auswählen';
}
if (statusBadgeCloud) {
statusBadgeCloud.className = 'selection-status-badge';
statusBadgeCloud.innerHTML = '<i class="fa-solid fa-circle-exclamation"></i> Bitte auswählen';
}
if (breakdownBgLabel) breakdownBgLabel.innerHTML = '<i class="fa-solid fa-circle-question" style="color: #f59e0b; margin-right: 8px;"></i> Hintergrund: <span style="color: #f59e0b;">Noch nicht ausgewählt</span>';
if (breakdownBgCost) { breakdownBgCost.textContent = 'Auswahl erforderlich'; breakdownBgCost.style.color = '#fbbf24'; breakdownBgCost.style.fontWeight = '500'; }
if (breakdownTripodLabel) breakdownTripodLabel.innerHTML = '<i class="fa-solid fa-circle-question" style="color: #f59e0b; margin-right: 8px;"></i> Fotobox-Aufstellung: <span style="color: #f59e0b;">Noch nicht ausgewählt</span>';
if (breakdownTripodCost) { breakdownTripodCost.textContent = 'Auswahl erforderlich'; breakdownTripodCost.style.color = '#fbbf24'; breakdownTripodCost.style.fontWeight = '500'; }
if (breakdownCloudLabel) breakdownCloudLabel.innerHTML = '<i class="fa-solid fa-circle-question" style="color: #f59e0b; margin-right: 8px;"></i> Digitale Cloud-Galerie: <span style="color: #f59e0b;">Noch nicht ausgewählt</span>';
if (breakdownCloudCost) { breakdownCloudCost.textContent = 'Auswahl erforderlich'; breakdownCloudCost.style.color = '#fbbf24'; breakdownCloudCost.style.fontWeight = '500'; }
if (summaryBadgeBg) { summaryBadgeBg.textContent = 'Bitte wählen'; summaryBadgeBg.style.color = '#fbbf24'; }
if (summaryBadgeTripod) { summaryBadgeTripod.textContent = 'Bitte wählen'; summaryBadgeTripod.style.color = '#fbbf24'; }
if (summaryBadgeCloud) { summaryBadgeCloud.textContent = 'Bitte wählen'; summaryBadgeCloud.style.color = '#fbbf24'; }
checkNonsenseState();
// Reset slider to default 54
updateCalculator(54);
// Scroll smoothly to alert
@@ -1085,7 +1271,7 @@
Die Anfrage konnte leider nicht automatisch zugestellt werden (${error.message}).<br>
Bitte klicke hier, um deine Anfrage direkt per E-Mail zu senden:
<a href="mailto:jannik.schnappix@gmail.com?subject=Schnappix%20Fotobox-Anfrage&body=${encodeURIComponent(
`Hallo Jannik,\n\nich möchte die Fotobox anfragen:\nName: ${custName}\nTelefon: ${custPhone}\nDatum: ${custDate}\nOrt: ${custLocation}\nFotos: ${currentRoundedPhotos} (Gewünscht: ${currentPhotos})\nHintergrund: ${currentBackground}\nAufstellung: ${currentTripod}\nPreis: ${currentTotalPrice} €\nNotizen: ${custNotes}`
`Hallo Jannik,\n\nich möchte die Fotobox anfragen:\nName: ${custName}\nTelefon: ${custPhone}\nDatum: ${custDate}\nOrt: ${custLocation}\nFotos: ${currentRoundedPhotos} (Gewünscht: ${currentPhotos})\nHintergrund: ${currentBackground}\nAufstellung: ${currentTripod}\nCloud-Galerie: ${currentCloud}\nPreis: ${currentTotalPrice} €\nNotizen: ${custNotes}`
)}" style="color: #fff; text-decoration: underline; font-weight: bold;">
Jetzt per Mail an jannik.schnappix@gmail.com senden
</a>.
+21 -1
View File
@@ -28,6 +28,7 @@ $requestedPhotos = isset($inputData['requested_photos']) ? intval($inputData['re
$packages = isset($inputData['packages']) ? intval($inputData['packages']) : 0;
$background = isset($inputData['background']) ? trim(htmlspecialchars($inputData['background'])) : '';
$tripod = isset($inputData['tripod']) ? trim(htmlspecialchars($inputData['tripod'])) : '';
$cloud = isset($inputData['cloud']) ? trim(htmlspecialchars($inputData['cloud'])) : '';
$totalPrice = isset($inputData['total_price']) ? trim(htmlspecialchars($inputData['total_price'])) : '50 €';
$notes = isset($inputData['notes']) ? trim(htmlspecialchars($inputData['notes'])) : 'Keine Anmerkungen';
@@ -59,6 +60,24 @@ if (empty($tripod) || $tripod === 'null') {
exit;
}
if (empty($cloud) || $cloud === 'null') {
http_response_code(400);
echo json_encode([
'success' => false,
'error' => 'Bitte wähle aus, ob du die digitale Cloud-Galerie wünschst oder abbestellst.'
]);
exit;
}
if ($photos === 0 && (strpos($cloud, 'Ohne') !== false || stripos($cloud, 'kein') !== false)) {
http_response_code(400);
echo json_encode([
'success' => false,
'error' => 'Diese Konfiguration macht keinen Sinn: Bei 0 gedruckten Fotos und ohne Cloud-Galerie erhältst du überhaupt keine Fotos von deinem Event.'
]);
exit;
}
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
http_response_code(400);
echo json_encode([
@@ -86,7 +105,7 @@ $ntfyMessage = "🎉 NEUE FOTOBOX-ANFRAGE (KOSTENSCHÄTZUNG)!\n\n"
. "📸 Ausdrucke: $photoLine\n"
. "🖼️ Hintergrund: $background (0 € inklusive)\n"
. "📐 Aufstellung: $tripod (0 €)\n"
. "☁️ Cloud-Galerie: Inklusive (alle Fotos digital, auch ungedruckte)\n"
. "☁️ Cloud-Galerie: $cloud (0 €)\n"
. "💰 Geschätzter Gesamtpreis: $totalPrice (Privatverleih)\n"
. "⚖️ Haftung bei Beschädigung: Vom Kunden bestätigt\n\n"
. "📝 Anmerkungen:\n$notes";
@@ -135,6 +154,7 @@ $newBooking = [
'packages' => $packages,
'background' => $background,
'tripod' => $tripod,
'cloud' => $cloud,
'total_price' => $totalPrice,
'notes' => $notes,
'ntfy_status' => ($ntfyHttpCode >= 200 && $ntfyHttpCode < 300) ? 'sent' : 'failed'