HabitTracker/templates/index.html

57 lines
1.6 KiB
HTML
Raw Normal View History

2024-01-12 10:57:58 +01:00
{% extends 'layouts/main.html' %}
{% block content %}
<h1>Hello World!</h1>
<h3>{{ utc_dt }}</h3>
2024-01-17 11:17:35 +01:00
<div class="heatmap" id="heatmap"></div>
<script>
2024-01-17 11:17:35 +01:00
// Simulierte Aktivitätsdaten (ersetze dies durch deine echten Daten)
const activityData = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 5, 4, 3, 2, 1, 9, 5, 36, 75, 8, 9, 1, 0, 23, 0, 0, 0, 64, 0, 0, 64, 0, 0, 19, 84];
// Funktion zum Erstellen der Heatmap
function createHeatmap(data) {
const heatmapContainer = document.getElementById('heatmap');
for (let i = 0; i < data.length; i++) {
const opacity = data[i] / Math.max(...data); // Berechne die Opazität basierend auf Aktivitätsanzahl
const dayElement = document.createElement('div');
dayElement.classList.add('day');
dayElement.style.backgroundColor = `rgba(0, 255, 0, ${opacity})`;
heatmapContainer.appendChild(dayElement);
}
}
2024-01-17 11:17:35 +01:00
// Erstelle die Heatmap mit den simulierten Daten
createHeatmap(activityData);
2024-01-19 10:27:08 +01:00
</script>
2024-01-19 10:27:08 +01:00
<h2>Task List</h2>
<ul class="task-list row">
{% for habit in habits %}
<li class="row col-md-4">
<div class="col-auto">
<input type="checkbox" class="task-checkbox">
</div>
<div class="col" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
{{ habit.name }} hhhbhghbhjndjksbeujsdkfheuwaihgkjfgfjnsidkgjnkdghujds
</div>
</li>
<div class="col-md-8" style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
{{ habit.note }}
2024-01-17 11:17:35 +01:00
</div>
2024-01-19 10:27:08 +01:00
{% endfor %}
</ul>
2024-01-17 11:17:35 +01:00
2024-01-12 10:57:58 +01:00
{% endblock %}