diff --git a/public/kartenlegen/cups.jpg b/public/kartenlegen/cups.jpg new file mode 100644 index 0000000..f6d95ff Binary files /dev/null and b/public/kartenlegen/cups.jpg differ diff --git a/public/kartenlegen/death.jpg b/public/kartenlegen/death.jpg new file mode 100644 index 0000000..50b14e5 Binary files /dev/null and b/public/kartenlegen/death.jpg differ diff --git a/public/kartenlegen/empress.jpg b/public/kartenlegen/empress.jpg new file mode 100644 index 0000000..6ea2b29 Binary files /dev/null and b/public/kartenlegen/empress.jpg differ diff --git a/public/kartenlegen/fool.jpg b/public/kartenlegen/fool.jpg new file mode 100644 index 0000000..15f8f5e Binary files /dev/null and b/public/kartenlegen/fool.jpg differ diff --git a/public/kartenlegen/hermit.jpg b/public/kartenlegen/hermit.jpg new file mode 100644 index 0000000..bd7b87e Binary files /dev/null and b/public/kartenlegen/hermit.jpg differ diff --git a/public/kartenlegen/magician.jpg b/public/kartenlegen/magician.jpg new file mode 100644 index 0000000..5e6cf04 Binary files /dev/null and b/public/kartenlegen/magician.jpg differ diff --git a/public/kartenlegen/moon.jpg b/public/kartenlegen/moon.jpg new file mode 100644 index 0000000..642305e Binary files /dev/null and b/public/kartenlegen/moon.jpg differ diff --git a/public/kartenlegen/pents.jpg b/public/kartenlegen/pents.jpg new file mode 100644 index 0000000..af76798 Binary files /dev/null and b/public/kartenlegen/pents.jpg differ diff --git a/public/kartenlegen/priestess.jpg b/public/kartenlegen/priestess.jpg new file mode 100644 index 0000000..95a8cfc Binary files /dev/null and b/public/kartenlegen/priestess.jpg differ diff --git a/public/kartenlegen/strength.jpg b/public/kartenlegen/strength.jpg new file mode 100644 index 0000000..d13a406 Binary files /dev/null and b/public/kartenlegen/strength.jpg differ diff --git a/public/kartenlegen/swords.jpg b/public/kartenlegen/swords.jpg new file mode 100644 index 0000000..efcf74a Binary files /dev/null and b/public/kartenlegen/swords.jpg differ diff --git a/public/kartenlegen/temperance.jpg b/public/kartenlegen/temperance.jpg new file mode 100644 index 0000000..e745340 Binary files /dev/null and b/public/kartenlegen/temperance.jpg differ diff --git a/public/kartenlegen/tower.jpg b/public/kartenlegen/tower.jpg new file mode 100644 index 0000000..cc3ef3f Binary files /dev/null and b/public/kartenlegen/tower.jpg differ diff --git a/public/kartenlegen/wands.jpg b/public/kartenlegen/wands.jpg new file mode 100644 index 0000000..672671f Binary files /dev/null and b/public/kartenlegen/wands.jpg differ diff --git a/public/kartenlegen/wheel.jpg b/public/kartenlegen/wheel.jpg new file mode 100644 index 0000000..9466d7c Binary files /dev/null and b/public/kartenlegen/wheel.jpg differ diff --git a/src/app/(shop)/beratung/page.tsx b/src/app/(shop)/beratung/page.tsx index e9479ae..d7a7631 100644 --- a/src/app/(shop)/beratung/page.tsx +++ b/src/app/(shop)/beratung/page.tsx @@ -3,6 +3,9 @@ import { db } from "@/lib/db"; import { formatPrice } from "@/lib/money"; import { NOTICE, PUBLIC_ADVISOR, fmtDateTime, freeSlots, getConsultingSettings } from "@/lib/consulting"; import { Icon } from "@/components/Icon"; +import { CardReadingGuide, CardReadingHero } from "@/components/shop/CardReadingGuide"; +import { KlEffects } from "@/components/shop/CardReadingEffects"; +import "@/styles/kartenlegen.css"; export async function generateMetadata() { const s = await getConsultingSettings(); @@ -44,11 +47,19 @@ export default async function ConsultingPortal({ searchParams }: { searchParams: ) : null; return ( -
- Beratung -

{settings.navLabel}

-

Wähle deine Beraterin, frag einen Wunschtermin an und bezahle erst, wenn sie bestätigt hat. Die Legung findet als Video- oder Audio-Call direkt hier im Browser statt, ganz ohne App.

-

{NOTICE}

+ // Der Bereich ist eine eigene Nachtwelt und bleibt auch im hellen Shop-Theme dunkel +
+ + + + +
+
+
+ Beraterinnen +

Finde die Beraterin, die zu dir passt

+

Wähle deine Beraterin, frag einen Wunschtermin an und bezahle erst, wenn sie bestätigt hat.

+
{all.length > 0 && (
@@ -100,6 +111,9 @@ export default async function ConsultingPortal({ searchParams }: { searchParams: })}
)} +

{NOTICE}

+
+
); } diff --git a/src/components/shop/CardReadingEffects.tsx b/src/components/shop/CardReadingEffects.tsx new file mode 100644 index 0000000..0aca003 --- /dev/null +++ b/src/components/shop/CardReadingEffects.tsx @@ -0,0 +1,206 @@ +"use client"; + +import { useEffect, useRef, useState } from "react"; + +// Bewegte Teile des Kartenlegen-Portals: Sternenhimmel, Zeiger-Effekte, Einblenden beim Scrollen +// und das Ziehen von drei Karten. Bei „Bewegung reduzieren“ bleibt alles ruhig. + +type Star = { x: number; y: number; r: number; p: number; s: number; z: number; g: boolean }; + +export function KlEffects() { + const ref = useRef(null); + + useEffect(() => { + const cv = ref.current; + const root = cv?.closest(".kl"); + const cx = cv?.getContext("2d"); + if (!cv || !root || !cx) return; + const calm = window.matchMedia("(prefers-reduced-motion: reduce)").matches; + const off: (() => void)[] = []; + const on = (t: T, ev: string, fn: (e: never) => void, opts?: AddEventListenerOptions) => { + t.addEventListener(ev, fn as EventListener, opts); + off.push(() => t.removeEventListener(ev, fn as EventListener, opts)); + }; + + // Sternenhimmel + let stars: Star[] = [], W = 0, H = 0, raf = 0, scrollY = window.scrollY; + let shoot: { x: number; y: number; dx: number; dy: number; l: number } | null = null; + const size = () => { + const dpr = Math.min(window.devicePixelRatio || 1, 2); + W = window.innerWidth; H = window.innerHeight; + cv.width = W * dpr; cv.height = H * dpr; + cx.setTransform(dpr, 0, 0, dpr, 0, 0); + stars = Array.from({ length: Math.round((W * H) / 4200) }, () => ({ + x: Math.random() * W, y: Math.random() * H, + r: Math.random() < 0.08 ? 1.5 + Math.random() : 0.3 + Math.random() * 0.9, + p: Math.random() * 6.28, s: 0.4 + Math.random() * 1.6, z: 0.05 + Math.random() * 0.25, g: Math.random() < 0.22, + })); + }; + const frame = (t: number) => { + cx.clearRect(0, 0, W, H); + for (const st of stars) { + const a = 0.35 + 0.65 * Math.abs(Math.sin(st.p + t * 0.0006 * st.s)); + const y = (((st.y - scrollY * st.z) % H) + H) % H; + cx.globalAlpha = a * (st.r > 1.4 ? 1 : 0.8); + cx.fillStyle = st.g ? "#f6e2ad" : "#ffffff"; + cx.beginPath(); cx.arc(st.x, y, st.r, 0, 6.283); cx.fill(); + if (st.r > 1.4) { + cx.globalAlpha = a * 0.5; + cx.fillRect(st.x - st.r * 3.5, y - 0.3, st.r * 7, 0.6); + cx.fillRect(st.x - 0.3, y - st.r * 3.5, 0.6, st.r * 7); + } + } + if (shoot) { + shoot.l += 0.02; + const k = shoot.l, hx = shoot.x + shoot.dx * k, hy = shoot.y + shoot.dy * k; + const gr = cx.createLinearGradient(hx, hy, hx - shoot.dx * 0.22, hy - shoot.dy * 0.22); + gr.addColorStop(0, `rgba(246,226,173,${1 - k})`); gr.addColorStop(1, "rgba(246,226,173,0)"); + cx.globalAlpha = 1; cx.strokeStyle = gr; cx.lineWidth = 1.4; + cx.beginPath(); cx.moveTo(hx, hy); cx.lineTo(hx - shoot.dx * 0.22, hy - shoot.dy * 0.22); cx.stroke(); + if (k >= 1) shoot = null; + } else if (!calm && Math.random() < 0.003) { + shoot = { x: Math.random() * W * 0.8, y: Math.random() * H * 0.4, dx: 380 + Math.random() * 300, dy: 150 + Math.random() * 160, l: 0 }; + } + cx.globalAlpha = 1; + if (!calm && !document.hidden) raf = requestAnimationFrame(frame); + }; + size(); + raf = requestAnimationFrame(frame); + on(window, "resize", () => { size(); if (calm) frame(0); }); + on(window, "scroll", () => { scrollY = window.scrollY; if (calm) frame(0); }, { passive: true }); + on(document, "visibilitychange", () => { if (!document.hidden && !calm) { cancelAnimationFrame(raf); raf = requestAnimationFrame(frame); } }); + off.push(() => cancelAnimationFrame(raf)); + + // Kerzenschein und Kartenfächer folgen dem Zeiger + const hero = root.querySelector(".kl-hero"); + const fan = hero?.querySelector(".kl-fan"); + if (hero) on(hero, "pointermove", (e: PointerEvent) => { + const r = hero.getBoundingClientRect(); + hero.style.setProperty("--cx", `${e.clientX - r.left}px`); + hero.style.setProperty("--cy", `${e.clientY - r.top}px`); + if (!calm && fan) { + fan.style.setProperty("--px", ((e.clientX - r.left) / r.width - 0.5).toFixed(3)); + fan.style.setProperty("--py", ((e.clientY - r.top) / r.height - 0.5).toFixed(3)); + } + }); + + // Große Karten kippen mit dem Zeiger + if (!calm) root.querySelectorAll("[data-kl-tilt]").forEach((fig) => { + const c = fig.querySelector(".kl-tc"); + if (!c) return; + on(fig, "pointermove", (e: PointerEvent) => { + const r = c.getBoundingClientRect(), x = (e.clientX - r.left) / r.width - 0.5, y = (e.clientY - r.top) / r.height - 0.5; + c.style.setProperty("--ry", `${(x * 22).toFixed(1)}deg`); + c.style.setProperty("--rx", `${(-y * 16).toFixed(1)}deg`); + c.style.setProperty("--gl", `${(100 - (x + 0.5) * 100).toFixed(0)}%`); + }); + on(fig, "pointerleave", () => { c.style.removeProperty("--ry"); c.style.removeProperty("--rx"); c.style.removeProperty("--gl"); }); + }); + + // Einblenden beim Scrollen + const rv = root.querySelectorAll(".kl-rv"); + if ("IntersectionObserver" in window && !calm) { + root.classList.add("is-js"); + const io = new IntersectionObserver((es) => es.forEach((e) => { + if (e.isIntersecting) { e.target.classList.add("in"); io.unobserve(e.target); } + }), { rootMargin: "0px 0px -8% 0px" }); + rv.forEach((el) => io.observe(el)); + off.push(() => { io.disconnect(); root.classList.remove("is-js"); }); + } + + return () => off.forEach((fn) => fn()); + }, []); + + return ( + <> +