About this snippet

Monitor your infrastructure with a live server heatmap. We generated hundreds of pulsing status nodes natively in JavaScript, which creates a highly technical and professional dashboard aesthetic.

Size
3.6 KB
Uses
HTML, CSS, JavaScript
Loads
Nothing external
Views
194
<div class="heatmap-dashboard">
  <div class="dashboard-head">
    <div>
      <h2>Global Cluster Status</h2>
      <p>Live ping rendering across all deployment nodes.</p>
    </div>
    <div class="status-legend">
      <span class="legend-item"><div class="dot green"></div> Healthy</span>
      <span class="legend-item"><div class="dot yellow"></div> Warning</span>
      <span class="legend-item"><div class="dot red"></div> Offline</span>
    </div>
  </div>
  
  <div class="node-grid" id="node-grid">
    <!-- Nodes injected instantly via JavaScript -->
  </div>
</div>
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  margin: 0;
  background: #020617;
  color: #f8fafc;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.heatmap-dashboard {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 900px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.dashboard-head h2 {
  margin: 0 0 8px 0;
  font-size: 1.75rem;
}

.dashboard-head p {
  color: #94a3b8;
  margin: 0;
}

.status-legend {
  display: flex;
  gap: 16px;
  background: #1e293b;
  padding: 10px 16px;
  border-radius: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.green { background: #10b981; box-shadow: 0 0 8px #10b981; }
.dot.yellow { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.dot.red { background: #ef4444; box-shadow: 0 0 8px #ef4444; }

.node-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #020617;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #1e293b;
}

.server-node {
  width: calc(10% - 7.2px); /* 10 columns */
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: #10b981;
  transition: background 0.5s ease, box-shadow 0.5s ease;
  cursor: crosshair;
}

.server-node:hover {
  transform: scale(1.2);
  z-index: 10;
}

.status-ok {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.status-warn {
  background: #f59e0b;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
  animation: pulse-warn 2s infinite alternate;
}

.status-error {
  background: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
  animation: pulse-error 1s infinite alternate;
}

@keyframes pulse-warn {
  to { opacity: 0.6; }
}

@keyframes pulse-error {
  to { opacity: 0.4; }
}
const grid = document.getElementById("node-grid");
const nodes = new Array();
const totalNodes = 100;

/* Build the grid */
for (let i = 0; i < totalNodes; i++) {
  const node = document.createElement("div");
  node.className = "server-node status-ok";
  grid.appendChild(node);
  nodes.push(node);
}

/* Simulate live server health updates securely */
function simulateTraffic() {
  nodes.forEach(function(node) {
    /* Random chance to alter state */
    const chance = Math.random();
    
    if (chance > 0.98) {
      node.className = "server-node status-error";
    } else if (chance > 0.92) {
      node.className = "server-node status-warn";
    } else if (chance > 0.85) {
      /* Return to normal */
      node.className = "server-node status-ok";
    }
  });
}

/* Update very frequently to look realistic */
setInterval(simulateTraffic, 800);
Esc
↑↓ moveEnter select

Start from a template

Open an .html file, or HTML, CSS, JS, Markdown, Less or TypeScript files. You can also drop them here. Styles and scripts go into their panes.

Share

Source

Keyboard shortcuts

Save