Apply KPI background art to Infrastructure middle row cards

Pulls in the new gold-framed hex-pattern background assets for Resource
Distribution, Infrastructure Map, and Top Resources by Utilization,
replacing the plain card styling with the baked-in border/labels.
Also stages network-kpi-bg.png in public/ for the future Network page.
This commit is contained in:
Claude 2026-06-18 17:06:53 +00:00
parent 0ba30804f1
commit 7af31c0202
No known key found for this signature in database
9 changed files with 19 additions and 7 deletions

BIN
assets/infra-map-kpi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

BIN
assets/network-kpi-bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

BIN
public/infra-map-kpi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

BIN
public/network-kpi-bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View file

@ -80,6 +80,22 @@ const sectionTitle: React.CSSProperties = {
marginBottom: '16px', marginBottom: '16px',
} }
function framedCard(bgUrl: string): React.CSSProperties {
return {
backgroundImage: `url(${bgUrl})`,
backgroundSize: '100% 100%',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
borderRadius: '12px',
position: 'relative',
overflow: 'hidden',
height: '100%',
display: 'flex',
flexDirection: 'column',
padding: '20px 20px 64px 20px',
}
}
function Donut({ data, centerLabel }: { data: { name: string; value: number; color: string }[]; centerLabel?: string }) { function Donut({ data, centerLabel }: { data: { name: string; value: number; color: string }[]; centerLabel?: string }) {
return ( return (
<div className="flex flex-1 items-center gap-4"> <div className="flex flex-1 items-center gap-4">
@ -182,18 +198,15 @@ export default function Infrastructure() {
<div className="min-h-0 flex-1"> <div className="min-h-0 flex-1">
<div className="grid h-full w-full grid-cols-[1fr_1.4fr_1fr] gap-6"> <div className="grid h-full w-full grid-cols-[1fr_1.4fr_1fr] gap-6">
{/* Resource Distribution */} {/* Resource Distribution */}
<div style={cardBase} className="hover:!border-gold/15"> <div style={framedCard('/resource-distrabution-bg.png')}>
<div className="relative z-10 flex flex-1 flex-col"> <div className="relative z-10 flex flex-1 flex-col">
<h3 style={sectionTitle}>Resource Distribution</h3>
<Donut data={distributionData} centerLabel="128" /> <Donut data={distributionData} centerLabel="128" />
</div> </div>
</div> </div>
{/* Infrastructure Map */} {/* Infrastructure Map */}
<div style={cardBase} className="hover:!border-gold/15"> <div style={framedCard('/infra-map-kpi.png')}>
<div style={{ position: 'absolute', inset: 0, opacity: 0.03, backgroundImage: 'linear-gradient(rgba(200,164,52,0.3) 1px, transparent 1px), linear-gradient(90deg, rgba(200,164,52,0.3) 1px, transparent 1px)', backgroundSize: '40px 40px', pointerEvents: 'none' }} />
<div className="relative z-10 flex flex-1 flex-col"> <div className="relative z-10 flex flex-1 flex-col">
<h3 style={sectionTitle}>Infrastructure Map</h3>
<div className="relative flex-1" style={{ minHeight: '140px' }}> <div className="relative flex-1" style={{ minHeight: '140px' }}>
<Globe2 size={120} strokeWidth={0.6} style={{ position: 'absolute', left: '50%', top: '50%', transform: 'translate(-50%, -50%)', color: 'rgba(200,164,52,0.08)' }} /> <Globe2 size={120} strokeWidth={0.6} style={{ position: 'absolute', left: '50%', top: '50%', transform: 'translate(-50%, -50%)', color: 'rgba(200,164,52,0.08)' }} />
{regions.map((r) => ( {regions.map((r) => (
@ -206,9 +219,8 @@ export default function Infrastructure() {
</div> </div>
{/* Top Resources by Utilization */} {/* Top Resources by Utilization */}
<div style={cardBase} className="hover:!border-gold/15"> <div style={framedCard('/resource-utilization.png')}>
<div className="relative z-10 flex flex-1 flex-col"> <div className="relative z-10 flex flex-1 flex-col">
<h3 style={sectionTitle}>Top Resources by Utilization</h3>
<div className="flex flex-1 flex-col justify-around gap-4"> <div className="flex flex-1 flex-col justify-around gap-4">
{topResources.map((res) => { {topResources.map((res) => {
const color = res.percentage >= 90 ? '#E74C3C' : res.percentage >= 70 ? '#E67E22' : '#C8A434' const color = res.percentage >= 90 ? '#E74C3C' : res.percentage >= 70 ? '#E67E22' : '#C8A434'