import React from "react"; import { useLocation } from "react-router-dom"; import Container from "@mui/material/Container"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import Paper from "@mui/material/Paper"; import Grid from "@mui/material/Grid"; import ChevronLeft from "@mui/icons-material/ChevronLeft"; import ChevronRight from "@mui/icons-material/ChevronRight"; import { Link } from "react-router-dom"; import SharedCarousel from "./SharedCarousel.js"; import { getCombinedAnimatedBorderStyles } from "../utils/animatedBorderStyles.js"; import { STAR_POLYGON_POINTS } from "../utils/starPolygon.js"; import { useTranslation } from 'react-i18next'; const HOME_STAR_LAYERS = [ { className: "star-rotate-slow-cw", size: 168 }, { className: "star-rotate-slow-ccw", size: 159 }, { className: "star-rotate-medium-cw", size: 150 }, ]; /** Teal/cyan stack for the right (Konfigurator) star — same motion, blue color scheme */ const TEAL_STAR_LAYERS = [ { className: "star-rotate-slow-ccw", size: 168 }, { className: "star-rotate-medium-cw", size: 159 }, { className: "star-rotate-slow-cw", size: 150 }, ]; /** Initial fill per variant (matches keyframe 0%) — avoids black flash before CSS animates */ const STAR_INITIAL_FILLS = { home: ["#B8860B", "#DAA520", "#FFD700"], filiale: ["#5F9EA0", "#7FCDCD", "#AFEEEE"], }; /** Injected in render (not useEffect) so first paint already has keyframes — avoids angle/color snap on load */ const STAR_DECORATION_CSS = ` @keyframes rotateClockwise { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @keyframes rotateCounterClockwise { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } } .star-rotate-slow-cw, .star-rotate-slow-ccw, .star-rotate-medium-cw { transform-box: fill-box; transform-origin: center; } .star-rotate-slow-cw { animation: rotateClockwise 60s linear infinite; } .star-rotate-slow-ccw { animation: rotateCounterClockwise 45s linear infinite; } .star-rotate-medium-cw { animation: rotateClockwise 30s linear infinite; } .star-layer-svg-home { mix-blend-mode: screen; opacity: 0.92; filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 10px rgba(255, 215, 0, 0.6)) drop-shadow(0 0 20px rgba(255, 215, 0, 0.3)); } .star-layer-svg-filiale { mix-blend-mode: soft-light; opacity: 0.94; filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 10px rgba(127, 205, 205, 0.6)) drop-shadow(0 0 18px rgba(95, 158, 160, 0.35)); } .star-layer-svg { shape-rendering: geometricPrecision; transform: translateZ(0); } @keyframes starFillHome0 { 0%, 100% { fill: #B8860B; } 33% { fill: #FFD700; } 66% { fill: #DAA520; } } @keyframes starFillHome1 { 0%, 100% { fill: #DAA520; } 33% { fill: #B8860B; } 66% { fill: #FFD700; } } @keyframes starFillHome2 { 0%, 100% { fill: #FFD700; } 33% { fill: #DAA520; } 66% { fill: #B8860B; } } @keyframes starDriftHome0 { 0%, 100% { transform: rotate(20deg) translate(0px, 0px); } 50% { transform: rotate(20deg) translate(5px, -5px); } } @keyframes starDriftHome1 { 0%, 100% { transform: rotate(-25deg) translate(0px, 0px); } 50% { transform: rotate(-25deg) translate(-4px, 6px); } } @keyframes starDriftHome2 { 0%, 100% { transform: translate(0px, 0px); } 50% { transform: translate(3px, 4px); } } .star-layer-wrap.star-layer-home-0 { animation: starDriftHome0 6.5s ease-in-out infinite; animation-fill-mode: both; } .star-layer-wrap.star-layer-home-1 { animation: starDriftHome1 7s ease-in-out 0.4s infinite; animation-fill-mode: both; } .star-layer-wrap.star-layer-home-2 { animation: starDriftHome2 5.5s ease-in-out 0.8s infinite; animation-fill-mode: both; } .star-poly-home-0 { animation: starFillHome0 10s ease-in-out 0s infinite both; } .star-poly-home-1 { animation: starFillHome1 10s ease-in-out 1.1s infinite both; } .star-poly-home-2 { animation: starFillHome2 10s ease-in-out 2.2s infinite both; } @keyframes starFillFil0 { 0%, 100% { fill: #5F9EA0; } 33% { fill: #AFEEEE; } 66% { fill: #7FCDCD; } } @keyframes starFillFil1 { 0%, 100% { fill: #7FCDCD; } 33% { fill: #5F9EA0; } 66% { fill: #AFEEEE; } } @keyframes starFillFil2 { 0%, 100% { fill: #AFEEEE; } 33% { fill: #7FCDCD; } 66% { fill: #5F9EA0; } } @keyframes starDriftFil0 { 0%, 100% { transform: rotate(20deg) translate(0px, 0px); } 50% { transform: rotate(20deg) translate(4px, -4px); } } @keyframes starDriftFil1 { 0%, 100% { transform: rotate(-25deg) translate(0px, 0px); } 50% { transform: rotate(-25deg) translate(-5px, 5px); } } @keyframes starDriftFil2 { 0%, 100% { transform: translate(0px, 0px); } 50% { transform: translate(3px, 3px); } } .star-layer-wrap.star-layer-filiale-0 { animation: starDriftFil0 6.5s ease-in-out infinite; animation-fill-mode: both; } .star-layer-wrap.star-layer-filiale-1 { animation: starDriftFil1 7s ease-in-out 0.4s infinite; animation-fill-mode: both; } .star-layer-wrap.star-layer-filiale-2 { animation: starDriftFil2 5.5s ease-in-out 0.8s infinite; animation-fill-mode: both; } .star-poly-filiale-0 { animation: starFillFil0 10s ease-in-out 0s infinite both; } .star-poly-filiale-1 { animation: starFillFil1 10s ease-in-out 1.1s infinite both; } .star-poly-filiale-2 { animation: starFillFil2 10s ease-in-out 2.2s infinite both; } `; const StarDecorationLayers = ({ layers, variant }) => ( <> {layers.map(({ className, size }, i) => { const half = size / 2; const initialFill = STAR_INITIAL_FILLS[variant][i]; return (