feat: Zielgruppen-Weiche im Hero, Kontaktformular je Zielgruppe, Schnellkontakt
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
e6ba8b3f7c
commit
fdb3e3eb86
|
|
@ -10,6 +10,7 @@ import PaperlessSection from "@/components/PaperlessSection";
|
|||
import About from "@/components/About";
|
||||
import Contact from "@/components/Contact";
|
||||
import Footer from "@/components/Footer";
|
||||
import MobileContactBar from "@/components/MobileContactBar";
|
||||
import { GalerieAnzeige } from "@/components/GalerieAnzeige";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
|
@ -63,7 +64,7 @@ export default async function Home() {
|
|||
}));
|
||||
|
||||
return (
|
||||
<main className="min-h-screen bg-[#f0f4f8] dark:bg-[#18212f]">
|
||||
<main className="min-h-screen bg-[#f0f4f8] dark:bg-[#18212f] pb-16 lg:pb-0">
|
||||
<Header />
|
||||
<Hero
|
||||
eyebrowText={hero?.eyebrow_text}
|
||||
|
|
@ -104,6 +105,7 @@ export default async function Home() {
|
|||
oeffnungszeiten={oeffnung.length > 0 ? oeffnung : undefined}
|
||||
/>
|
||||
<Footer />
|
||||
<MobileContactBar />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,34 @@ interface ContactProps {
|
|||
}
|
||||
|
||||
type Status = "idle" | "loading" | "success" | "error";
|
||||
type Zielgruppe = "privat" | "geschaeftlich";
|
||||
|
||||
const themen: Record<Zielgruppe, string[]> = {
|
||||
privat: [
|
||||
"Mein WLAN ist langsam oder instabil",
|
||||
"PC / Notebook läuft nicht richtig",
|
||||
"Neuen Computer einrichten",
|
||||
"Daten sichern / Fotos retten",
|
||||
"Familienschutz (FamilyGuard)",
|
||||
"Eigene Cloud (Nextcloud)",
|
||||
"Sonstiges",
|
||||
],
|
||||
geschaeftlich: [
|
||||
"IT-Betreuung & Support",
|
||||
"Netzwerk & WLAN",
|
||||
"Sicherer Fernzugriff (VPN)",
|
||||
"Dokumentenarchiv (Nextcloud + Paperless)",
|
||||
"Datensicherung & Backup",
|
||||
"IT-Sicherheit & Datenschutz",
|
||||
"Server, Cloud & Hosting",
|
||||
"Webseite / Webanwendung",
|
||||
"Sonstiges",
|
||||
],
|
||||
};
|
||||
|
||||
const inputClass =
|
||||
"w-full px-4 py-3 rounded-xl bg-slate-50 dark:bg-[#111925] border border-slate-300 dark:border-gray-700 text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-slate-600 focus:outline-none focus:border-orange-500/60 focus:ring-1 focus:ring-orange-500/20 transition-colors";
|
||||
const labelClass = "block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2";
|
||||
|
||||
export default function Contact({
|
||||
telefon = "+49 171 9345193",
|
||||
|
|
@ -57,6 +85,9 @@ export default function Contact({
|
|||
|
||||
const [name, setName] = useState("");
|
||||
const [emailInput, setEmailInput] = useState("");
|
||||
const [zielgruppe, setZielgruppe] = useState<Zielgruppe>("privat");
|
||||
const [firma, setFirma] = useState("");
|
||||
const [telefonInput, setTelefonInput] = useState("");
|
||||
const [betreff, setBetreff] = useState("");
|
||||
const [nachricht, setNachricht] = useState("");
|
||||
const [status, setStatus] = useState<Status>("idle");
|
||||
|
|
@ -71,7 +102,18 @@ export default function Contact({
|
|||
const res = await fetch("/api/contact", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ name, email: emailInput, betreff, nachricht }),
|
||||
body: JSON.stringify({
|
||||
name,
|
||||
email: emailInput,
|
||||
telefon: telefonInput.trim() || undefined,
|
||||
betreff: `${zielgruppe === "privat" ? "Privat" : "Geschäftlich"}: ${betreff}`,
|
||||
nachricht:
|
||||
zielgruppe === "geschaeftlich" && firma.trim()
|
||||
? `Firma: ${firma.trim()}${nachricht ? `
|
||||
|
||||
${nachricht}` : ""}`
|
||||
: nachricht,
|
||||
}),
|
||||
});
|
||||
const data = await res.json();
|
||||
|
||||
|
|
@ -125,6 +167,8 @@ export default function Contact({
|
|||
setStatus("idle");
|
||||
setName("");
|
||||
setEmailInput("");
|
||||
setTelefonInput("");
|
||||
setFirma("");
|
||||
setBetreff("");
|
||||
setNachricht("");
|
||||
}}
|
||||
|
|
@ -135,63 +179,122 @@ export default function Contact({
|
|||
</div>
|
||||
) : (
|
||||
<form className="space-y-6" onSubmit={handleSubmit}>
|
||||
<fieldset>
|
||||
<legend className={labelClass}>Ich melde mich als</legend>
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
{([
|
||||
["privat", "Privatkunde"],
|
||||
["geschaeftlich", "Unternehmen"],
|
||||
] as const).map(([value, label]) => (
|
||||
<label
|
||||
key={value}
|
||||
className={`cursor-pointer text-center px-4 py-3 rounded-xl border text-sm font-bold transition-colors ${
|
||||
zielgruppe === value
|
||||
? "border-orange-500 bg-orange-500/10 text-orange-500 dark:text-orange-400"
|
||||
: "border-slate-300 dark:border-gray-700 text-slate-600 dark:text-slate-400 hover:border-orange-500/40"
|
||||
}`}
|
||||
>
|
||||
<input
|
||||
type="radio"
|
||||
name="zielgruppe"
|
||||
value={value}
|
||||
checked={zielgruppe === value}
|
||||
onChange={() => {
|
||||
setZielgruppe(value);
|
||||
setBetreff("");
|
||||
}}
|
||||
className="sr-only"
|
||||
/>
|
||||
{label}
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div className="grid sm:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">Name</label>
|
||||
<label htmlFor="contact-name" className={labelClass}>Name</label>
|
||||
<input
|
||||
id="contact-name"
|
||||
type="text"
|
||||
required
|
||||
autoComplete="name"
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
placeholder="Max Mustermann"
|
||||
className="w-full px-4 py-3 rounded-xl bg-slate-50 dark:bg-[#111925] border border-slate-300 dark:border-gray-700 text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-slate-600 focus:outline-none focus:border-orange-500/60 focus:ring-1 focus:ring-orange-500/20 transition-colors"
|
||||
className={inputClass}
|
||||
/>
|
||||
</div>
|
||||
{zielgruppe === "geschaeftlich" ? (
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-slate-700 dark:text-slate-300 mb-2">E-Mail</label>
|
||||
<label htmlFor="contact-firma" className={labelClass}>Firma (optional)</label>
|
||||
<input
|
||||
id="contact-firma"
|
||||
type="text"
|
||||
autoComplete="organization"
|
||||
value={firma}
|
||||
onChange={(e) => setFirma(e.target.value)}
|
||||
placeholder="Musterfirma GmbH"
|
||||
className={inputClass}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
<div>
|
||||
<label htmlFor="contact-email" className={labelClass}>E-Mail</label>
|
||||
<input
|
||||
id="contact-email"
|
||||
type="email"
|
||||
required
|
||||
autoComplete="email"
|
||||
value={emailInput}
|
||||
onChange={(e) => setEmailInput(e.target.value)}
|
||||
placeholder="max@beispiel.de"
|
||||
className="w-full px-4 py-3 rounded-xl bg-slate-50 dark:bg-[#111925] border border-slate-300 dark:border-gray-700 text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-slate-600 focus:outline-none focus:border-orange-500/60 focus:ring-1 focus:ring-orange-500/20 transition-colors"
|
||||
className={inputClass}
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<label htmlFor="contact-telefon" className={labelClass}>Telefon (optional, für Rückruf)</label>
|
||||
<input
|
||||
id="contact-telefon"
|
||||
type="tel"
|
||||
autoComplete="tel"
|
||||
value={telefonInput}
|
||||
onChange={(e) => setTelefonInput(e.target.value)}
|
||||
placeholder="0171 1234567"
|
||||
className={inputClass}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-slate-300 mb-2">Betreff</label>
|
||||
<label htmlFor="contact-betreff" className={labelClass}>Worum geht es?</label>
|
||||
<select
|
||||
id="contact-betreff"
|
||||
required
|
||||
value={betreff}
|
||||
onChange={(e) => setBetreff(e.target.value)}
|
||||
className="w-full px-4 py-3 rounded-xl bg-slate-50 dark:bg-[#111925] border border-slate-300 dark:border-gray-700 text-slate-900 dark:text-white focus:outline-none focus:border-orange-500/60 focus:ring-1 focus:ring-orange-500/20 transition-colors appearance-none"
|
||||
className={`${inputClass} appearance-none`}
|
||||
>
|
||||
<option value="">Thema auswählen...</option>
|
||||
<option value="hardware">Hard- & Software</option>
|
||||
<option value="netzwerk">Netzwerk & WLAN</option>
|
||||
<option value="backup">Datensicherung & Backup</option>
|
||||
<option value="docker">Docker Installation</option>
|
||||
<option value="fernwartung">Fernwartung & Support</option>
|
||||
<option value="hetzner">Hetzner Cloud Infrastruktur</option>
|
||||
<option value="beratung">IT-Beratung</option>
|
||||
<option value="sicherheit">IT-Sicherheit & Datenschutz</option>
|
||||
<option value="proxmox">Proxmox Virtualisierung</option>
|
||||
<option value="server">Server & Hosting</option>
|
||||
<option value="webseiten">Webseiten & Webanwendungen</option>
|
||||
<option value="other">Sonstiges</option>
|
||||
{themen[zielgruppe].map((t) => (
|
||||
<option key={t} value={t}>{t}</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-slate-300 mb-2">Nachricht</label>
|
||||
<label htmlFor="contact-nachricht" className={labelClass}>Nachricht</label>
|
||||
<textarea
|
||||
id="contact-nachricht"
|
||||
rows={5}
|
||||
value={nachricht}
|
||||
onChange={(e) => setNachricht(e.target.value)}
|
||||
placeholder="Beschreiben Sie Ihr Projekt oder Ihre Anfrage..."
|
||||
className="w-full px-4 py-3 rounded-xl bg-slate-50 dark:bg-[#111925] border border-slate-300 dark:border-gray-700 text-slate-900 dark:text-white placeholder-slate-400 dark:placeholder-slate-600 focus:outline-none focus:border-orange-500/60 focus:ring-1 focus:ring-orange-500/20 transition-colors resize-none"
|
||||
placeholder={
|
||||
zielgruppe === "privat"
|
||||
? "Beschreiben Sie kurz Ihr Problem oder Ihren Wunsch..."
|
||||
: "Beschreiben Sie Ihr Anliegen, z. B. Anzahl Arbeitsplätze und Standorte..."
|
||||
}
|
||||
className={`${inputClass} resize-none`}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ import Link from "next/link";
|
|||
import Logo from "./Logo";
|
||||
import ThemeToggle from "./ThemeToggle";
|
||||
|
||||
const PHONE_DISPLAY = "+49 171 9345193";
|
||||
const PHONE_HREF = "tel:+491719345193";
|
||||
|
||||
const navLinks = [
|
||||
{ label: "Services", href: "/#services" },
|
||||
{ label: "Privatkunden", href: "/privatkunden" },
|
||||
|
|
@ -59,6 +62,14 @@ export default function Header() {
|
|||
{link.label}
|
||||
</Link>
|
||||
))}
|
||||
<a
|
||||
href={PHONE_HREF}
|
||||
aria-label={`Anrufen: ${PHONE_DISPLAY}`}
|
||||
className="flex items-center gap-2 text-slate-700 dark:text-slate-300 hover:text-orange-400 transition-colors text-sm font-semibold"
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" /></svg>
|
||||
<span className="hidden xl:inline">{PHONE_DISPLAY}</span>
|
||||
</a>
|
||||
<Link
|
||||
href="/#contact"
|
||||
className="btn-nav"
|
||||
|
|
@ -72,7 +83,8 @@ export default function Header() {
|
|||
<button
|
||||
className="lg:hidden text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white transition-colors"
|
||||
onClick={() => setMenuOpen(!menuOpen)}
|
||||
aria-label="Menu"
|
||||
aria-label={menuOpen ? "Menü schließen" : "Menü öffnen"}
|
||||
aria-expanded={menuOpen}
|
||||
>
|
||||
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
{menuOpen ? (
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export default function Hero({
|
|||
const typed = useTypewriter(words);
|
||||
|
||||
return (
|
||||
<section className="relative min-h-screen flex items-center justify-center overflow-hidden pt-20 sm:pt-0">
|
||||
<section className="relative min-h-screen flex items-center justify-center overflow-hidden pt-24 pb-24 sm:pt-20">
|
||||
{/* Background grid */}
|
||||
<div className="absolute inset-0 bg-grid opacity-50" />
|
||||
|
||||
|
|
@ -68,22 +68,50 @@ export default function Hero({
|
|||
|
||||
{/* Subheadline */}
|
||||
{subtext1 && (
|
||||
<p className="text-xl sm:text-2xl text-slate-600 dark:text-slate-400 max-w-3xl mx-auto mb-4 leading-relaxed">
|
||||
<p className="text-lg sm:text-xl text-slate-600 dark:text-slate-400 max-w-3xl mx-auto mb-6 leading-relaxed">
|
||||
{subtext1}
|
||||
</p>
|
||||
)}
|
||||
{subtext2 && (
|
||||
<p className="text-xl sm:text-2xl text-slate-600 dark:text-slate-400 max-w-3xl mx-auto mb-4 leading-relaxed">
|
||||
<p className="text-lg sm:text-xl text-slate-600 dark:text-slate-400 max-w-3xl mx-auto mb-6 leading-relaxed">
|
||||
{subtext2}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{/* Zielgruppen-Weiche */}
|
||||
<div className="grid sm:grid-cols-2 gap-4 max-w-3xl mx-auto mb-10 text-left">
|
||||
<a
|
||||
href="/privatkunden"
|
||||
className="group p-5 rounded-2xl bg-white/80 dark:bg-gray-900/80 border border-slate-200 dark:border-gray-700 hover:border-orange-500/60 hover:shadow-lg hover:shadow-orange-500/10 transition-all"
|
||||
>
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
<span className="text-lg font-black text-slate-900 dark:text-white">Ich bin Privatkunde</span>
|
||||
<span className="text-orange-400 group-hover:translate-x-1 transition-transform" aria-hidden="true">→</span>
|
||||
</div>
|
||||
<p className="text-sm text-slate-600 dark:text-slate-400">
|
||||
WLAN, PC, Familienschutz und eigene Cloud für zu Hause.
|
||||
</p>
|
||||
</a>
|
||||
<a
|
||||
href="/geschaeftskunden"
|
||||
className="group p-5 rounded-2xl bg-white/80 dark:bg-gray-900/80 border border-slate-200 dark:border-gray-700 hover:border-blue-500/60 hover:shadow-lg hover:shadow-blue-500/10 transition-all"
|
||||
>
|
||||
<div className="flex items-center justify-between mb-1">
|
||||
<span className="text-lg font-black text-slate-900 dark:text-white">Ich bin Unternehmen</span>
|
||||
<span className="text-blue-400 group-hover:translate-x-1 transition-transform" aria-hidden="true">→</span>
|
||||
</div>
|
||||
<p className="text-sm text-slate-600 dark:text-slate-400">
|
||||
Netzwerk, sicherer Fernzugriff, Dokumentenarchiv und IT-Betreuung.
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{/* Tech pills */}
|
||||
<div className="flex flex-wrap items-center justify-center gap-3 mb-10">
|
||||
<div className="flex flex-wrap items-center justify-center gap-2 mb-8 opacity-70">
|
||||
{badges.map((badge) => (
|
||||
<span
|
||||
key={badge}
|
||||
className="px-3 py-1 rounded-md bg-slate-100 dark:bg-gray-900 border border-slate-200 dark:border-gray-700 text-slate-700 dark:text-slate-300 text-sm font-mono"
|
||||
className="px-2.5 py-0.5 rounded-md bg-slate-100 dark:bg-gray-900 border border-slate-200 dark:border-gray-700 text-slate-700 dark:text-slate-300 text-xs font-mono"
|
||||
>
|
||||
{badge}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
export default function MobileContactBar() {
|
||||
return (
|
||||
<div className="lg:hidden fixed bottom-0 left-0 right-0 z-40 grid grid-cols-2 gap-2 p-2 bg-white/95 dark:bg-[#111925]/95 backdrop-blur-md border-t border-slate-200 dark:border-gray-800">
|
||||
<a
|
||||
href="tel:+491719345193"
|
||||
className="flex items-center justify-center gap-2 py-3 rounded-xl border border-orange-500/40 text-orange-500 dark:text-orange-400 text-sm font-bold"
|
||||
>
|
||||
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" />
|
||||
</svg>
|
||||
Anrufen
|
||||
</a>
|
||||
<a
|
||||
href="/#contact"
|
||||
className="flex items-center justify-center py-3 rounded-xl bg-orange-500 hover:bg-orange-400 text-white text-sm font-bold transition-colors"
|
||||
>
|
||||
Anfrage senden
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Reference in New Issue