3d Flip 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>3D Flip Heatmap</title> <style> body { font-family: 'Courier New', Courier, monospace; background-color: #1e1e1e; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; color: #ffffff; } .heatmap-container { display: grid; grid-template-columns: repeat(10, 1fr); grid-gap: 5px; perspective: 1000px; } .heatmap-cell { width: 40px; height: 40px; display: flex; justify-content: center; align-items: center; background: #333; border-radius: 5px; cursor: pointer; transition: transform 0.6s; transform-style: preserve-3d; position: relative; color: #ffffff; font-size: 20px; } .heatmap-cell:hover { transform: rotateY(180deg); } .heatmap-cell[data-value="1"] { background-color: #4caf50; } .heatmap-cell[data-value="2"] { background-color: #ffeb3b; } .heatmap-cell[data-value="3"] { background-color: #ff9800; } .heatmap-cell[data-value="4"] { background-color: #f44336; } .heatmap-cell[data-value="5"] { background-color: #9c27b0; } .heatmap-cell .front, .heatmap-cell .back { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; justify-content: center; align-items: center; } .heatmap-cell .back { transform: rotateY(180deg); background: #000; } .emoji { font-size: 20px; margin-left: 5px; } </style> </head> <body> <div class="heatmap-container" id="flip-heatmap"> <!-- Cells will be dynamically created here --> </div> <script> 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; } function createHeatmap(data) { const heatmapContainer = document.getElementById('flip-heatmap'); data.forEach(row => { row.forEach(value => { const cell = document.createElement('div'); cell.className = 'heatmap-cell'; cell.dataset.value = value; cell.innerHTML = ` <div class="front">${value} <span class="emoji">🌀</span></div> <div class="back">💥</div> `; heatmapContainer.appendChild(cell); }); }); } const heatmapData = generateHeatmapData(10, 10); createHeatmap(heatmapData); </script> </body> </html>