first commit
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
---
|
||||
interface Variant {
|
||||
id: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
variants: Variant[];
|
||||
regionId: string;
|
||||
}
|
||||
|
||||
const { variants, regionId } = Astro.props;
|
||||
---
|
||||
|
||||
<div>
|
||||
{variants.length > 1 && (
|
||||
<div id="variant-picker" class="mb-5 flex flex-wrap gap-2">
|
||||
{variants.map((variant, index) => (
|
||||
<label class="relative">
|
||||
<input
|
||||
type="radio"
|
||||
name="variant"
|
||||
value={variant.id}
|
||||
checked={index === 0}
|
||||
class="peer sr-only"
|
||||
/>
|
||||
<span class="block cursor-pointer rounded-full border border-brand-border px-4 py-2 text-sm font-medium text-brand-text transition-colors peer-checked:border-brand-primary peer-checked:bg-brand-primary peer-checked:text-white hover:border-brand-primary">
|
||||
{variant.title}
|
||||
</span>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<button
|
||||
id="add-to-cart"
|
||||
data-variant-id={variants[0]?.id}
|
||||
data-region-id={regionId}
|
||||
class="rounded-full bg-brand-primary text-brand-ink px-6 py-3 text-sm font-semibold hover:bg-brand-primary-hover transition-colors disabled:opacity-50"
|
||||
>
|
||||
In den Warenkorb
|
||||
</button>
|
||||
<p id="add-to-cart-status" class="mt-3 text-sm text-brand-text-muted hidden"></p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
import { createCart, addLineItem } from "../lib/cart";
|
||||
import { getCartIdClient, setCartIdClient } from "../lib/cartCookie";
|
||||
|
||||
const button = document.getElementById("add-to-cart") as HTMLButtonElement | null;
|
||||
const status = document.getElementById("add-to-cart-status");
|
||||
|
||||
function selectedVariantId(): string | undefined {
|
||||
const checked = document.querySelector<HTMLInputElement>('input[name="variant"]:checked');
|
||||
return checked?.value || button?.dataset.variantId;
|
||||
}
|
||||
|
||||
button?.addEventListener("click", async () => {
|
||||
const variantId = selectedVariantId();
|
||||
if (!variantId) return;
|
||||
|
||||
button.disabled = true;
|
||||
try {
|
||||
let cartId = getCartIdClient();
|
||||
if (!cartId) {
|
||||
const cart = await createCart(button.dataset.regionId!);
|
||||
cartId = cart.id;
|
||||
setCartIdClient(cartId);
|
||||
}
|
||||
await addLineItem(cartId, variantId, 1);
|
||||
window.dispatchEvent(new CustomEvent("cart:updated"));
|
||||
if (status) {
|
||||
status.textContent = "Zum Warenkorb hinzugefügt.";
|
||||
status.classList.remove("hidden");
|
||||
}
|
||||
} catch {
|
||||
if (status) {
|
||||
status.textContent = "Das hat leider nicht geklappt. Bitte erneut versuchen.";
|
||||
status.classList.remove("hidden");
|
||||
}
|
||||
} finally {
|
||||
button.disabled = false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
import { sections, COMPANY_NAME, type Section } from "../lib/sections";
|
||||
|
||||
interface Props {
|
||||
section: Section;
|
||||
}
|
||||
|
||||
const { section } = Astro.props;
|
||||
const config = sections[section];
|
||||
const other = section === "private" ? sections.business : sections.private;
|
||||
const year = new Date().getFullYear();
|
||||
---
|
||||
|
||||
<footer class="mt-24 bg-white border-t border-brand-border">
|
||||
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 py-14 grid gap-8 sm:grid-cols-3">
|
||||
<div>
|
||||
<p class="font-display text-2xl text-brand-ink">{COMPANY_NAME}</p>
|
||||
<p class="text-sm text-brand-text-muted mt-1 normal-case">{config.tagline}</p>
|
||||
</div>
|
||||
<div class="text-sm text-brand-text-muted">
|
||||
<p class="font-medium text-brand-ink mb-2 normal-case">Auch interessant</p>
|
||||
<a href={other.homeHref} class="hover:text-brand-primary transition-colors">{other.label}</a>
|
||||
</div>
|
||||
<div class="text-sm text-brand-text-muted">
|
||||
<p class="normal-case">© {year} {COMPANY_NAME}</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
@@ -0,0 +1,163 @@
|
||||
---
|
||||
import { sections, COMPANY_NAME, type Section } from "../lib/sections";
|
||||
|
||||
interface Props {
|
||||
section: Section;
|
||||
}
|
||||
|
||||
const { section } = Astro.props;
|
||||
const config = sections[section];
|
||||
const currentPath = Astro.url.pathname;
|
||||
---
|
||||
|
||||
<header class="border-b border-brand-ink/10 bg-white/80 backdrop-blur sticky top-0 z-50">
|
||||
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8">
|
||||
<div class="flex h-16 items-center justify-between gap-4">
|
||||
<a href={config.homeHref} class="flex items-center gap-2 shrink-0">
|
||||
<img src="/images/place4bees-logo.png" alt="" class="h-10 w-10" />
|
||||
<span class="font-display text-xl text-brand-ink">{COMPANY_NAME}</span>
|
||||
</a>
|
||||
|
||||
<div class="hidden md:flex items-center gap-1 rounded-full bg-brand-surface p-1">
|
||||
{Object.entries(sections).map(([key, s]) => (
|
||||
<a
|
||||
href={s.homeHref}
|
||||
class:list={[
|
||||
"rounded-full px-4 py-1.5 text-sm font-semibold transition-colors",
|
||||
key === section ? "bg-brand-primary text-brand-ink" : "text-brand-text hover:text-brand-primary",
|
||||
]}
|
||||
>
|
||||
{s.label}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<nav class="hidden md:flex gap-6 items-center">
|
||||
{config.nav.map((item) => (
|
||||
<a
|
||||
href={item.href}
|
||||
class:list={[
|
||||
"text-sm font-medium hover:text-brand-primary transition-colors",
|
||||
currentPath === item.href ? "text-brand-primary" : "text-brand-text",
|
||||
]}
|
||||
>
|
||||
{item.label}
|
||||
</a>
|
||||
))}
|
||||
{section === "private" && (
|
||||
<a href="/warenkorb" class="relative inline-flex items-center hover:opacity-80 transition-opacity" aria-label="Warenkorb">
|
||||
<span class="sr-only">Warenkorb</span>
|
||||
<svg viewBox="0 0 24 24" class="h-7 w-7" aria-hidden="true">
|
||||
<ellipse cx="12" cy="5.4" rx="6.4" ry="2.1" fill="#8a5a2b" />
|
||||
<circle cx="12" cy="3.2" r="1.05" fill="#8a5a2b" />
|
||||
<path d="M5.6 7 C5.6 7 5.1 15 6.6 19 C7.4 21 16.6 21 17.4 19 C18.9 15 18.4 7 18.4 7 Z" fill="#e0a94a" stroke="#a9722a" stroke-width="0.5" />
|
||||
<rect x="5.8" y="7" width="12.4" height="2.1" rx="1" fill="#c6922f" />
|
||||
<path d="M12 21 C12 21 13 22.4 12 23.2 C11 22.4 12 21 12 21 Z" fill="#c6922f" />
|
||||
</svg>
|
||||
<span
|
||||
id="cart-badge"
|
||||
style="display:none"
|
||||
class="absolute -top-2 -right-2 inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-brand-ink px-1 text-xs text-white ring-2 ring-white"
|
||||
></span>
|
||||
</a>
|
||||
)}
|
||||
</nav>
|
||||
|
||||
<button
|
||||
id="menu-toggle"
|
||||
class="md:hidden inline-flex items-center justify-center rounded-md p-2 text-brand-text"
|
||||
aria-label="Menü öffnen"
|
||||
aria-expanded="false"
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<nav id="mobile-menu" class="md:hidden hidden pb-4 flex flex-col gap-3">
|
||||
<div class="flex gap-1 rounded-full bg-brand-surface p-1 mb-2">
|
||||
{Object.entries(sections).map(([key, s]) => (
|
||||
<a
|
||||
href={s.homeHref}
|
||||
class:list={[
|
||||
"flex-1 text-center rounded-full px-4 py-1.5 text-sm font-semibold transition-colors",
|
||||
key === section ? "bg-brand-primary text-brand-ink" : "text-brand-text",
|
||||
]}
|
||||
>
|
||||
{s.label}
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
{config.nav.map((item) => (
|
||||
<a href={item.href} class="text-sm font-medium text-brand-text hover:text-brand-primary">
|
||||
{item.label}
|
||||
</a>
|
||||
))}
|
||||
{section === "private" && (
|
||||
<a href="/warenkorb" class="relative inline-flex items-center gap-2 text-sm font-medium text-brand-text hover:text-brand-primary">
|
||||
<svg viewBox="0 0 24 24" class="h-6 w-6 shrink-0" aria-hidden="true">
|
||||
<ellipse cx="12" cy="5.4" rx="6.4" ry="2.1" fill="#8a5a2b" />
|
||||
<circle cx="12" cy="3.2" r="1.05" fill="#8a5a2b" />
|
||||
<path d="M5.6 7 C5.6 7 5.1 15 6.6 19 C7.4 21 16.6 21 17.4 19 C18.9 15 18.4 7 18.4 7 Z" fill="#e0a94a" stroke="#a9722a" stroke-width="0.5" />
|
||||
<rect x="5.8" y="7" width="12.4" height="2.1" rx="1" fill="#c6922f" />
|
||||
<path d="M12 21 C12 21 13 22.4 12 23.2 C11 22.4 12 21 12 21 Z" fill="#c6922f" />
|
||||
</svg>
|
||||
Warenkorb
|
||||
<span
|
||||
id="cart-badge-mobile"
|
||||
style="display:none"
|
||||
class="inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-brand-ink px-1 text-xs text-white"
|
||||
></span>
|
||||
</a>
|
||||
)}
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<script>
|
||||
const toggle = document.getElementById("menu-toggle");
|
||||
const menu = document.getElementById("mobile-menu");
|
||||
toggle?.addEventListener("click", () => {
|
||||
const isHidden = menu?.classList.contains("hidden");
|
||||
menu?.classList.toggle("hidden");
|
||||
toggle.setAttribute("aria-expanded", String(isHidden));
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
import { getCart } from "../lib/cart";
|
||||
import { getCartIdClient } from "../lib/cartCookie";
|
||||
|
||||
async function refreshCartBadge() {
|
||||
const badges = [
|
||||
document.getElementById("cart-badge"),
|
||||
document.getElementById("cart-badge-mobile"),
|
||||
].filter((el): el is HTMLElement => el != null);
|
||||
if (badges.length === 0) return;
|
||||
|
||||
const cartId = getCartIdClient();
|
||||
if (!cartId) {
|
||||
badges.forEach((badge) => (badge.style.display = "none"));
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const cart = await getCart(cartId);
|
||||
const count = (cart.items ?? []).reduce((sum, item) => sum + item.quantity, 0);
|
||||
badges.forEach((badge) => {
|
||||
if (count > 0) {
|
||||
badge.textContent = String(count);
|
||||
badge.style.display = "inline-flex";
|
||||
} else {
|
||||
badge.style.display = "none";
|
||||
}
|
||||
});
|
||||
} catch {
|
||||
badges.forEach((badge) => (badge.style.display = "none"));
|
||||
}
|
||||
}
|
||||
|
||||
refreshCartBadge();
|
||||
window.addEventListener("cart:updated", refreshCartBadge);
|
||||
</script>
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
import { partners } from "../lib/partners";
|
||||
---
|
||||
|
||||
<section class="bg-white">
|
||||
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 py-16 sm:py-20">
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.25em] text-brand-accent text-center">Vertrauen uns</p>
|
||||
<h2 class="mt-2 text-3xl text-brand-ink text-center">Unsere Partner</h2>
|
||||
<div class="mt-10 grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-6 gap-8 items-center">
|
||||
{partners.map((partner) => (
|
||||
<img
|
||||
src={`/images/partners/${partner.file}`}
|
||||
alt={partner.name}
|
||||
title={partner.name}
|
||||
class="h-12 w-auto mx-auto object-contain grayscale opacity-70 hover:opacity-100 hover:grayscale-0 transition"
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,70 @@
|
||||
---
|
||||
import PartnerGrid from "../PartnerGrid.astro";
|
||||
---
|
||||
|
||||
<section
|
||||
class="relative bg-cover bg-center"
|
||||
style="background-image: linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.55)), url('/images/business-hero.jpg');"
|
||||
>
|
||||
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 py-24 sm:py-36">
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.25em] text-brand-accent">Nachhaltig · Professionell · Hamburg</p>
|
||||
<h1 class="mt-4 text-4xl sm:text-6xl text-white max-w-2xl">
|
||||
Eigene Bienen vor Ort.
|
||||
</h1>
|
||||
<p class="mt-5 text-lg text-white/85 max-w-md normal-case">
|
||||
Professionell betreut. Nachhaltig erlebbar. Corporate Beekeeping für Unternehmen und Hotels – von place4bees.
|
||||
</p>
|
||||
<div class="mt-10 flex flex-wrap gap-4">
|
||||
<a href="/business/anfrage" class="rounded bg-brand-primary text-brand-ink px-7 py-3 text-sm font-semibold hover:bg-brand-primary-hover transition-colors">
|
||||
Interesse? Jetzt anfragen
|
||||
</a>
|
||||
<a href="/business/ihr-projekt" class="rounded border border-white/50 text-white px-7 py-3 text-sm font-semibold hover:bg-white/10 transition-colors">
|
||||
Ihr Projekt
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="bg-white py-10 flex justify-center">
|
||||
<img src="/images/logo-badge.png" alt="place4bees – Modern Beekeeping, est. 2021" class="h-40 w-auto" />
|
||||
</section>
|
||||
|
||||
<section class="bg-brand-surface">
|
||||
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 py-16 sm:py-20 grid gap-10 sm:grid-cols-2 items-center">
|
||||
<div>
|
||||
<h2 class="text-3xl text-brand-ink">Geben Sie Bienen ein Zuhause</h2>
|
||||
<p class="mt-4 text-brand-text normal-case">
|
||||
Zusammen mit place4bees können Unternehmen und Hotels heimischen Honigbienen jetzt einen
|
||||
geeigneten Lebensraum geben und so einen wertvollen Beitrag zur lokalen Naturvielfalt
|
||||
leisten. Die Möglichkeiten sind individuell und vielfältig, aber eines haben sie
|
||||
gemeinsam: ein Nachhaltigkeitserlebnis vor Ort – zusammen mit place4bees professionell
|
||||
betreut und spannend aufbereitet.
|
||||
</p>
|
||||
<a href="/business/anfrage" class="mt-6 inline-block rounded bg-brand-primary text-brand-ink px-7 py-3 text-sm font-semibold hover:bg-brand-primary-hover transition-colors">
|
||||
Starten Sie jetzt Ihr Unternehmensbienen-Projekt
|
||||
</a>
|
||||
</div>
|
||||
<img src="/images/business-hero-2.jpg" alt="Bienenstöcke vor Ort" class="rounded-2xl w-full h-80 object-cover" />
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="bg-white">
|
||||
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 py-16 sm:py-20 grid gap-10 sm:grid-cols-2 items-center">
|
||||
<img src="/images/bee-on-flower.jpg" alt="Biene auf einer Blüte" class="rounded-2xl w-full h-80 object-cover" />
|
||||
<div>
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.2em] text-brand-accent">Zum Hintergrund</p>
|
||||
<h2 class="mt-2 text-3xl text-brand-ink">Aktiver Bienenschutz</h2>
|
||||
<p class="mt-4 text-brand-text normal-case">
|
||||
Bienen nehmen eine Schlüsselrolle in unserem globalen Ökosystem ein. Mit ihrer
|
||||
Bestäubungsleistung sind sie elementar für die Artenvielfalt. Doch: Die Bienen brauchen
|
||||
unsere Hilfe. Allein in Europa sterben jedes Jahr zwei Millionen Bienenvölker.
|
||||
</p>
|
||||
<p class="mt-4 text-brand-text normal-case">
|
||||
Ein Unternehmensbienen-Projekt bedeutet erlebbare Nachhaltigkeit vor Ort und aktive
|
||||
Unterstützung der lokalen Biodiversität.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<PartnerGrid />
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
---
|
||||
|
||||
<section
|
||||
class="relative bg-cover bg-center"
|
||||
style="background-image: linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.55)), url('/images/private-hero.jpg');"
|
||||
>
|
||||
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 py-24 sm:py-36">
|
||||
<p class="text-xs font-semibold uppercase tracking-[0.25em] text-brand-accent">Regional · Nachhaltig · Hamburg</p>
|
||||
<h1 class="mt-4 text-4xl sm:text-6xl text-white max-w-2xl">
|
||||
Unsere fleißigen Bienen erzeugen regionalen Honig
|
||||
</h1>
|
||||
<p class="mt-5 text-lg text-white/85 max-w-md normal-case">
|
||||
Einige davon mitten in Hamburg. Frisch aus der Region, direkt von place4bees.
|
||||
</p>
|
||||
<div class="mt-10 flex flex-wrap gap-4">
|
||||
<a href="/shop" class="rounded bg-brand-primary text-brand-ink px-7 py-3 text-sm font-semibold hover:bg-brand-primary-hover transition-colors">
|
||||
Zum Shop
|
||||
</a>
|
||||
<a href="/ueber-uns" class="rounded border border-white/50 text-white px-7 py-3 text-sm font-semibold hover:bg-white/10 transition-colors">
|
||||
Über uns
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="bg-brand-surface">
|
||||
<div class="mx-auto max-w-6xl px-4 sm:px-6 lg:px-8 py-16 sm:py-20 grid gap-10 sm:grid-cols-3">
|
||||
<div>
|
||||
<h2 class="text-2xl text-brand-ink">Regionale Honigsorten</h2>
|
||||
<p class="mt-2 text-sm text-brand-text normal-case">Rapshonig, Frühlingsblüte, Akazie, Wald- und Heidehonig – cremig oder flüssig.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="text-2xl text-brand-ink">Bienenprodukte</h2>
|
||||
<p class="mt-2 text-sm text-brand-text normal-case">Bienenwachskerzen, reines Bienenwachs und Honigseifen aus eigener Herstellung.</p>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="text-2xl text-brand-ink">Erlebnis & Patenschaft</h2>
|
||||
<p class="mt-2 text-sm text-brand-text normal-case">Bienen-Schnupperkurse und Bienenpatenschaften für Privatpersonen.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user