From ffbeb2fa51fa7d7d665d81dded5100fb146486f5 Mon Sep 17 00:00:00 2001 From: orfelorfel23 Date: Thu, 12 Nov 2026 00:00:07 +0100 Subject: [PATCH] Add selectable cloud gallery feature and nonsense configuration warning for zero photos --- style.css | 48 ++++++++++ verleih.html | 212 +++++++++++++++++++++++++++++++++++++++++--- verleih_backend.php | 22 ++++- 3 files changed, 268 insertions(+), 14 deletions(-) diff --git a/style.css b/style.css index c1700a7..5e74a01 100644 --- a/style.css +++ b/style.css @@ -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, diff --git a/verleih.html b/verleih.html index 328c992..cb39746 100644 --- a/verleih.html +++ b/verleih.html @@ -108,8 +108,8 @@
-
Fotobox & Tablet mit Schnappix-Software
-
Thermosublimations-Fotodrucker & Stativ
+
Fotobox & Tablet mit Schnappix-App
+
Fotodrucker & Stativ
Fotohintergrund inklusive (0 €)
Digitale Cloud-Galerie ohne Aufpreis (0 €)
@@ -297,6 +297,79 @@ + +
+
+
+

3. Digitale Cloud-Galerie: Online-Fotospeicher gewünscht?

+ Bitte auswählen +
+

Möchtest du nach dem Event alle gemachten Schnappschüsse bequem in einer sicheren Cloud zum Download bereitgestellt bekommen? (Kostenlos: 0 €):

+
+ +
+ + + + + +
+ + +
+ + Wichtig für die Zustellung: Für den Versand des Zugangslinks zur Cloud-Galerie wird am Ende deine E-Mail-Adresse benötigt – ohne E-Mail ist kein digitaler Versand der Fotos möglich! +
+
+ + +
+ +
+

⚠️ Diese Konfiguration macht keinen Sinn!

+

+ Du hast 0 gedruckte Fotos und keinen Cloud-Upload ausgewählt. Dadurch kommst du an überhaupt keine Fotos von deinem Event heran (weder gedruckt noch digital)!
+ Bitte wähle entweder eine gewünschte Anzahl an gedruckten Fotos mit dem Schieberegler oder aktiviere die kostenlose Cloud-Galerie (0 €), damit deine Bilder nicht verloren gehen. +

+
+
+
@@ -325,8 +398,8 @@
- Digitale Cloud-Galerie (alle Fotos, inkl. ungedruckte Bilder) - 0 € (Inklusive) + Digitale Cloud-Galerie: Noch nicht ausgewählt + Auswahl erforderlich
@@ -384,7 +457,7 @@

Haftung & wichtige Mietbedingungen Mieter haftet bei Schäden

- Pflegliche Behandlung & Haftung: Die Fotobox, der Drucker und sämtliches Zubehör werden vor jeder Übergabe frisch gereinigt und auf einwandfreie Funktion geprüft. Bei Beschädigung, unsachgemäßer Handhabung oder Verlust der Box/Komponenten haftet der Mieter in vollem Umfang für die anfallenden Reparatur- bzw. Wiederbeschaffungskosten (in der Regel über die private Haftpflichtversicherung abgedeckt).
+ Pflegliche Behandlung & Haftung: Die Fotobox, der Drucker und sämtliches Zubehör werden vor jeder Übergabe auf einwandfreie Funktion geprüft. Bei Beschädigung, unsachgemäßer Handhabung oder Verlust der Box/Komponenten haftet der Mieter in vollem Umfang für die anfallenden Reparatur- bzw. Wiederbeschaffungskosten (in der Regel über die private Haftpflichtversicherung abgedeckt).
Privatverkauf: Dies ist ein reines Angebot von privat an privat. Ich stelle keine Rechnung aus und weise keine Mehrwertsteuer aus. @@ -415,6 +488,9 @@

+ + Wichtig für deine Fotos: An diese E-Mail wird der Link zur Cloud-Galerie gesendet (ohne E-Mail ist kein digitaler Versand der Fotos möglich). +
@@ -447,7 +523,7 @@
- Konfiguration: 54 Fotos (1 Paket) • Hintergrund: Bitte wählen • Aufstellung: Bitte wählen + Konfiguration: 54 Fotos (1 Paket) • Hintergrund: Bitte wählen • Aufstellung: Bitte wählen • Cloud: Bitte wählen
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 = ' Druckmaterial (0 Fotos / rein digital)'; + breakdownPrintLabel.innerHTML = ' Druckmaterial (0 Fotos / keine Ausdrucke)'; breakdownPrintCost.textContent = '0 €'; - calloutTitle.innerHTML = ' 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 = ' Keine Fotos ausgewählt!'; + calloutDesc.innerHTML = 'Achtung: Du hast 0 Ausdrucke und die Cloud-Galerie abgewählt. Bei dieser Buchung erhältst du keinerlei Fotos von deinem Event!'; + } else { + calloutTitle.innerHTML = ' 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 = ` 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 = ' Ausgewählt'; + } + if (breakdownCloudLabel) { + if (cloudName.includes('Ohne')) { + breakdownCloudLabel.innerHTML = ' Digitale Cloud-Galerie: Abgewählt (kein Online-Speicher)'; + } else { + breakdownCloudLabel.innerHTML = ' 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 = ' Anfrage erfolgreich übermittelt!'; bookingAlertMsg.innerHTML = ` - Vielen Dank, ${custName}! Deine unverbindliche Anfrage für den ${custDate} (${currentRoundedPhotos} Fotos, Hintergrund: "${currentBackground}", ${currentTripod}) wurde erfolgreich übermittelt.
+ Vielen Dank, ${custName}! Deine unverbindliche Anfrage für den ${custDate} (${currentRoundedPhotos} Fotos, Hintergrund: "${currentBackground}", ${currentTripod}, ${currentCloud}) wurde erfolgreich übermittelt.
Ich prüfe die Verfügbarkeit zum Wunschtermin und melde mich zeitnah persönlich bei dir unter ${custEmail} oder ${custPhone} 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 = ' Bitte auswählen'; @@ -1063,12 +1241,20 @@ statusBadgeTripod.className = 'selection-status-badge'; statusBadgeTripod.innerHTML = ' Bitte auswählen'; } + if (statusBadgeCloud) { + statusBadgeCloud.className = 'selection-status-badge'; + statusBadgeCloud.innerHTML = ' Bitte auswählen'; + } if (breakdownBgLabel) breakdownBgLabel.innerHTML = ' Hintergrund: Noch nicht ausgewählt'; if (breakdownBgCost) { breakdownBgCost.textContent = 'Auswahl erforderlich'; breakdownBgCost.style.color = '#fbbf24'; breakdownBgCost.style.fontWeight = '500'; } if (breakdownTripodLabel) breakdownTripodLabel.innerHTML = ' Fotobox-Aufstellung: Noch nicht ausgewählt'; if (breakdownTripodCost) { breakdownTripodCost.textContent = 'Auswahl erforderlich'; breakdownTripodCost.style.color = '#fbbf24'; breakdownTripodCost.style.fontWeight = '500'; } + if (breakdownCloudLabel) breakdownCloudLabel.innerHTML = ' Digitale Cloud-Galerie: Noch nicht ausgewählt'; + 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}).
Bitte klicke hier, um deine Anfrage direkt per E-Mail zu senden: Jetzt per Mail an jannik.schnappix@gmail.com senden . diff --git a/verleih_backend.php b/verleih_backend.php index a0f56f8..950d524 100644 --- a/verleih_backend.php +++ b/verleih_backend.php @@ -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'