Skip to content

Commit fe85e34

Browse files
committed
fix: Adjust layout to fit all servers in visualization window
- Increase container height from h-72 to h-80 (320px) - Reduce server padding from py-6 to py-4 - Adjust Y positions from [20,50,80] to [18,50,82] - Compact server labels (text-xs, mt-1)
1 parent 6b0f27c commit fe85e34

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

components/games/load-balancer-simulator.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export default function LoadBalancerSimulator() {
194194
const totalRequests = servers.reduce((sum, s) => sum + s.requests, 0);
195195

196196
// Pre-compute server Y positions for consistent line/dot placement
197-
const serverYPositions = [20, 50, 80]; // top, middle, bottom as percentages
197+
const serverYPositions = [18, 50, 82]; // top, middle, bottom as percentages
198198

199199
return (
200200
<div className="w-full max-w-4xl mx-auto">
@@ -262,7 +262,7 @@ export default function LoadBalancerSimulator() {
262262
</div>
263263

264264
{/* Visualization */}
265-
<div className="relative h-72 bg-gradient-to-br from-slate-100 to-slate-50 dark:from-slate-800 dark:to-slate-900 rounded-xl overflow-hidden">
265+
<div className="relative h-80 bg-gradient-to-br from-slate-100 to-slate-50 dark:from-slate-800 dark:to-slate-900 rounded-xl overflow-hidden">
266266
{/* Connection Lines */}
267267
<svg className="absolute inset-0 w-full h-full">
268268
{/* Users to Load Balancer */}
@@ -315,7 +315,7 @@ export default function LoadBalancerSimulator() {
315315
</div>
316316

317317
{/* Servers (Right) - positioned to match serverYPositions */}
318-
<div className="absolute right-[4%] top-0 bottom-0 flex flex-col justify-around py-6 z-10">
318+
<div className="absolute right-[4%] top-0 bottom-0 flex flex-col justify-around py-4 z-10">
319319
{servers.map((server, idx) => (
320320
<div
321321
key={server.id}
@@ -337,7 +337,7 @@ export default function LoadBalancerSimulator() {
337337
<XCircle className="h-9 w-9 text-white" />
338338
)}
339339
</div>
340-
<div className={`mt-2 text-sm font-semibold ${!server.healthy ? 'text-red-500' : ''}`}>
340+
<div className={`mt-1 text-xs font-semibold ${!server.healthy ? 'text-red-500' : ''}`}>
341341
{server.name}
342342
</div>
343343
</div>

0 commit comments

Comments
 (0)