Compare commits
6 Commits
v2.2.13-rc
...
v2.2.13-rc
| Author | SHA1 | Date | |
|---|---|---|---|
| afe3565155 | |||
| e677089ff9 | |||
| b7d9a4b0d0 | |||
| 6c8614f147 | |||
| aa4e121fea | |||
| 6697703c91 |
@@ -1,6 +1,6 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState, useRef } from 'react';
|
||||||
import { motion, AnimatePresence } from 'framer-motion';
|
import { motion, AnimatePresence } from 'framer-motion';
|
||||||
import { MapPin, Factory, Zap, CheckCircle2, ArrowUpRight } from 'lucide-react';
|
import { MapPin, Factory, Zap, CheckCircle2, ArrowUpRight } from 'lucide-react';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
@@ -38,10 +38,13 @@ export function InteractiveGermanyMap({
|
|||||||
hideStandorte = false
|
hideStandorte = false
|
||||||
}: InteractiveGermanyMapProps) {
|
}: InteractiveGermanyMapProps) {
|
||||||
const [activeLocation, setActiveLocation] = useState<Location | null>(null);
|
const [activeLocation, setActiveLocation] = useState<Location | null>(null);
|
||||||
const [hoverTimeout, setHoverTimeout] = useState<NodeJS.Timeout | null>(null);
|
const hoverTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
||||||
|
|
||||||
const handleMouseEnter = (loc: Location) => {
|
const handleMouseEnter = (loc: Location) => {
|
||||||
if (hoverTimeout) clearTimeout(hoverTimeout);
|
if (hoverTimeoutRef.current) {
|
||||||
|
clearTimeout(hoverTimeoutRef.current);
|
||||||
|
hoverTimeoutRef.current = null;
|
||||||
|
}
|
||||||
setActiveLocation(loc);
|
setActiveLocation(loc);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -49,7 +52,7 @@ export function InteractiveGermanyMap({
|
|||||||
const timeout = setTimeout(() => {
|
const timeout = setTimeout(() => {
|
||||||
setActiveLocation(null);
|
setActiveLocation(null);
|
||||||
}, 200);
|
}, 200);
|
||||||
setHoverTimeout(timeout);
|
hoverTimeoutRef.current = timeout;
|
||||||
};
|
};
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -85,12 +88,11 @@ export function InteractiveGermanyMap({
|
|||||||
<div key={isHero ? `hero-map-${pathname}` : undefined} className={isHero ? "relative w-full" : "relative w-full max-w-7xl mx-auto py-12 md:py-24 px-4 sm:px-6 mt-16 md:mt-20"}>
|
<div key={isHero ? `hero-map-${pathname}` : undefined} className={isHero ? "relative w-full" : "relative w-full max-w-7xl mx-auto py-12 md:py-24 px-4 sm:px-6 mt-16 md:mt-20"}>
|
||||||
<div className={`bg-[#050B14] ${isHero ? 'pt-32 pb-16 md:pt-40 md:pb-24' : 'rounded-[2.5rem] md:rounded-[3.5rem] shadow-2xl border border-white/5'} overflow-visible relative group/map`}>
|
<div className={`bg-[#050B14] ${isHero ? 'pt-32 pb-16 md:pt-40 md:pb-24' : 'rounded-[2.5rem] md:rounded-[3.5rem] shadow-2xl border border-white/5'} overflow-visible relative group/map`}>
|
||||||
{/* Animated Border Glow */}
|
{/* Animated Border Glow */}
|
||||||
<AnimatedGlossyBorder opacity={0.7} className="z-30" disableAnimation={isHero} />
|
{!isHero && <AnimatedGlossyBorder opacity={0.7} className="z-30" />}
|
||||||
|
|
||||||
{/* Background Effects */}
|
{/* Background Effects */}
|
||||||
<div className={`absolute inset-0 bg-gradient-to-br from-[#050B14] via-[#0A1322] to-[#050B14] ${!isHero ? 'rounded-[2.5rem] md:rounded-[3.5rem]' : ''} overflow-hidden`}>
|
<div className={`absolute inset-0 bg-gradient-to-br from-[#050B14] via-[#0A1322] to-[#050B14] ${!isHero && 'rounded-[2.5rem] md:rounded-[3.5rem]'} overflow-hidden`} />
|
||||||
<div className="absolute top-0 right-0 w-[800px] h-[800px] bg-primary/5 rounded-full blur-[120px] pointer-events-none translate-x-1/3 -translate-y-1/3" />
|
<div className="absolute top-0 right-0 w-[800px] h-[800px] bg-primary/5 rounded-full blur-[120px] pointer-events-none translate-x-1/3 -translate-y-1/3 overflow-hidden" />
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={`relative z-10 grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-12 gap-12 items-center min-h-[600px] ${isHero ? 'max-w-7xl mx-auto px-4 sm:px-6' : 'p-8 md:p-12 lg:p-16'}`}>
|
<div className={`relative z-10 grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-12 gap-12 items-center min-h-[600px] ${isHero ? 'max-w-7xl mx-auto px-4 sm:px-6' : 'p-8 md:p-12 lg:p-16'}`}>
|
||||||
|
|
||||||
@@ -163,10 +165,12 @@ export function InteractiveGermanyMap({
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Minor Location Markers (The 100+ generic projects) */}
|
{/* Minor Location Markers (The 100+ generic projects) */}
|
||||||
{finalLocations.filter(l => l.type === 'minor_node').map((loc, idx) => (
|
{finalLocations.filter(l => l.type === 'minor_node').map((loc, idx) => {
|
||||||
|
const isActive = activeLocation === loc;
|
||||||
|
return (
|
||||||
<div
|
<div
|
||||||
key={`minor-${idx}`}
|
key={`minor-${idx}`}
|
||||||
className="absolute z-10 group/minor cursor-pointer w-10 h-10 flex items-center justify-center"
|
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={{
|
style={{
|
||||||
left: `${loc.x}%`,
|
left: `${loc.x}%`,
|
||||||
top: `${loc.y}%`,
|
top: `${loc.y}%`,
|
||||||
@@ -174,12 +178,13 @@ export function InteractiveGermanyMap({
|
|||||||
}}
|
}}
|
||||||
onMouseEnter={() => handleMouseEnter(loc)}
|
onMouseEnter={() => handleMouseEnter(loc)}
|
||||||
onMouseLeave={handleMouseLeave}
|
onMouseLeave={handleMouseLeave}
|
||||||
|
onTouchStart={() => handleMouseEnter(loc)}
|
||||||
onClick={() => handleMouseEnter(loc)}
|
onClick={() => handleMouseEnter(loc)}
|
||||||
>
|
>
|
||||||
<div className="w-1.5 h-1.5 bg-primary/80 rounded-full group-hover/minor:bg-white group-hover/minor:scale-150 transition-all duration-300" />
|
<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 className="absolute inset-0 m-auto w-2 h-2 bg-primary rounded-full opacity-0 group-hover/minor:animate-ping" />
|
||||||
</div>
|
</div>
|
||||||
))}
|
)})}
|
||||||
|
|
||||||
{/* Major Location Markers (HQ, Branch, Project) */}
|
{/* Major Location Markers (HQ, Branch, Project) */}
|
||||||
{finalLocations.filter(l => l.type !== 'minor_node').map((loc, idx) => {
|
{finalLocations.filter(l => l.type !== 'minor_node').map((loc, idx) => {
|
||||||
@@ -190,10 +195,11 @@ export function InteractiveGermanyMap({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={loc.id}
|
key={loc.id}
|
||||||
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'}`}
|
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}%` }}
|
style={{ left: `${loc.x}%`, top: `${loc.y}%` }}
|
||||||
onMouseEnter={() => handleMouseEnter(loc)}
|
onMouseEnter={() => handleMouseEnter(loc)}
|
||||||
onMouseLeave={handleMouseLeave}
|
onMouseLeave={handleMouseLeave}
|
||||||
|
onTouchStart={() => handleMouseEnter(loc)}
|
||||||
onClick={() => handleMouseEnter(loc)}
|
onClick={() => handleMouseEnter(loc)}
|
||||||
>
|
>
|
||||||
{/* Ping Animation for HQ / Branch */}
|
{/* Ping Animation for HQ / Branch */}
|
||||||
|
|||||||
1860
lib/map-data.ts
1860
lib/map-data.ts
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
import { describe, it, expect } from 'vitest';
|
import { describe, it, expect } from 'vitest';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { defaultLocations } from '../lib/map-data';
|
import { defaultLocations, minorLocations } from '../lib/map-data';
|
||||||
|
|
||||||
describe('Task 12 TDD - Bohrtechnik and Reference Links', () => {
|
describe('Task 12 TDD - Bohrtechnik and Reference Links', () => {
|
||||||
const deHomePath = path.join(process.cwd(), 'content', 'de', 'home.mdx');
|
const deHomePath = path.join(process.cwd(), 'content', 'de', 'home.mdx');
|
||||||
@@ -27,10 +27,11 @@ describe('Task 12 TDD - Bohrtechnik and Reference Links', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should verify that all reference projects in map-data have no href links', () => {
|
it('should verify that all reference projects in map-data have no href links', () => {
|
||||||
// Check that all defaultLocations of type 'project' have href undefined or removed
|
// Check that all minorLocations of type 'minor_node' have href undefined
|
||||||
const projects = defaultLocations.filter(loc => loc.type === 'project');
|
// since all projects were downgraded to minor nodes without links.
|
||||||
|
const projects = minorLocations.filter(loc => loc.type === 'minor_node');
|
||||||
expect(projects.length).toBeGreaterThan(0);
|
expect(projects.length).toBeGreaterThan(0);
|
||||||
|
|
||||||
projects.forEach(project => {
|
projects.forEach(project => {
|
||||||
expect(project.href).toBeUndefined();
|
expect(project.href).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user