From 4a70e4393099e54ce9789ac5c7ca423e93aa92ee Mon Sep 17 00:00:00 2001 From: Lexi Date: Thu, 2 May 2024 17:37:14 +0200 Subject: Improve the heatmap layout --- MatrixUtils.Web/Shared/ActivityGraph.razor | 9 ++++----- MatrixUtils.Web/Shared/ActivityGraph.razor.css | 8 +++++++- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'MatrixUtils.Web/Shared') diff --git a/MatrixUtils.Web/Shared/ActivityGraph.razor b/MatrixUtils.Web/Shared/ActivityGraph.razor index 51fb539..fa648c7 100644 --- a/MatrixUtils.Web/Shared/ActivityGraph.razor +++ b/MatrixUtils.Web/Shared/ActivityGraph.razor @@ -5,7 +5,7 @@ @if (Data is { Count: > 0 }) { @* 12*5=60 *@ -
+
@* row 0: month labels with colspan *@ @* @foreach (var month in Enumerable.Range(1, 12)) *@ @* { *@ @@ -62,7 +62,7 @@ var needsLeftBorder = date.Day <= 7;
+ style="grid-row: @((int)date.DayOfWeek + 2); border-@(needsLeftBorder ? "left" : "right"): @(needsBorder ? "2px solid #aaa" : "none"); border-top: @(needsTopBorder ? "2px solid #aaa" : "none");"> @if (hasData) {
+
}
@@ -145,4 +144,4 @@ } } -} \ No newline at end of file +} diff --git a/MatrixUtils.Web/Shared/ActivityGraph.razor.css b/MatrixUtils.Web/Shared/ActivityGraph.razor.css index d8e543c..b5c01bd 100644 --- a/MatrixUtils.Web/Shared/ActivityGraph.razor.css +++ b/MatrixUtils.Web/Shared/ActivityGraph.razor.css @@ -13,4 +13,10 @@ .day-label { grid-column: 1; -} \ No newline at end of file +} + +.activity-graph { + width: fit-content; + grid-template-columns: 35px repeat(55, 1.5em) !important; + padding: 0.75rem; +} -- cgit 1.5.1