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:
38
src/lib/cookie-banner-info.ts
Normal file
38
src/lib/cookie-banner-info.ts
Normal 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);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user