20 lines
674 B
HTML
Raw Permalink Normal View History

2024-02-20 11:17:06 +01:00
2024-03-06 10:52:47 +01:00
<div class="flex-fill col-md-5 col-lg-4 col-12 card bg-light mb-6">
2024-02-20 11:17:06 +01:00
<div class="card-body">
<h5 class="card-title">📅 Heatmap</h5>
<div id="heatmap"></div>
</div>
</div>
<script>
2024-03-08 12:35:46 +01:00
function hexToRgb(hex) {
hex = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b) => r + r + g + g + b + b);
const [, r, g, b] = hex.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);
return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)];
}
// Generates activity based on the Values given by the Backend
2024-02-20 11:17:06 +01:00
const activityData = {{ heatmap_values }};
2024-03-07 15:56:33 +01:00
const day = {{ day }};
2024-03-08 12:35:46 +01:00
const color = hexToRgb("{{ color }}");
2024-02-28 10:46:26 +01:00
</script>