diff --git a/hifi-src/src/App.jsx b/hifi-src/src/App.jsx index 912bd89..6f4d15e 100644 --- a/hifi-src/src/App.jsx +++ b/hifi-src/src/App.jsx @@ -85,6 +85,7 @@ const EmailSettings = lazyPage(() => import('./pages/admin/settings/EmailSetting const DatabaseSettings = lazyPage(() => import('./pages/admin/settings/DatabaseSettings.jsx')); const ExportImportSettings = lazyPage(() => import('./pages/admin/settings/ExportImportSettings.jsx')); const MaintenanceSettings = lazyPage(() => import('./pages/admin/settings/MaintenanceSettings.jsx')); +const CountdownSettings = lazyPage(() => import('./pages/admin/settings/CountdownSettings.jsx')); const ResetSettings = lazyPage(() => import('./pages/admin/settings/ResetSettings.jsx')); const blankScreen =
; @@ -159,6 +160,7 @@ export default function App() { } /> } /> } /> + } /> } /> } /> } /> diff --git a/hifi-src/src/components/AdminLayout.jsx b/hifi-src/src/components/AdminLayout.jsx index f732d75..29baf27 100644 --- a/hifi-src/src/components/AdminLayout.jsx +++ b/hifi-src/src/components/AdminLayout.jsx @@ -38,6 +38,7 @@ const ICONS = { trash: 'M5 7h14M10 11v6m4-6v6M6 7l1 13h10l1-13M9 7V4h6v3', external: 'M14 4h6v6m0-6-9 9M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5', pause: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm-2-12v6m4-6v6', + timer: 'M10 2h4M12 14l3-3M12 22a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z', }; const Icon = ({ path }) => ( @@ -56,6 +57,7 @@ export default function AdminLayout() { // nie unbemerkt bleiben. const [hiddenAreas, setHiddenAreas] = useState([]); const [maintenanceOn, setMaintenanceOn] = useState(false); + const [countdownUntil, setCountdownUntil] = useState(null); // Wird auch von Seiten aufgerufen (useAdminUi().refreshCounters), z. B. nachdem eine Anfrage // auf "Erledigt" gesetzt oder ein Bereich ausgeblendet wurde - frueher blieb das Badge bis @@ -65,7 +67,10 @@ export default function AdminLayout() { api.get('/contact').then((rows) => setNewContactCount(rows.filter((r) => r.status === 'new').length)).catch(() => {}); } api.get('/site-settings').then((res) => setHiddenAreas(res.hidden_areas || [])).catch(() => {}); - api.get('/maintenance').then((res) => setMaintenanceOn(!!res?.global?.enabled)).catch(() => {}); + api.get('/maintenance').then((res) => { + setMaintenanceOn(!!res?.global?.enabled); + setCountdownUntil(res?.countdown?.active ? res.countdown.launch_at : null); + }).catch(() => {}); // eslint-disable-next-line react-hooks/exhaustive-deps }, [user?.id]); @@ -124,6 +129,7 @@ export default function AdminLayout() { { to: '/admin/settings/design', label: 'Aussehen', icon: 'palette', permission: 'settings.manage' }, { to: '/admin/settings/legal', label: 'Rechtstexte', icon: 'file', permission: 'settings.manage' }, { to: '/admin/settings/maintenance', label: 'Wartungsmodus', icon: 'pause', permission: 'settings.manage' }, + { to: '/admin/settings/countdown', label: 'Launch-Countdown', icon: 'timer', permission: 'settings.manage' }, ], }, { @@ -249,7 +255,7 @@ export default function AdminLayout() {
)} - {(maintenanceOn || hiddenAreaLabels.length > 0) && ( + {(maintenanceOn || countdownUntil || hiddenAreaLabels.length > 0) && (
{maintenanceOn && (

@@ -257,6 +263,13 @@ export default function AdminLayout() { {hasPermission('settings.manage') && Ändern}

)} + {countdownUntil && ( +

+ Launch-Countdown läuft – Besucher sehen bis{' '} + {new Date(countdownUntil).toLocaleString('de-DE', { dateStyle: 'medium', timeStyle: 'short', timeZone: 'Europe/Berlin' })} Uhr nur den Countdown.{' '} + {hasPermission('settings.manage') && Ändern} +

+ )} {hiddenAreaLabels.length > 0 && (

Ausgeblendet für Besucher: {hiddenAreaLabels.join(', ')}.{' '} diff --git a/hifi-src/src/components/CountdownTeaser.jsx b/hifi-src/src/components/CountdownTeaser.jsx new file mode 100644 index 0000000..effacbe --- /dev/null +++ b/hifi-src/src/components/CountdownTeaser.jsx @@ -0,0 +1,324 @@ +import { useEffect, useMemo, useState } from 'react'; +import { Link } from 'react-router-dom'; +import { AnimatePresence, motion, useReducedMotion } from 'framer-motion'; +import { CalendarPlus, LogIn, Phone, X } from 'lucide-react'; +import { useLanguage } from '../context/LanguageContext.jsx'; +import { telHref } from '../utils/contactLinks.js'; +import logoDark from '../assets/logo-dark.png'; +import defaultBackground from '../assets/photos/hero-trunk.webp'; + +const EASE = [0.16, 1, 0.3, 1]; +const michroma = { fontFamily: "'Michroma', sans-serif" }; +const condensed = { fontFamily: "'Barlow Condensed', sans-serif" }; + +// Restzeit in ms bis zum Launch - mit dem Uhr-Versatz zwischen Server und Browser, damit eine +// falsch gehende Uhr beim Besucher den Countdown nicht verschiebt. +export function countdownRemaining(countdown, clockOffset = 0) { + if (!countdown?.launch_at) return 0; + return new Date(countdown.launch_at).getTime() - (Date.now() + clockOffset); +} + +// Versatz Server-Uhr minus Browser-Uhr zum Zeitpunkt der Antwort (_received_at setzt PublicLayout). +export function countdownClockOffset(countdown, receivedAt) { + if (!countdown?.server_time || !receivedAt) return 0; + return new Date(countdown.server_time).getTime() - receivedAt; +} + +function splitRemaining(ms) { + const total = Math.max(0, Math.floor(ms / 1000)); + return { + days: Math.floor(total / 86400), + hours: Math.floor((total % 86400) / 3600), + minutes: Math.floor((total % 3600) / 60), + seconds: total % 60, + }; +} + +// Kalendereintrag (.ics) fuer "Erinnere mich" - laeuft komplett im Browser. +function calendarHref(launchAt, title) { + const start = new Date(launchAt); + const end = new Date(start.getTime() + 60 * 60 * 1000); + const fmt = (d) => d.toISOString().replace(/[-:]/g, '').replace(/\.\d{3}/, ''); + const ics = [ + 'BEGIN:VCALENDAR', + 'VERSION:2.0', + 'PRODID:-//HifiPlanet//Countdown//DE', + 'BEGIN:VEVENT', + `UID:launch-${fmt(start)}@hifi-planet.de`, + `DTSTAMP:${fmt(new Date())}`, + `DTSTART:${fmt(start)}`, + `DTEND:${fmt(end)}`, + `SUMMARY:${title}`, + `URL:${window.location.origin}`, + 'END:VEVENT', + 'END:VCALENDAR', + ].join('\r\n'); + return `data:text/calendar;charset=utf-8,${encodeURIComponent(ics)}`; +} + +// Eine Ziffer, die beim Wechsel nach unten wegrollt - wie ein Zaehlwerk. +function RollingDigit({ value, reduceMotion }) { + return ( + + + + {value} + + + + ); +} + +function TimeTile({ value, label, reduceMotion, minDigits = 2 }) { + const digits = String(value).padStart(minDigits, '0').split(''); + return ( +

+
+ {/* Lichtkante oben + Trennlinie in der Mitte wie bei einer Fallblattanzeige */} +
+
+
+ {digits.map((d, i) => ( + + ))} +
+
+ + {label} + +
+ ); +} + +// Equalizer am unteren Rand - der Car-Hifi-"Herzschlag" der Seite. Feste Pseudo-Zufallswerte, +// damit nichts bei jedem Render springt. +function Equalizer({ bars = 72 }) { + const items = useMemo( + () => + Array.from({ length: bars }, (_, i) => { + const seed = Math.sin(i * 12.9898) * 43758.5453; + const rand = seed - Math.floor(seed); + const center = 1 - Math.abs(i / (bars - 1) - 0.5) * 1.3; + return { + height: 18 + center * 62 + rand * 20, + duration: 0.9 + rand * 1.4, + delay: -rand * 2, + }; + }), + [bars] + ); + return ( +
+ {items.map((bar, i) => ( + + ))} +
+ ); +} + +export default function CountdownTeaser({ countdown, clockOffset = 0, settings = {}, preview = false, onClosePreview, onLaunch }) { + const { t, language, toggleLanguage } = useLanguage(); + const reduceMotion = useReducedMotion(); + const [remaining, setRemaining] = useState(() => countdownRemaining(countdown, clockOffset)); + const launched = remaining <= 0; + + useEffect(() => { + const tick = () => setRemaining(countdownRemaining(countdown, clockOffset)); + tick(); + const timer = setInterval(tick, 250); + return () => clearInterval(timer); + }, [countdown, clockOffset]); + + // Bei 0: kurz "Wir sind live!" feiern, dann oeffnet sich die echte Seite. + useEffect(() => { + if (!launched || preview) return undefined; + const timer = setTimeout(() => onLaunch?.(), 2600); + return () => clearTimeout(timer); + }, [launched, preview, onLaunch]); + + useEffect(() => { + const previous = document.title; + document.title = `HifiPlanet – ${t('countdown.eyebrow')}`; + return () => { + document.title = previous; + }; + }, [t]); + + const parts = splitRemaining(remaining); + const en = language === 'en'; + const title = (en ? countdown.title_en : countdown.title) || t('countdown.title'); + const message = (en ? countdown.message_en : countdown.message) || t('countdown.message'); + const launchDate = countdown.launch_at ? new Date(countdown.launch_at) : null; + const dateLabel = launchDate + ? launchDate.toLocaleDateString(en ? 'en-GB' : 'de-DE', { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric', timeZone: 'Europe/Berlin' }) + : ''; + const timeLabel = launchDate + ? launchDate.toLocaleTimeString(en ? 'en-GB' : 'de-DE', { hour: '2-digit', minute: '2-digit', timeZone: 'Europe/Berlin' }) + : ''; + const background = settings.hero_image_path || defaultBackground; + + const fadeUp = (delay) => ({ + initial: reduceMotion ? { opacity: 0 } : { opacity: 0, y: 24, filter: 'blur(8px)' }, + animate: { opacity: 1, y: 0, filter: 'blur(0px)' }, + transition: { duration: 0.9, delay, ease: EASE }, + }); + + return ( +
+ {/* Hintergrund: Foto ganz dezent, gruener Lichtkegel von unten, feines Raster */} +
+ +
+
+
+
+
+ + + {preview && ( +
+ {t('countdown.preview')} + +
+ )} + +
+ + +
+ +
+ + + + + + {launched ? t('countdown.liveEyebrow') : t('countdown.eyebrow')} + + + + + {launched ? t('countdown.liveTitle') : title} + + + + + {launched ? t('countdown.liveMessage') : message} + + + + + + + + + + {launchDate && !launched && ( + +

+ {t('countdown.launchPrefix')} {dateLabel} {t('countdown.launchAt')}{' '} + {timeLabel} {t('countdown.clock')} +

+ + + {t('countdown.addToCalendar')} + +
+ )} +
+ +
+
+ {settings.phone && ( + + + {t('countdown.questions')} {settings.phone} + + )} + {settings.address_city && ( + + {settings.address_street}, {settings.address_zip} {settings.address_city} + + )} +
+
+ Impressum + {en ? 'Privacy' : 'Datenschutz'} + + + +
+
+
+ ); +} + +// Schmale Leiste fuer eingeloggte Admins auf der normalen Seite, solange Besucher den Teaser sehen. +export function CountdownAdminBanner({ countdown }) { + const { t, language } = useLanguage(); + const date = new Date(countdown.launch_at).toLocaleString(language === 'en' ? 'en-GB' : 'de-DE', { + day: '2-digit', + month: '2-digit', + year: 'numeric', + hour: '2-digit', + minute: '2-digit', + timeZone: 'Europe/Berlin', + }); + return ( +
+ + {t('countdown.adminActive').replace('{date}', date)}{' '} + + {t('countdown.adminPreview')} + +
+ ); +} diff --git a/hifi-src/src/components/PublicLayout.jsx b/hifi-src/src/components/PublicLayout.jsx index 2ffc100..5ac11b5 100644 --- a/hifi-src/src/components/PublicLayout.jsx +++ b/hifi-src/src/components/PublicLayout.jsx @@ -1,11 +1,12 @@ import { Suspense, useEffect, useState } from 'react'; -import { Navigate, Outlet, useLocation } from 'react-router-dom'; +import { Navigate, Outlet, useLocation, useNavigate } from 'react-router-dom'; import Navbar from './Navbar.jsx'; import Footer from './Footer.jsx'; import ScrollProgress from './ScrollProgress.jsx'; import MaintenanceNotice from './MaintenanceNotice.jsx'; import MaintenanceBypassBanner from './MaintenanceBypassBanner.jsx'; import CookieConsentBanner from './CookieConsentBanner.jsx'; +import CountdownTeaser, { CountdownAdminBanner, countdownClockOffset, countdownRemaining } from './CountdownTeaser.jsx'; import GoogleAnalytics from './GoogleAnalytics.jsx'; import { MaintenanceProvider } from '../context/MaintenanceContext.jsx'; import { SiteSettingsProvider } from '../context/SiteSettingsContext.jsx'; @@ -134,13 +135,20 @@ export default function PublicLayout() { const [siteSettingsLoaded, setSiteSettingsLoaded] = useState(!!cachedSettings); const [textStyles, setTextStyles] = useState({}); const [customFonts, setCustomFonts] = useState([]); - const { loading: authLoading, hasPermission } = useAuth(); + const { loading: authLoading, hasPermission, user } = useAuth(); const location = useLocation(); + const navigate = useNavigate(); + // Wird true, sobald der Countdown waehrend des Besuchs auf 0 laeuft - dann oeffnet sich die Seite. + const [countdownFinished, setCountdownFinished] = useState(false); + // Fuer die Admin-Vorschau ohne gesetzten (oder mit abgelaufenem) Startzeitpunkt. + const [demoLaunchAt] = useState(() => new Date(Date.now() + (7 * 24 + 3) * 3600 * 1000 + 42 * 60 * 1000).toISOString()); useEffect(() => { api .get('/maintenance') - .then((data) => { + .then((response) => { + // Empfangszeit merken: daraus rechnet der Countdown den Versatz zur Server-Uhr aus. + const data = { ...response, _received_at: Date.now() }; setStatus(data); writeCache(STATUS_CACHE_KEY, data); }) @@ -172,15 +180,42 @@ export default function PublicLayout() { if (siteSettingsLoaded) updateBusinessJsonLd(siteSettings); }, [siteSettings, siteSettingsLoaded]); - // Auf den Login-Status wird nur gewartet, wenn die Wartung aktiv ist (dann entscheidet er, - // ob ein Admin die Seite trotzdem sieht) - normale Besucher sehen die Seite sofort. - if (status === null || !siteSettingsLoaded || (status.global?.enabled && authLoading)) { + const countdown = status?.countdown; + const clockOffset = countdownClockOffset(countdown, status?._received_at); + const countdownRunning = !!countdown?.active && !countdownFinished && countdownRemaining(countdown, clockOffset) > 0; + + // Auf den Login-Status wird nur gewartet, wenn Wartung oder Countdown aktiv ist (dann entscheidet + // er, ob ein Admin die Seite trotzdem sieht) - normale Besucher sehen die Seite sofort. + if (status === null || !siteSettingsLoaded || ((status.global?.enabled || countdownRunning) && authLoading)) { return
; } const bypass = hasPermission('maintenance.bypass'); const isLegalPage = LEGAL_PATHS.includes(location.pathname); + // Countdown-Teaser vor dem Launch: Besucher sehen nur den Countdown, eingeloggte Admins die + // normale Seite. Mit /?countdown=vorschau sehen Admins den Teaser trotzdem. + const countdownPreview = !!user && new URLSearchParams(location.search).get('countdown') === 'vorschau'; + if (!isLegalPage && ((countdownRunning && !user) || countdownPreview)) { + const shown = countdownPreview && !(countdown?.launch_at && countdownRemaining(countdown, clockOffset) > 0) + ? { ...countdown, launch_at: demoLaunchAt } + : countdown; + return ( + + + navigate('/', { replace: true })} + onLaunch={() => setCountdownFinished(true)} + /> + + + ); + } + if (status.global.enabled && !bypass && !isLegalPage) { return ( @@ -201,6 +236,7 @@ export default function PublicLayout() {
{bypass && status.global.enabled && } + {!!user && countdownRunning && }
diff --git a/hifi-src/src/i18n/de.js b/hifi-src/src/i18n/de.js index 684f860..75c5c2b 100644 --- a/hifi-src/src/i18n/de.js +++ b/hifi-src/src/i18n/de.js @@ -63,6 +63,28 @@ export default { defaultMessage: 'Dieser Bereich wird gerade aktualisiert. Bitte schau in Kürze wieder vorbei.', login: 'Anmelden', }, + countdown: { + eyebrow: 'Neue Website · Bald live', + title: 'Bald wird’s laut.', + message: 'Wir drehen gerade die letzten Schrauben fest. Unsere neue Website mit allen Paketen für dein Fahrzeug startet in Kürze.', + days: 'Tage', + hours: 'Stunden', + minutes: 'Minuten', + seconds: 'Sekunden', + launchPrefix: 'Start', + launchAt: 'um', + clock: 'Uhr', + addToCalendar: 'In den Kalender', + calendarTitle: 'Launch der neuen HifiPlanet-Website', + questions: 'Fragen vorab?', + liveEyebrow: 'Neue Website · Jetzt online', + liveTitle: 'Wir sind live!', + liveMessage: 'Einen Moment, die Seite öffnet sich …', + preview: 'Vorschau – nur für dich sichtbar', + closePreview: 'Vorschau schließen', + adminActive: 'Countdown aktiv – Besucher sehen bis {date} nur den Teaser.', + adminPreview: 'Vorschau ansehen', + }, lightbox: { close: 'Schließen', previous: 'Vorheriges Bild', diff --git a/hifi-src/src/i18n/en.js b/hifi-src/src/i18n/en.js index 193e899..6c9fce1 100644 --- a/hifi-src/src/i18n/en.js +++ b/hifi-src/src/i18n/en.js @@ -63,6 +63,28 @@ export default { defaultMessage: 'This area is currently being updated. Please check back shortly.', login: 'Log in', }, + countdown: { + eyebrow: 'New website · Coming soon', + title: 'Things are about to get loud.', + message: 'We are tightening the last screws. Our new website with every package for your vehicle launches shortly.', + days: 'Days', + hours: 'Hours', + minutes: 'Minutes', + seconds: 'Seconds', + launchPrefix: 'Launch', + launchAt: 'at', + clock: '', + addToCalendar: 'Add to calendar', + calendarTitle: 'Launch of the new HifiPlanet website', + questions: 'Questions?', + liveEyebrow: 'New website · Now online', + liveTitle: 'We are live!', + liveMessage: 'One moment, the site is opening …', + preview: 'Preview – only visible to you', + closePreview: 'Close preview', + adminActive: 'Countdown active – visitors only see the teaser until {date}.', + adminPreview: 'Open preview', + }, lightbox: { close: 'Close', previous: 'Previous image', diff --git a/hifi-src/src/index.css b/hifi-src/src/index.css index 3ce5e2d..5ed2acb 100644 --- a/hifi-src/src/index.css +++ b/hifi-src/src/index.css @@ -349,3 +349,31 @@ html.hifi-cursor-on :is(input, textarea, [contenteditable='true']) { opacity: 0.5; font-style: italic; } + +/* Countdown-Teaser vor dem Launch (components/CountdownTeaser.jsx): Equalizer-Balken und ein + ganz langsamer Zoom auf das Hintergrundfoto. */ +@keyframes countdown-eq { + 0%, 100% { transform: scaleY(0.25); } + 35% { transform: scaleY(1); } + 60% { transform: scaleY(0.45); } + 80% { transform: scaleY(0.8); } +} +.countdown-eq-bar { + animation: countdown-eq 1.6s ease-in-out infinite; +} +@keyframes countdown-kenburns { + from { transform: scale(1.05); } + to { transform: scale(1.18) translateY(-2%); } +} +.countdown-kenburns { + animation: countdown-kenburns 30s ease-in-out infinite alternate; +} +@media (prefers-reduced-motion: reduce) { + .countdown-eq-bar, + .countdown-kenburns { + animation: none; + } + .countdown-eq-bar { + transform: scaleY(0.5); + } +} diff --git a/hifi-src/src/pages/admin/Dashboard.jsx b/hifi-src/src/pages/admin/Dashboard.jsx index 2a24f3e..e4a8c67 100644 --- a/hifi-src/src/pages/admin/Dashboard.jsx +++ b/hifi-src/src/pages/admin/Dashboard.jsx @@ -239,6 +239,7 @@ function QuickLinks({ hasPermission }) { { to: '/admin/home-sections', label: 'Startseiten-Texte ändern', show: hasPermission('content.manage') }, { to: '/admin/settings/company', label: 'Öffnungszeiten & Kontakt', show: hasPermission('settings.manage') }, { to: '/admin/settings/maintenance', label: 'Wartungsmodus', show: hasPermission('settings.manage') }, + { to: '/admin/settings/countdown', label: 'Launch-Countdown', show: hasPermission('settings.manage') }, ].filter((l) => l.show); return (
diff --git a/hifi-src/src/pages/admin/settings/CountdownSettings.jsx b/hifi-src/src/pages/admin/settings/CountdownSettings.jsx new file mode 100644 index 0000000..abc0441 --- /dev/null +++ b/hifi-src/src/pages/admin/settings/CountdownSettings.jsx @@ -0,0 +1,167 @@ +import { useEffect, useState } from 'react'; +import { api } from '../../../api/client.js'; + +const emptyForm = { enabled: false, launch_at: '', title: '', title_en: '', message: '', message_en: '' }; + +const toForm = (countdown = {}) => ({ + enabled: !!countdown.enabled, + launch_at: countdown.launch_at_local || '', + title: countdown.title || '', + title_en: countdown.title_en || '', + message: countdown.message || '', + message_en: countdown.message_en || '', +}); + +// Der Zeitpunkt wird als deutsche Ortszeit gespeichert (siehe MaintenanceController::countdown); +// fuer die Restzeit-Anzeige hier reicht die Uhr des Browsers. +function remainingLabel(launchAt) { + if (!launchAt) return null; + const ms = new Date(launchAt).getTime() - Date.now(); + if (Number.isNaN(ms)) return null; + if (ms <= 0) return { past: true, text: 'Der Zeitpunkt liegt in der Vergangenheit – der Countdown wird Besuchern nicht angezeigt.' }; + const minutes = Math.floor(ms / 60000); + const days = Math.floor(minutes / 1440); + const hours = Math.floor((minutes % 1440) / 60); + const mins = minutes % 60; + const parts = [days && `${days} ${days === 1 ? 'Tag' : 'Tage'}`, hours && `${hours} Std.`, `${mins} Min.`].filter(Boolean); + return { past: false, text: `Noch ${parts.join(' ')} bis zum Start.` }; +} + +const inputClass = 'w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900'; +const labelClass = 'mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300'; + +export default function CountdownSettings() { + const [form, setForm] = useState(emptyForm); + const [loading, setLoading] = useState(true); + const [busy, setBusy] = useState(false); + const [saved, setSaved] = useState(false); + const [error, setError] = useState(''); + const [, setTick] = useState(0); + + useEffect(() => { + api.get('/maintenance').then((res) => setForm(toForm(res.countdown))).finally(() => setLoading(false)); + }, []); + + // Restzeit-Hinweis jede Minute aktualisieren. + useEffect(() => { + const timer = setInterval(() => setTick((n) => n + 1), 30000); + return () => clearInterval(timer); + }, []); + + const update = (field, value) => { + setForm((f) => ({ ...f, [field]: value })); + setSaved(false); + }; + + const handleSave = async (e) => { + e.preventDefault(); + setBusy(true); + setError(''); + setSaved(false); + try { + const result = await api.post('/countdown', form); + setForm(toForm(result.countdown)); + setSaved(true); + } catch (err) { + setError(err.message); + } finally { + setBusy(false); + } + }; + + if (loading) { + return

Lädt…

; + } + + const remaining = remainingLabel(form.launch_at); + const live = form.enabled && remaining && !remaining.past; + + return ( +
+
+
+

Countdown anzeigen

+
+ +
+

Texte (optional)

+

+ Leer lassen für die Standardtexte („Bald wird’s laut.“). Ohne englischen Text sehen englische Besucher den Standardtext. +

+
+
+ + update('title', e.target.value)} placeholder="Bald wird’s laut." className={inputClass} /> +
+
+ + update('title_en', e.target.value)} placeholder="Things are about to get loud." className={inputClass} /> +
+
+ +