fixes Network CoverImage3
Deploy to VPS / deploy (push) Has been cancelled

This commit is contained in:
2026-04-21 11:06:40 -05:00
parent 8556ef78f4
commit 226b721721
+6 -1
View File
@@ -13,6 +13,10 @@ import { useTranslations } from "next-intl";
const RADIUS = 2;
const CAM_FOV = 50;
function nodeToSlug(title: string): string {
return title.toLowerCase().trim().replace(/[^\w\s-]/g, '').replace(/[\s_-]+/g, '-').replace(/^-+|-+$/g, '');
}
function latLonToVec3(lat: number, lon: number, r: number) {
const phi = (90 - lat) * (Math.PI / 180);
const theta = (lon + 180) * (Math.PI / 180);
@@ -436,6 +440,7 @@ function NodeCard({ node, isDark, onClose, onViewCase }: {
}) {
const isEvent = node.nodeType === "event";
const isHQ = node.nodeType === "hq";
const nodeSlug = nodeToSlug(node.title);
const accent = isHQ ? (isDark ? "#FFFFFF" : "#111111")
: isEvent ? (isDark ? "#E879F9" : "#9333EA")
: (isDark ? "#38BDF8" : "#0066CC");
@@ -460,7 +465,7 @@ function NodeCard({ node, isDark, onClose, onViewCase }: {
<div className="relative w-full rounded-t-2xl overflow-hidden" style={{ height: 148 }}>
{node.mediaFileName ? (
<>
<Image src={`/cases/${node.mediaFileName}`} alt={node.title} fill sizes="380px" className="object-cover object-center" />
<Image src={`/cases/${nodeSlug}/${node.mediaFileName}`} alt={node.title} fill sizes="380px" className="object-cover object-center" />
<div className="absolute inset-0 pointer-events-none" style={{
background: isDark
? "linear-gradient(to bottom, transparent 35%, rgba(6,10,22,0.94) 100%)"