Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fb2d385e88 | |||
| c54085fe3f | |||
| 232c55c566 | |||
| 52d81ea6cc | |||
| bc0e7c2283 | |||
| 6d2152998b | |||
| f727e2abfb | |||
| f04163f56d | |||
| e9e209d6e7 | |||
| 9af6a53325 |
@@ -122,7 +122,9 @@ export async function generateMetadata(props: any): Promise<Metadata> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async function Home(props: any) {
|
import { preload } from 'react-dom';
|
||||||
|
|
||||||
|
export default async function Home(props: { params: Promise<{ locale: string }> }) {
|
||||||
const { locale } = await props.params;
|
const { locale } = await props.params;
|
||||||
|
|
||||||
if (locale !== 'de' && locale !== 'en') {
|
if (locale !== 'de' && locale !== 'en') {
|
||||||
@@ -130,6 +132,7 @@ export default async function Home(props: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setRequestLocale(locale);
|
setRequestLocale(locale);
|
||||||
|
preload('/germany-map.svg', { as: 'image', fetchPriority: 'high' });
|
||||||
|
|
||||||
const mdx = await getMdxContent(locale, 'home');
|
const mdx = await getMdxContent(locale, 'home');
|
||||||
const allReferences = await getAllReferences(locale);
|
const allReferences = await getAllReferences(locale);
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ import { getButtonClasses, ButtonOverlay } from '@/components/ui/Button';
|
|||||||
import { SITE_URL } from '@/lib/schema';
|
import { SITE_URL } from '@/lib/schema';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import { standorteData, standorteLocations } from '@/lib/standorte-data';
|
import { standorteData, standorteLocations } from '@/lib/standorte-data';
|
||||||
import { InteractiveGermanyMap } from '@/components/blocks/InteractiveGermanyMap';
|
import nextDynamic from 'next/dynamic';
|
||||||
|
const InteractiveGermanyMap = nextDynamic(() => import('@/components/blocks/InteractiveGermanyMap').then(mod => mod.InteractiveGermanyMap));
|
||||||
|
|
||||||
interface PageProps {
|
interface PageProps {
|
||||||
params: Promise<{
|
params: Promise<{
|
||||||
@@ -33,11 +34,15 @@ export async function generateMetadata({ params }: { params: Promise<{ locale: s
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import { preload } from 'react-dom';
|
||||||
|
|
||||||
export default async function StandorteOverview(props: { params: Promise<{ locale: string }> }) {
|
export default async function StandorteOverview(props: { params: Promise<{ locale: string }> }) {
|
||||||
const { locale } = await props.params;
|
const { locale } = await props.params;
|
||||||
const safeLocale = locale === 'de' ? 'de' : 'en';
|
const safeLocale = locale === 'de' ? 'de' : 'en';
|
||||||
setRequestLocale(safeLocale);
|
setRequestLocale(safeLocale);
|
||||||
const t = await getTranslations('StandardPage');
|
const t = await getTranslations('StandardPage');
|
||||||
|
|
||||||
|
preload('/germany-map.svg', { as: 'image', fetchPriority: 'high' });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col min-h-screen bg-neutral-50 pb-16 md:pb-24">
|
<div className="flex flex-col min-h-screen bg-neutral-50 pb-16 md:pb-24">
|
||||||
@@ -70,6 +75,7 @@ export default async function StandorteOverview(props: { params: Promise<{ local
|
|||||||
alt={standort.name}
|
alt={standort.name}
|
||||||
fill
|
fill
|
||||||
className="object-cover transition-transform duration-1000 ease-[cubic-bezier(0.16,1,0.3,1)] filter grayscale-[20%] group-hover:scale-105 group-hover:grayscale-0"
|
className="object-cover transition-transform duration-1000 ease-[cubic-bezier(0.16,1,0.3,1)] filter grayscale-[20%] group-hover:scale-105 group-hover:grayscale-0"
|
||||||
|
sizes="(max-width: 768px) 200px, 384px"
|
||||||
/>
|
/>
|
||||||
<div className="absolute inset-0 bg-black/10 transition-colors duration-500" />
|
<div className="absolute inset-0 bg-black/10 transition-colors duration-500" />
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,20 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import React, { useState, useRef, useCallback, useMemo } from 'react';
|
import React, { useState, useRef, useCallback, useMemo } from 'react';
|
||||||
import { m, AnimatePresence } from 'framer-motion';
|
import { MapPin, ArrowUpRight } from 'lucide-react';
|
||||||
import { MapPin, CheckCircle2, ArrowUpRight } from 'lucide-react';
|
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import { usePathname } from 'next/navigation';
|
import { usePathname } from 'next/navigation';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
import { AnimatedGlossyBorder } from '@/components/ui/AnimatedGlossyBorder';
|
import { AnimatedGlossyBorder } from '@/components/ui/AnimatedGlossyBorder';
|
||||||
import { Location, projectLocations } from '@/lib/map-data';
|
import { Location, projectLocations } from '@/lib/map-data';
|
||||||
import { standorteLocations } from '@/lib/standorte-data';
|
import { standorteLocations } from '@/lib/standorte-data';
|
||||||
import { useLocale, useTranslations } from 'next-intl';
|
import { useLocale, useTranslations } from 'next-intl';
|
||||||
|
|
||||||
|
const InteractiveMapPins = dynamic(() => import('./InteractiveMapPins'), {
|
||||||
|
ssr: false,
|
||||||
|
});
|
||||||
|
|
||||||
interface Stat {
|
interface Stat {
|
||||||
value: string;
|
value: string;
|
||||||
suffix?: string;
|
suffix?: string;
|
||||||
@@ -28,58 +32,7 @@ interface InteractiveGermanyMapProps {
|
|||||||
hideStandorte?: boolean;
|
hideStandorte?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MinorNode = React.memo(({ loc, isActive, onEnter, onLeave }: { loc: Location, isActive: boolean, onEnter: (loc: Location) => void, onLeave: () => void }) => (
|
|
||||||
<div
|
|
||||||
className={`absolute group/minor cursor-pointer w-8 h-8 md:w-5 md:h-5 flex items-center justify-center ${isActive ? 'z-[60]' : 'z-10 hover:z-30'}`}
|
|
||||||
style={{
|
|
||||||
left: `${loc.x}%`,
|
|
||||||
top: `${loc.y}%`,
|
|
||||||
transform: 'translate(-50%, -50%)',
|
|
||||||
}}
|
|
||||||
onMouseEnter={() => onEnter(loc)}
|
|
||||||
onMouseLeave={onLeave}
|
|
||||||
onTouchStart={() => onEnter(loc)}
|
|
||||||
onClick={() => onEnter(loc)}
|
|
||||||
>
|
|
||||||
<div className={`w-1.5 h-1.5 rounded-full transition-all duration-300 ${isActive ? 'bg-white scale-150 shadow-[0_0_10px_rgba(130,237,32,1)]' : 'bg-primary/80 group-hover/minor:bg-white group-hover/minor:scale-150'}`} />
|
|
||||||
<div className="absolute inset-0 m-auto w-2 h-2 bg-primary rounded-full opacity-0 group-hover/minor:animate-ping" />
|
|
||||||
</div>
|
|
||||||
));
|
|
||||||
MinorNode.displayName = 'MinorNode';
|
|
||||||
|
|
||||||
const MajorNode = React.memo(({ loc, isActive, idx, onEnter, onLeave }: { loc: Location, isActive: boolean, idx: number, onEnter: (loc: Location) => void, onLeave: () => void }) => {
|
|
||||||
const isHQ = loc.type === 'hq';
|
|
||||||
const isBranch = loc.type === 'branch';
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={`absolute transform -translate-x-1/2 -translate-y-1/2 group/pin cursor-pointer w-16 h-16 flex items-center justify-center ${isActive ? 'z-[60]' : 'z-20 hover:z-40'}`}
|
|
||||||
style={{ left: `${loc.x}%`, top: `${loc.y}%` }}
|
|
||||||
onMouseEnter={() => onEnter(loc)}
|
|
||||||
onMouseLeave={onLeave}
|
|
||||||
onTouchStart={() => onEnter(loc)}
|
|
||||||
onClick={() => onEnter(loc)}
|
|
||||||
>
|
|
||||||
{(isHQ || isBranch) && (
|
|
||||||
<div className="absolute inset-0 m-auto w-6 h-6 rounded-full animate-ping bg-primary/50 scale-150" />
|
|
||||||
)}
|
|
||||||
<m.div
|
|
||||||
initial={{ scale: 0 }}
|
|
||||||
animate={{ scale: 1 }}
|
|
||||||
transition={{ type: 'spring', delay: idx * 0.1 }}
|
|
||||||
className={`relative flex items-center justify-center rounded-full shadow-[0_0_20px_rgba(130,237,32,0.6)] transition-transform duration-300 ${
|
|
||||||
isActive ? 'scale-125 z-30 ring-4 ring-primary/40' : 'scale-100 group-hover/pin:scale-110'
|
|
||||||
} ${
|
|
||||||
isHQ || isBranch
|
|
||||||
? 'w-7 h-7 bg-primary text-[#050B14]'
|
|
||||||
: 'w-4 h-4 bg-white ring-[3px] ring-primary'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{(isHQ || isBranch) && <MapPin className="w-4 h-4" />}
|
|
||||||
</m.div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
MajorNode.displayName = 'MajorNode';
|
|
||||||
|
|
||||||
export function InteractiveGermanyMap({
|
export function InteractiveGermanyMap({
|
||||||
badge,
|
badge,
|
||||||
@@ -141,6 +94,7 @@ export function InteractiveGermanyMap({
|
|||||||
fill
|
fill
|
||||||
className="object-cover"
|
className="object-cover"
|
||||||
priority
|
priority
|
||||||
|
fetchPriority="high"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
), [locale]);
|
), [locale]);
|
||||||
@@ -210,116 +164,14 @@ export function InteractiveGermanyMap({
|
|||||||
|
|
||||||
{mapBackground}
|
{mapBackground}
|
||||||
|
|
||||||
{finalLocations.filter(l => l.type === 'minor_node').map((loc, idx) => (
|
<InteractiveMapPins
|
||||||
<MinorNode
|
locations={finalLocations}
|
||||||
key={`minor-${loc.id || idx}`}
|
locale={locale}
|
||||||
loc={loc}
|
t={t}
|
||||||
isActive={activeLocation === loc}
|
activeLocation={activeLocation}
|
||||||
onEnter={handleMouseEnter}
|
handleMouseEnter={handleMouseEnter}
|
||||||
onLeave={handleMouseLeave}
|
handleMouseLeave={handleMouseLeave}
|
||||||
/>
|
/>
|
||||||
))}
|
|
||||||
|
|
||||||
{finalLocations.filter(l => l.type !== 'minor_node').map((loc, idx) => (
|
|
||||||
<MajorNode
|
|
||||||
key={loc.id}
|
|
||||||
loc={loc}
|
|
||||||
idx={idx}
|
|
||||||
isActive={activeLocation?.id === loc.id}
|
|
||||||
onEnter={handleMouseEnter}
|
|
||||||
onLeave={handleMouseLeave}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
|
|
||||||
<AnimatePresence>
|
|
||||||
{activeLocation && (
|
|
||||||
<m.div
|
|
||||||
key="tooltip"
|
|
||||||
initial={{ opacity: 0, y: 10, scale: 0.95 }}
|
|
||||||
animate={{ opacity: 1, y: 0, scale: 1 }}
|
|
||||||
exit={{ opacity: 0, y: 10, scale: 0.95 }}
|
|
||||||
transition={{ duration: 0.2 }}
|
|
||||||
className="absolute z-[9999] pointer-events-auto bottom-[-60px] left-1/2 -translate-x-1/2 w-[calc(100vw_-_2rem)] max-w-[320px] md:w-max md:bottom-auto md:left-[var(--md-left)] md:top-[var(--md-top)] md:[transform:var(--md-transform)]"
|
|
||||||
style={{
|
|
||||||
'--md-left': `${activeLocation.x}%`,
|
|
||||||
'--md-top': `${activeLocation.y}%`,
|
|
||||||
'--md-transform': activeLocation.x < 50 ? 'translate(20px, -50%)' : 'translate(calc(-100% - 20px), -50%)',
|
|
||||||
} as React.CSSProperties}
|
|
||||||
onMouseEnter={() => handleMouseEnter(activeLocation)}
|
|
||||||
onMouseLeave={handleMouseLeave}
|
|
||||||
>
|
|
||||||
<div className="bg-[#050B14]/95 backdrop-blur-xl border border-white/10 rounded-2xl shadow-2xl w-full text-white overflow-hidden">
|
|
||||||
{activeLocation.featuredImage && (
|
|
||||||
<div className="relative w-full h-32 bg-neutral-900">
|
|
||||||
<Image
|
|
||||||
src={activeLocation.featuredImage}
|
|
||||||
alt={activeLocation.name}
|
|
||||||
fill
|
|
||||||
className="object-cover"
|
|
||||||
/>
|
|
||||||
<div className="absolute inset-0 bg-gradient-to-t from-[#050B14] to-transparent opacity-90" />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="p-4">
|
|
||||||
<div className="flex items-center gap-2 mb-1">
|
|
||||||
<MapPin className="w-3.5 h-3.5 text-primary" />
|
|
||||||
<span className="text-xs font-bold text-primary uppercase tracking-wider">
|
|
||||||
{t(`types.${activeLocation.type === 'minor_node' ? 'project' : activeLocation.type}`)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className="font-heading font-bold text-lg leading-tight mb-2">
|
|
||||||
{activeLocation.name}
|
|
||||||
</div>
|
|
||||||
{activeLocation.type !== 'minor_node' ? (
|
|
||||||
<div className="text-white/60 text-sm line-clamp-3 mb-3">
|
|
||||||
{activeLocation.description}
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div className="text-white/60 text-xs mb-3">
|
|
||||||
{t(`descriptions.${['wind','pv','fiber','power','battery'].includes(activeLocation.description || '') ? activeLocation.description : 'default'}`)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{(activeLocation.details || activeLocation.type === 'minor_node') && (
|
|
||||||
<ul className="mb-3 space-y-1.5 border-t border-white/10 pt-3">
|
|
||||||
{activeLocation.type === 'minor_node' ? (
|
|
||||||
<>
|
|
||||||
<li className="text-[11px] text-white/80 flex items-start gap-2 font-medium">
|
|
||||||
<CheckCircle2 className="w-3 h-3 text-primary shrink-0 mt-0.5" />
|
|
||||||
<span>{t(`features.${['wind','pv','fiber','power','battery'].includes(activeLocation.description || '') ? activeLocation.description : 'default'}`)}</span>
|
|
||||||
</li>
|
|
||||||
<li className="text-[11px] text-white/80 flex items-start gap-2 font-medium">
|
|
||||||
<CheckCircle2 className="w-3 h-3 text-primary shrink-0 mt-0.5" />
|
|
||||||
<span>{t('features.method')}</span>
|
|
||||||
</li>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
activeLocation.details?.map((detail, i) => (
|
|
||||||
<li key={i} className="text-[11px] text-white/80 flex items-start gap-2 font-medium">
|
|
||||||
<CheckCircle2 className="w-3 h-3 text-primary shrink-0 mt-0.5" />
|
|
||||||
<span>{detail}</span>
|
|
||||||
</li>
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</ul>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{activeLocation.href && (activeLocation.type === 'hq' || activeLocation.type === 'branch') && (
|
|
||||||
<Link
|
|
||||||
href={activeLocation.href.startsWith('/') ? `/${locale}${activeLocation.href}` : activeLocation.href}
|
|
||||||
className="inline-flex items-center text-xs font-bold text-primary hover:text-white transition-colors mt-2"
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
>
|
|
||||||
{t('learnMore')}
|
|
||||||
<ArrowUpRight className="w-3.5 h-3.5 ml-1" />
|
|
||||||
</Link>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</m.div>
|
|
||||||
)}
|
|
||||||
</AnimatePresence>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
193
components/blocks/InteractiveMapPins.tsx
Normal file
193
components/blocks/InteractiveMapPins.tsx
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { m, AnimatePresence } from 'framer-motion';
|
||||||
|
import { MapPin, CheckCircle2, ArrowUpRight } from 'lucide-react';
|
||||||
|
import Image from 'next/image';
|
||||||
|
import Link from 'next/link';
|
||||||
|
import { Location } from '@/lib/map-data';
|
||||||
|
|
||||||
|
const MinorNode = React.memo(({ loc, isActive, onEnter, onLeave }: { loc: Location, isActive: boolean, onEnter: (loc: Location) => void, onLeave: () => void }) => (
|
||||||
|
<div
|
||||||
|
className={`absolute group/minor cursor-pointer w-8 h-8 md:w-5 md:h-5 flex items-center justify-center ${isActive ? 'z-[60]' : 'z-10 hover:z-30'}`}
|
||||||
|
style={{
|
||||||
|
left: `${loc.x}%`,
|
||||||
|
top: `${loc.y}%`,
|
||||||
|
transform: 'translate(-50%, -50%)',
|
||||||
|
}}
|
||||||
|
onMouseEnter={() => onEnter(loc)}
|
||||||
|
onMouseLeave={onLeave}
|
||||||
|
onTouchStart={() => onEnter(loc)}
|
||||||
|
onClick={() => onEnter(loc)}
|
||||||
|
>
|
||||||
|
<div className={`w-1.5 h-1.5 rounded-full transition-all duration-300 ${isActive ? 'bg-white scale-150 shadow-[0_0_10px_rgba(130,237,32,1)]' : 'bg-primary/80 group-hover/minor:bg-white group-hover/minor:scale-150'}`} />
|
||||||
|
<div className="absolute inset-0 m-auto w-2 h-2 bg-primary rounded-full opacity-0 group-hover/minor:animate-ping" />
|
||||||
|
</div>
|
||||||
|
));
|
||||||
|
MinorNode.displayName = 'MinorNode';
|
||||||
|
|
||||||
|
const MajorNode = React.memo(({ loc, isActive, idx, onEnter, onLeave }: { loc: Location, isActive: boolean, idx: number, onEnter: (loc: Location) => void, onLeave: () => void }) => {
|
||||||
|
const isHQ = loc.type === 'hq';
|
||||||
|
const isBranch = loc.type === 'branch';
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={`absolute transform -translate-x-1/2 -translate-y-1/2 group/pin cursor-pointer w-16 h-16 flex items-center justify-center ${isActive ? 'z-[60]' : 'z-20 hover:z-40'}`}
|
||||||
|
style={{ left: `${loc.x}%`, top: `${loc.y}%` }}
|
||||||
|
onMouseEnter={() => onEnter(loc)}
|
||||||
|
onMouseLeave={onLeave}
|
||||||
|
onTouchStart={() => onEnter(loc)}
|
||||||
|
onClick={() => onEnter(loc)}
|
||||||
|
>
|
||||||
|
{(isHQ || isBranch) && (
|
||||||
|
<div className="absolute inset-0 m-auto w-6 h-6 rounded-full animate-ping bg-primary/50 scale-150" />
|
||||||
|
)}
|
||||||
|
<m.div
|
||||||
|
initial={{ scale: 0 }}
|
||||||
|
animate={{ scale: 1 }}
|
||||||
|
transition={{ type: 'spring', delay: idx * 0.1 }}
|
||||||
|
className={`relative flex items-center justify-center rounded-full shadow-[0_0_20px_rgba(130,237,32,0.6)] transition-transform duration-300 ${
|
||||||
|
isActive ? 'scale-125 z-30 ring-4 ring-primary/40' : 'scale-100 group-hover/pin:scale-110'
|
||||||
|
} ${
|
||||||
|
isHQ || isBranch
|
||||||
|
? 'w-7 h-7 bg-primary text-[#050B14]'
|
||||||
|
: 'w-4 h-4 bg-white ring-[3px] ring-primary'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{(isHQ || isBranch) && <MapPin className="w-4 h-4" />}
|
||||||
|
</m.div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
MajorNode.displayName = 'MajorNode';
|
||||||
|
|
||||||
|
export default function InteractiveMapPins({
|
||||||
|
locations,
|
||||||
|
locale,
|
||||||
|
t,
|
||||||
|
activeLocation,
|
||||||
|
handleMouseEnter,
|
||||||
|
handleMouseLeave
|
||||||
|
}: {
|
||||||
|
locations: Location[],
|
||||||
|
locale: string,
|
||||||
|
t: any,
|
||||||
|
activeLocation: Location | null,
|
||||||
|
handleMouseEnter: (loc: Location) => void,
|
||||||
|
handleMouseLeave: () => void
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{locations.filter(l => l.type === 'minor_node').map((loc, idx) => (
|
||||||
|
<MinorNode
|
||||||
|
key={`minor-${loc.id || idx}`}
|
||||||
|
loc={loc}
|
||||||
|
isActive={activeLocation === loc}
|
||||||
|
onEnter={handleMouseEnter}
|
||||||
|
onLeave={handleMouseLeave}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{locations.filter(l => l.type !== 'minor_node').map((loc, idx) => (
|
||||||
|
<MajorNode
|
||||||
|
key={loc.id}
|
||||||
|
loc={loc}
|
||||||
|
idx={idx}
|
||||||
|
isActive={activeLocation?.id === loc.id}
|
||||||
|
onEnter={handleMouseEnter}
|
||||||
|
onLeave={handleMouseLeave}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
|
||||||
|
<AnimatePresence>
|
||||||
|
{activeLocation && (
|
||||||
|
<m.div
|
||||||
|
key="tooltip"
|
||||||
|
initial={{ opacity: 0, y: 10, scale: 0.95 }}
|
||||||
|
animate={{ opacity: 1, y: 0, scale: 1 }}
|
||||||
|
exit={{ opacity: 0, y: 10, scale: 0.95 }}
|
||||||
|
transition={{ duration: 0.2 }}
|
||||||
|
className="absolute z-[9999] pointer-events-auto bottom-[-60px] left-1/2 -translate-x-1/2 w-[calc(100vw_-_2rem)] max-w-[320px] md:w-max md:bottom-auto md:left-[var(--md-left)] md:top-[var(--md-top)] md:[transform:var(--md-transform)]"
|
||||||
|
style={{
|
||||||
|
'--md-left': `${activeLocation.x}%`,
|
||||||
|
'--md-top': `${activeLocation.y}%`,
|
||||||
|
'--md-transform': activeLocation.x < 50 ? 'translate(20px, -50%)' : 'translate(calc(-100% - 20px), -50%)',
|
||||||
|
} as React.CSSProperties}
|
||||||
|
onMouseEnter={() => handleMouseEnter(activeLocation)}
|
||||||
|
onMouseLeave={handleMouseLeave}
|
||||||
|
>
|
||||||
|
<div className="bg-[#050B14]/95 backdrop-blur-xl border border-white/10 rounded-2xl shadow-2xl w-full text-white overflow-hidden">
|
||||||
|
{activeLocation.featuredImage && (
|
||||||
|
<div className="relative w-full h-32 bg-neutral-900">
|
||||||
|
<Image
|
||||||
|
src={activeLocation.featuredImage}
|
||||||
|
alt={activeLocation.name}
|
||||||
|
fill
|
||||||
|
className="object-cover"
|
||||||
|
sizes="(max-width: 768px) 100vw, 320px"
|
||||||
|
/>
|
||||||
|
<div className="absolute inset-0 bg-gradient-to-t from-[#050B14] to-transparent opacity-90" />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="p-4">
|
||||||
|
<div className="flex items-center gap-2 mb-1">
|
||||||
|
<MapPin className="w-3.5 h-3.5 text-primary" />
|
||||||
|
<span className="text-xs font-bold text-primary uppercase tracking-wider">
|
||||||
|
{t(`types.${activeLocation.type === 'minor_node' ? 'project' : activeLocation.type}`)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="font-heading font-bold text-lg leading-tight mb-2">
|
||||||
|
{activeLocation.name}
|
||||||
|
</div>
|
||||||
|
{activeLocation.type !== 'minor_node' ? (
|
||||||
|
<div className="text-white/60 text-sm line-clamp-3 mb-3">
|
||||||
|
{activeLocation.description}
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="text-white/60 text-xs mb-3">
|
||||||
|
{t(`descriptions.${['wind','pv','fiber','power','battery'].includes(activeLocation.description || '') ? activeLocation.description : 'default'}`)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{(activeLocation.details || activeLocation.type === 'minor_node') && (
|
||||||
|
<ul className="mb-3 space-y-1.5 border-t border-white/10 pt-3">
|
||||||
|
{activeLocation.type === 'minor_node' ? (
|
||||||
|
<>
|
||||||
|
<li className="text-[11px] text-white/80 flex items-start gap-2 font-medium">
|
||||||
|
<CheckCircle2 className="w-3 h-3 text-primary shrink-0 mt-0.5" />
|
||||||
|
<span>{t(`features.${['wind','pv','fiber','power','battery'].includes(activeLocation.description || '') ? activeLocation.description : 'default'}`)}</span>
|
||||||
|
</li>
|
||||||
|
<li className="text-[11px] text-white/80 flex items-start gap-2 font-medium">
|
||||||
|
<CheckCircle2 className="w-3 h-3 text-primary shrink-0 mt-0.5" />
|
||||||
|
<span>{t('features.method')}</span>
|
||||||
|
</li>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
activeLocation.details?.map((detail, i) => (
|
||||||
|
<li key={i} className="text-[11px] text-white/80 flex items-start gap-2 font-medium">
|
||||||
|
<CheckCircle2 className="w-3 h-3 text-primary shrink-0 mt-0.5" />
|
||||||
|
<span>{detail}</span>
|
||||||
|
</li>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</ul>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{activeLocation.href && (activeLocation.type === 'hq' || activeLocation.type === 'branch') && (
|
||||||
|
<Link
|
||||||
|
href={activeLocation.href.startsWith('/') ? `/${locale}${activeLocation.href}` : activeLocation.href}
|
||||||
|
className="inline-flex items-center text-xs font-bold text-primary hover:text-white transition-colors mt-2"
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
|
{t('learnMore')}
|
||||||
|
<ArrowUpRight className="w-3.5 h-3.5 ml-1" />
|
||||||
|
</Link>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</m.div>
|
||||||
|
)}
|
||||||
|
</AnimatePresence>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -128,7 +128,7 @@ export function SubCompanyTiles(props: SubCompanyTilesProps) {
|
|||||||
? 'opacity-30 grayscale-0 scale-105'
|
? 'opacity-30 grayscale-0 scale-105'
|
||||||
: 'opacity-40 grayscale-[50%] group-hover:opacity-30 group-hover:grayscale-0 group-hover:scale-110'
|
: 'opacity-40 grayscale-[50%] group-hover:opacity-30 group-hover:grayscale-0 group-hover:scale-110'
|
||||||
}`}
|
}`}
|
||||||
sizes="(max-width: 768px) 100vw, 33vw"
|
sizes="(max-width: 768px) 200px, 384px"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
11921
lh-desktop.json
Normal file
11921
lh-desktop.json
Normal file
File diff suppressed because one or more lines are too long
11867
lh-report.json
Normal file
11867
lh-report.json
Normal file
File diff suppressed because one or more lines are too long
11818
lh-standorte.json
Normal file
11818
lh-standorte.json
Normal file
File diff suppressed because one or more lines are too long
@@ -139,7 +139,7 @@
|
|||||||
"prepare": "husky",
|
"prepare": "husky",
|
||||||
"preinstall": "npx only-allow pnpm"
|
"preinstall": "npx only-allow pnpm"
|
||||||
},
|
},
|
||||||
"version": "2.2.80",
|
"version": "2.2.85",
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
"@parcel/watcher",
|
"@parcel/watcher",
|
||||||
|
|||||||
39
psi-standorte.json
Normal file
39
psi-standorte.json
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"error": {
|
||||||
|
"code": 429,
|
||||||
|
"message": "Quota exceeded for quota metric 'Queries' and limit 'Queries per day' of service 'pagespeedonline.googleapis.com' for consumer 'project_number:583797351490'.",
|
||||||
|
"errors": [
|
||||||
|
{
|
||||||
|
"message": "Quota exceeded for quota metric 'Queries' and limit 'Queries per day' of service 'pagespeedonline.googleapis.com' for consumer 'project_number:583797351490'.",
|
||||||
|
"domain": "global",
|
||||||
|
"reason": "rateLimitExceeded"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"status": "RESOURCE_EXHAUSTED",
|
||||||
|
"details": [
|
||||||
|
{
|
||||||
|
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
|
||||||
|
"reason": "RATE_LIMIT_EXCEEDED",
|
||||||
|
"domain": "googleapis.com",
|
||||||
|
"metadata": {
|
||||||
|
"service": "pagespeedonline.googleapis.com",
|
||||||
|
"quota_location": "global",
|
||||||
|
"quota_limit_value": "0",
|
||||||
|
"consumer": "projects/583797351490",
|
||||||
|
"quota_metric": "pagespeedonline.googleapis.com/default",
|
||||||
|
"quota_limit": "defaultPerDayPerProject",
|
||||||
|
"quota_unit": "1/d/{project}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@type": "type.googleapis.com/google.rpc.Help",
|
||||||
|
"links": [
|
||||||
|
{
|
||||||
|
"description": "Request a higher quota limit.",
|
||||||
|
"url": "https://cloud.google.com/docs/quotas/help/request_increase"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
36
run-lh.cjs
Normal file
36
run-lh.cjs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
const { execSync } = require('child_process');
|
||||||
|
|
||||||
|
console.log("Running Lighthouse...");
|
||||||
|
try {
|
||||||
|
execSync('npx lighthouse "https://e-tib.com/de/standorte?v=2" --chrome-flags="--headless --no-sandbox" --output json --output-path ./lh-report.json', { stdio: 'inherit' });
|
||||||
|
} catch(e) {
|
||||||
|
console.log("Lighthouse run failed", e.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = JSON.parse(fs.readFileSync('./lh-report.json', 'utf8'));
|
||||||
|
const score = data.categories.performance.score * 100;
|
||||||
|
console.log("\n==================================");
|
||||||
|
console.log(`PERFORMANCE SCORE: ${score}`);
|
||||||
|
console.log("==================================\n");
|
||||||
|
|
||||||
|
console.log("FAILING METRICS (Score < 1.0):");
|
||||||
|
Object.values(data.audits).filter(a => a.score !== null && a.score < 1).forEach(a => {
|
||||||
|
console.log(`- ${a.id}: ${a.score} (${a.displayValue || 'No display value'})`);
|
||||||
|
if (a.details && a.details.items && a.details.items.length > 0) {
|
||||||
|
if (a.id === 'image-delivery-insight' || a.id === 'unused-javascript' || a.id === 'modern-image-formats' || a.id === 'uses-responsive-images') {
|
||||||
|
console.log(" Items:");
|
||||||
|
a.details.items.forEach(item => {
|
||||||
|
console.log(` URL: ${item.url || item.node?.nodeLabel || 'unknown'}`);
|
||||||
|
if (item.wastedBytes) console.log(` Wasted KB: ${(item.wastedBytes / 1024).toFixed(2)}`);
|
||||||
|
if (item.wastedMs) console.log(` Wasted Ms: ${item.wastedMs}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("\nLCP BREAKDOWN:");
|
||||||
|
const lcpElement = data.audits['largest-contentful-paint-element'];
|
||||||
|
if (lcpElement && lcpElement.details && lcpElement.details.items) {
|
||||||
|
console.log("LCP Element:", lcpElement.details.items[0].node.snippet);
|
||||||
|
}
|
||||||
36
run-lh.js
Normal file
36
run-lh.js
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
const { execSync } = require('child_process');
|
||||||
|
|
||||||
|
console.log("Running Lighthouse...");
|
||||||
|
try {
|
||||||
|
execSync('npx lighthouse "https://e-tib.com/de/standorte?v=2" --chrome-flags="--headless --no-sandbox" --output json --output-path ./lh-report.json', { stdio: 'inherit' });
|
||||||
|
} catch(e) {
|
||||||
|
console.log("Lighthouse run failed", e.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = JSON.parse(fs.readFileSync('./lh-report.json', 'utf8'));
|
||||||
|
const score = data.categories.performance.score * 100;
|
||||||
|
console.log("\n==================================");
|
||||||
|
console.log(`PERFORMANCE SCORE: ${score}`);
|
||||||
|
console.log("==================================\n");
|
||||||
|
|
||||||
|
console.log("FAILING METRICS (Score < 1.0):");
|
||||||
|
Object.values(data.audits).filter(a => a.score !== null && a.score < 1).forEach(a => {
|
||||||
|
console.log(`- ${a.id}: ${a.score} (${a.displayValue || 'No display value'})`);
|
||||||
|
if (a.details && a.details.items && a.details.items.length > 0) {
|
||||||
|
if (a.id === 'image-delivery-insight' || a.id === 'unused-javascript' || a.id === 'modern-image-formats' || a.id === 'uses-responsive-images') {
|
||||||
|
console.log(" Items:");
|
||||||
|
a.details.items.forEach(item => {
|
||||||
|
console.log(` URL: ${item.url || item.node?.nodeLabel || 'unknown'}`);
|
||||||
|
if (item.wastedBytes) console.log(` Wasted KB: ${item.wastedBytes / 1024}`);
|
||||||
|
if (item.wastedMs) console.log(` Wasted Ms: ${item.wastedMs}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("\nLCP BREAKDOWN:");
|
||||||
|
const lcpElement = data.audits['largest-contentful-paint-element'];
|
||||||
|
if (lcpElement && lcpElement.details && lcpElement.details.items) {
|
||||||
|
console.log("LCP Element:", lcpElement.details.items[0].node.snippet);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user