Add native cookie consent and move hero intro above CTA

- Restore CookieConsent banner behavior with the new dependency
- Reposition the right-panel intro above the Projekt anfragen button
- Add focused tests and update build metadata
This commit is contained in:
2026-05-06 21:22:12 +02:00
parent ed74fd0652
commit d2ba994fad
8 changed files with 174 additions and 4 deletions

View File

@@ -76,7 +76,7 @@ const LandingHeroSection = () => {
<div className="relative z-10 flex min-h-[520px] flex-1 flex-col lg:min-h-0">
<div className="flex shrink-0 items-start justify-between border-b border-primary-foreground/30 pb-5 text-xs uppercase tracking-[0.28em]">
<span></span>
<span></span>
<span>&copy;2026</span>
</div>
@@ -117,8 +117,8 @@ const LandingHeroSection = () => {
</button>
</div>
<div className="relative flex min-h-0 flex-1 flex-col justify-center py-10 lg:py-14">
<div className="pointer-events-none absolute bottom-8 right-0 h-36 w-36 border border-primary-foreground/35 sm:bottom-10 sm:right-2 lg:bottom-16 lg:right-10" />
<div className="relative mt-auto pt-16 pb-8 lg:pt-24 lg:pb-10">
<div className="pointer-events-none absolute bottom-0 right-0 h-36 w-36 border border-primary-foreground/35 sm:right-2 lg:right-10" />
<div className="relative max-w-xl">
<p className="text-[clamp(4rem,10vw,9rem)] font-black uppercase leading-[0.75] tracking-normal">
01
@@ -131,7 +131,7 @@ const LandingHeroSection = () => {
<a
href="#kontakt"
className="group relative z-10 mt-auto inline-flex w-fit shrink-0 items-center gap-3 border border-primary-foreground px-5 py-4 text-sm font-semibold uppercase tracking-[0.18em] transition hover:bg-primary-foreground hover:text-primary"
className="group relative z-10 inline-flex w-fit shrink-0 items-center gap-3 border border-primary-foreground px-5 py-4 text-sm font-semibold uppercase tracking-[0.18em] transition hover:bg-primary-foreground hover:text-primary"
>
Projekt anfragen
<ArrowUpRight className="size-5 transition group-hover:-translate-y-0.5 group-hover:translate-x-0.5" />

View File

@@ -0,0 +1,38 @@
import { run } from "vanilla-cookieconsent";
import "vanilla-cookieconsent/dist/cookieconsent.css";
const bannerText =
"Diese Website setzt keine Cookies. Wir erfassen ausschließlich anonymisierte Analytics-Daten, die keinen Rückschluss auf einzelne Nutzer zulassen.";
export function initCookieInfoBanner(): void {
if (typeof globalThis.window === "undefined") return;
void run({
hideFromBots: false,
categories: {
necessary: {
enabled: true,
readOnly: true,
},
},
cookie: {
name: "cc_notice",
useLocalStorage: true,
expiresAfterDays: 365,
},
language: {
default: "de",
translations: {
de: {
consentModal: {
title: "Datenschutzhinweis",
description: bannerText,
acceptNecessaryBtn: "Verstanden",
},
},
},
},
}).catch((err) => {
console.error("[CookieBanner]", err);
});
}

View File

@@ -22,5 +22,9 @@ import "@/styles/global.css";
<LandingHeroSection client:media="(min-width: 1024px)" />
<LandingRest />
</main>
<script>
import { initCookieInfoBanner } from "@/lib/cookie-banner-info";
initCookieInfoBanner();
</script>
</body>
</html>