From 56c7d55f0bf3e41e47191b00672407fa75a6dd64 Mon Sep 17 00:00:00 2001 From: schererleander Date: Thu, 25 Dec 2025 15:35:32 +0000 Subject: add hero section map --- src/pages/Home.tsx | 195 ++++++++++++++++++++++++++--------------------------- 1 file changed, 94 insertions(+), 101 deletions(-) (limited to 'src/pages') diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index cb3320b..de32cda 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -1,115 +1,108 @@ +import { useEffect, useState } from "react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; -import { - Card, - CardTitle, - CardDescription, - CardContent, -} from "@/components/ui/card"; +import { Card, CardTitle, CardDescription, CardContent } from "@/components/ui/card"; import { Projects } from "@/data/projects"; import { Tools } from "@/data/tools"; import { Github, Mail } from "lucide-react"; +import { MapContainer, TileLayer, Marker, useMap } from "react-leaflet"; +import L from "leaflet"; +import "leaflet/dist/leaflet.css"; + +const KARLSRUHE: [number, number] = [49.0069, 8.4037]; + +const icon = L.divIcon({ + html: `
`, + className: "", + iconSize: [12, 12], +}); + +function MapEffects() { + const map = useMap(); + useEffect(() => { + map.flyTo(KARLSRUHE, 14, { duration: 3 }); + }, [map]); + return null; +} + export default function Home() { + const [mounted, setMounted] = useState(false); + const [isDark, setIsDark] = useState(false); + + useEffect(() => { + setMounted(true); + const checkDark = () => setIsDark(document.documentElement.classList.contains("dark")); + checkDark(); + const obs = new MutationObserver(checkDark); + obs.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] }); + return () => obs.disconnect(); + }, []); + + if (!mounted) return null; + + const tileUrl = isDark + ? "https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png" + : "https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png"; + return ( - <> - ߸ home -
-
- {/* Gradient Blob */} - + -
-

Projects

-
- {Projects.map((project) => ( - - - - {project.name} - {project.name} - {project.description} -
- {project.badges.map((badge) => ( - {badge} - ))} -
-
-
-
- ))} -
-
-
- +
+

Tools & Technologies

+
+ {Tools.map((t, i) => ( + +
+
{t.name}
+
{t.name}{t.description}
+
+
+ ))} +
+
+ +
+

Recent Projects

+
+ {Projects.map((p, i) => ( + + + + {p.name} + {p.name} + {p.description} +
{p.badges.map(b => {b})}
+
+
+
+ ))} +
+
+ ); } -- cgit v1.3.1