Componenti Mappe di calore Componente Mappe di calore

Componente Mappe di calore

Componente Heat Maps con effetti reattivi e supporto per temi scuri.

Anteprima

Codice HTML

<div class="bg-gray-900 text-white p-8">
  <h2 class="text-2xl font-bold mb-4">Heat Map</h2>
  <div class="grid grid-cols-7 gap-1">
    <!-- Days of the week -->
    <div class="text-center text-sm text-gray-400">Sun</div>
    <div class="text-center text-sm text-gray-400">Mon</div>
    <div class="text-center text-sm text-gray-400">Tue</div>
    <div class="text-center text-sm text-gray-400">Wed</div>
    <div class="text-center text-sm text-gray-400">Thu</div>
    <div class="text-center text-sm text-gray-400">Fri</div>
    <div class="text-center text-sm text-gray-400">Sat</div>

    <!-- Heat map squares (example data) -->
    {[...Array(42)].map((_, i) => (
      `<div key=${i} class="h-8 bg-gray-700 rounded heat-square data-level-{{
        (
          () => {
            const random = Math.random();
            if (random < 0.4) return 1; /* low activity */
            if (random < 0.7) return 2; /* medium activity */
            if (random < 0.9) return 3; /* high activity */
            return 4; /* very high activity */
          }
        )()
      }}"></div>`
    )).join("")}
  </div>

  <style>
    .heat-square[data-level="1"] {
      background-color: #1e3a8a; /* blue-900 */
    }
    .heat-square[data-level="2"] {
      background-color: #1d4ed8; /* blue-700 */
    }
    .heat-square[data-level="3"] {
      background-color: #3b82f6; /* blue-500 */
    }
    .heat-square[data-level="4"] {
      background-color: #60a5fa; /* blue-400 */
    }

    /* Responsive adjustments */
    @media (max-width: 768px) {
      .grid-cols-7 {
        grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
      }
      .heat-square {
        height: 40px;
      }
    }
  </style>
</div>

Componenti correlati

Componente Mappe di calore

Un componente reattivo per le mappe di calore con supporto per il tema scuro, costruito con Tailwind CSS. Presenta un layout semplice con elementi minimi, adatto per un blog o per il consumo di contenuti.

Aperto

Componente Mappe di calore

Un semplice componente di mappe termiche reattive con uno stile di progettazione 3D e una combinazione di colori complementari, progettato per mostrare lavori o prodotti con supporto per temi scuri.

Aperto

Componente Mappe di calore

Un componente Heat Maps progettato con lo stile glassmorphism, con toni della terra. Il layout è semplice, composto da elementi di base destinati all'uso aziendale/aziendale e supporta la modalità oscura.

Aperto