Professional Heatmap - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Professional Heatmap</title> <style> body { font-family: Arial, sans-serif; background-color: #f0f0f5; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .heatmap-container { display: grid; grid-template-columns: repeat(10, 1fr); grid-gap: 5px; padding: 20px; background: #ffffff; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); border-radius: 10px; transform: scale(1); transition: transform 0.3s ease-in-out; } .heatmap-container:hover { transform: scale(1.05); } .heatmap-cell { width: 40px; height: 40px; display: flex; justify-content: center; align-items: center; border-radius: 5px; cursor: pointer; transition: background 0.3s ease-in-out; font-size: 20px; color: white; } .heatmap-cell:hover { box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); } .heatmap-cell[data-value="1"] { background-color: #ffcccc; } .heatmap-cell[data-value="2"] { background-color: #ff9999; } .heatmap-cell[data-value="3"] { background-color: #ff6666; } .heatmap-cell[data-value="4"] { background-color: #ff3333; } .heatmap-cell[data-value="5"] { background-color: #ff0000; } @keyframes pop { 0% { transform: scale(0.8); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } } .emoji { font-size: 20px; margin-left: 5px; animation: pop 0.5s ease-in-out infinite alternate; } .icon { margin-left: 5px; color: #FFD700; } </style> </head> <body> <div class="heatmap-container" id="heatmap"> <!-- Cells will be dynamically created here --> </div> <script> // Generate random heatmap data function generateHeatmapData(rows, cols) { const data = []; for (let i = 0; i < rows; i++) { const row = []; for (let j = 0; j < cols; j++) { row.push(Math.floor(Math.random() * 5) + 1); } data.push(row); } return data; } // Create heatmap cells function createHeatmap(data) { const heatmapContainer = document.getElementById('heatmap'); data.forEach(row => { row.forEach(value => { const cell = document.createElement('div'); cell.className = 'heatmap-cell'; cell.dataset.value = value; cell.innerHTML = value + ' <span class="emoji">🔥</span>'; cell.addEventListener('mouseover', () => { cell.querySelector('.emoji').innerHTML = '💥'; }); cell.addEventListener('mouseout', () => { cell.querySelector('.emoji').innerHTML = '🔥'; }); heatmapContainer.appendChild(cell); }); }); } const heatmapData = generateHeatmapData(10, 10); createHeatmap(heatmapData); </script> </body> </html>