Skip to content

Commit 5f240b9

Browse files
committed
fixed heatmap duplicate year and improved ui/ux
1 parent 0d2a760 commit 5f240b9

5 files changed

Lines changed: 133 additions & 42 deletions

File tree

ProductivityCake/Styles/CustomStyles.axaml

Lines changed: 68 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,31 @@
105105

106106
<!-- Floating Action Button -->
107107
<Style Selector="Button.fab">
108-
<Setter Property="Background" Value="#10B981" />
108+
<Setter Property="Background">
109+
<Setter.Value>
110+
<LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
111+
<GradientStop Color="#10B981" Offset="0" />
112+
<GradientStop Color="#059669" Offset="1" />
113+
</LinearGradientBrush>
114+
</Setter.Value>
115+
</Setter>
109116
<Setter Property="Foreground" Value="White" />
110117
<Setter Property="CornerRadius" Value="30" />
111-
<Setter Property="Width" Value="60" />
112-
<Setter Property="Height" Value="60" />
118+
<Setter Property="Width" Value="64" />
119+
<Setter Property="Height" Value="64" />
120+
<Setter Property="Transitions">
121+
<Transitions>
122+
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.2" />
123+
</Transitions>
124+
</Setter>
113125
</Style>
114126

115-
<Style Selector="Button.fab:pointerover /template/ ContentPresenter#PART_ContentPresenter">
116-
<Setter Property="Background" Value="#34D399" />
127+
<Style Selector="Button.fab:pointerover">
128+
<Setter Property="RenderTransform" Value="scale(1.1) rotate(90deg)" />
117129
</Style>
118130

119-
<Style Selector="Button.fab:pressed /template/ ContentPresenter#PART_ContentPresenter">
120-
<Setter Property="Background" Value="#059669" />
131+
<Style Selector="Button.fab:pressed">
132+
<Setter Property="RenderTransform" Value="scale(1.0) rotate(90deg)" />
121133
</Style>
122134

123135
<!-- Task Card Buttons -->
@@ -158,12 +170,27 @@
158170
</Style>
159171

160172
<!-- TextBox Styling -->
173+
<Style Selector="TextBox">
174+
<Setter Property="Transitions">
175+
<Transitions>
176+
<BrushTransition Property="BorderBrush" Duration="0:0:0.2" />
177+
</Transitions>
178+
</Setter>
179+
</Style>
180+
161181
<Style Selector="TextBox:pointerover /template/ Border#PART_BorderElement">
162182
<Setter Property="BorderBrush" Value="#8B5CF6" />
163183
</Style>
164184

165185
<Style Selector="TextBox:focus /template/ Border#PART_BorderElement">
166186
<Setter Property="BorderBrush" Value="#A78BFA" />
187+
<Setter Property="BoxShadow" Value="0 0 0 3 #8B5CF620" />
188+
</Style>
189+
190+
<Style Selector="TextBox.glass-combo:focus /template/ Border#PART_BorderElement">
191+
<Setter Property="BorderBrush" Value="#50FFFFFF" />
192+
<Setter Property="Background" Value="#25FFFFFF" />
193+
<Setter Property="BoxShadow" Value="0 0 0 3 #15FFFFFF" />
167194
</Style>
168195

169196
<!-- Border Hover Effects (Self-rendering) -->
@@ -205,6 +232,14 @@
205232
<Setter Property="RenderTransform" Value="scale(1.05)" />
206233
</Style>
207234

235+
<Style Selector="Button.nav-button:pointerover PathIcon">
236+
<Setter Property="Foreground" Value="White" />
237+
</Style>
238+
239+
<Style Selector="Button.nav-button:pointerover TextBlock">
240+
<Setter Property="Foreground" Value="White" />
241+
</Style>
242+
208243
<Style Selector="Button.nav-button:pressed /template/ ContentPresenter#PART_ContentPresenter">
209244
<Setter Property="Background">
210245
<Setter.Value>
@@ -219,12 +254,36 @@
219254
<Style Selector="Button.nav-button:pressed">
220255
<Setter Property="RenderTransform" Value="scale(0.95)" />
221256
</Style>
257+
258+
<Style Selector="Button.nav-button:pressed PathIcon">
259+
<Setter Property="Foreground" Value="#A78BFA" />
260+
</Style>
261+
262+
<Style Selector="Button.nav-button:pressed TextBlock">
263+
<Setter Property="Foreground" Value="#A78BFA" />
264+
</Style>
222265

223-
<!-- Project Card Hover -->
266+
<!-- Project Card Styles -->
267+
<Style Selector="Button.project-card">
268+
<Setter Property="Transitions">
269+
<Transitions>
270+
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.2" />
271+
</Transitions>
272+
</Setter>
273+
</Style>
274+
224275
<Style Selector="Button.project-card:pointerover /template/ ContentPresenter#PART_ContentPresenter">
225-
<Setter Property="Background" Value="#334155" />
276+
<Setter Property="Background" Value="#30FFFFFF" />
226277
<Setter Property="BorderBrush" Value="#8B5CF6" />
227278
</Style>
279+
280+
<Style Selector="Button.project-card:pointerover">
281+
<Setter Property="RenderTransform" Value="translateY(-2px)" />
282+
</Style>
283+
284+
<Style Selector="Button.project-card:pressed">
285+
<Setter Property="RenderTransform" Value="translateY(0px)" />
286+
</Style>
228287

229288
<!-- Title Bar Button Styles -->
230289
<Style Selector="Button#MinimizeButton:pointerover /template/ ContentPresenter#PART_ContentPresenter">

ProductivityCake/ViewModels/TimerViewModel.cs

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -935,47 +935,55 @@ private void GenerateHeatmap()
935935

936936
// Generate month labels (only for current year)
937937
var previousMonth = "";
938-
var monthStartWeek = 0;
938+
var monthStartWeek = -1;
939939
var currentYear = today.Year;
940+
var hasStartedCurrentYear = false;
940941

941942
for (int i = 0; i < weeks.Count; i++)
942943
{
943944
// Only consider days in the current year
944945
var firstDayInCurrentYear = weeks[i].Days.FirstOrDefault(d => d.Date.Year == currentYear && d.Date <= today);
945946
if (firstDayInCurrentYear != null)
946947
{
948+
if (!hasStartedCurrentYear)
949+
{
950+
hasStartedCurrentYear = true;
951+
monthStartWeek = i;
952+
}
953+
947954
var currentMonth = firstDayInCurrentYear.Date.ToString("MMM");
948955

949-
if (currentMonth != previousMonth)
956+
if (currentMonth != previousMonth && !string.IsNullOrEmpty(previousMonth))
950957
{
951958
// Add the previous month label
952-
if (!string.IsNullOrEmpty(previousMonth))
959+
var weeksInMonth = i - monthStartWeek;
960+
if (weeksInMonth > 0)
953961
{
954-
var weeksInMonth = i - monthStartWeek;
955-
if (weeksInMonth > 0)
962+
HeatmapMonths.Add(new HeatmapMonth
956963
{
957-
HeatmapMonths.Add(new HeatmapMonth
958-
{
959-
MonthName = previousMonth,
960-
Width = weeksInMonth * 15 // 12px square + 3px spacing
961-
});
962-
}
964+
MonthName = previousMonth,
965+
Width = weeksInMonth * 15 // 12px square + 3px spacing
966+
});
963967
}
964968
monthStartWeek = i;
965-
previousMonth = currentMonth;
966969
}
970+
971+
previousMonth = currentMonth;
967972
}
968973
}
969974

970975
// Add the last month
971-
if (!string.IsNullOrEmpty(previousMonth))
976+
if (!string.IsNullOrEmpty(previousMonth) && monthStartWeek >= 0)
972977
{
973978
var weeksInMonth = weeks.Count - monthStartWeek;
974-
HeatmapMonths.Add(new HeatmapMonth
979+
if (weeksInMonth > 0)
975980
{
976-
MonthName = previousMonth,
977-
Width = weeksInMonth * 15
978-
});
981+
HeatmapMonths.Add(new HeatmapMonth
982+
{
983+
MonthName = previousMonth,
984+
Width = weeksInMonth * 15
985+
});
986+
}
979987
}
980988
}
981989

ProductivityCake/Views/MainWindow.axaml

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,26 @@
126126
VerticalAlignment="Center">
127127
<PathIcon
128128
Data="{StaticResource folder_regular}"
129-
Foreground="White"
129+
Foreground="#B0FFFFFF"
130130
Height="24"
131-
Width="24" />
131+
Width="24">
132+
<PathIcon.Transitions>
133+
<Transitions>
134+
<BrushTransition Property="Foreground" Duration="0:0:0.2" />
135+
</Transitions>
136+
</PathIcon.Transitions>
137+
</PathIcon>
132138
<TextBlock
133139
FontSize="10"
134-
Foreground="White"
140+
Foreground="#B0FFFFFF"
135141
HorizontalAlignment="Center"
136-
Text="Projects" />
142+
Text="Projects">
143+
<TextBlock.Transitions>
144+
<Transitions>
145+
<BrushTransition Property="Foreground" Duration="0:0:0.2" />
146+
</Transitions>
147+
</TextBlock.Transitions>
148+
</TextBlock>
137149
</StackPanel>
138150
</Button>
139151

@@ -150,14 +162,26 @@
150162
VerticalAlignment="Center">
151163
<PathIcon
152164
Data="{StaticResource clock_regular}"
153-
Foreground="White"
165+
Foreground="#B0FFFFFF"
154166
Height="24"
155-
Width="24" />
167+
Width="24">
168+
<PathIcon.Transitions>
169+
<Transitions>
170+
<BrushTransition Property="Foreground" Duration="0:0:0.2" />
171+
</Transitions>
172+
</PathIcon.Transitions>
173+
</PathIcon>
156174
<TextBlock
157175
FontSize="10"
158-
Foreground="White"
176+
Foreground="#B0FFFFFF"
159177
HorizontalAlignment="Center"
160-
Text="Timer" />
178+
Text="Timer">
179+
<TextBlock.Transitions>
180+
<Transitions>
181+
<BrushTransition Property="Foreground" Duration="0:0:0.2" />
182+
</Transitions>
183+
</TextBlock.Transitions>
184+
</TextBlock>
161185
</StackPanel>
162186
</Button>
163187
</Grid>

ProductivityCake/Views/ProjectListView.axaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,17 @@
107107
<ItemsControl.ItemTemplate>
108108
<DataTemplate DataType="models:Project">
109109
<Button
110-
Background="#1F2937"
111-
BorderBrush="#374151"
110+
Background="#20FFFFFF"
111+
BorderBrush="#30FFFFFF"
112112
BorderThickness="1"
113113
Classes="project-card"
114114
Command="{Binding $parent[ItemsControl].((vm:ProjectListViewModel)DataContext).OpenProjectDetailsCommand}"
115115
CommandParameter="{Binding}"
116-
CornerRadius="8"
116+
CornerRadius="16"
117117
HorizontalAlignment="Stretch"
118118
HorizontalContentAlignment="Stretch"
119-
Margin="0,0,0,10"
120-
Padding="15">
119+
Margin="0,0,0,12"
120+
Padding="18">
121121
<Grid ColumnDefinitions="*, Auto">
122122
<StackPanel Grid.Column="0" Spacing="8">
123123
<TextBlock

ProductivityCake/Views/TimerView.axaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@
399399
<!-- Timer Settings -->
400400
<Border Classes="glass-card" Padding="30,25">
401401
<StackPanel Spacing="25">
402-
<TextBlock Classes="title" Text="⏱️ Timer Settings" />
402+
<TextBlock Classes="title" Text="Timer Settings" />
403403

404404
<!-- Work Time -->
405405
<StackPanel Spacing="15">
@@ -520,7 +520,7 @@
520520
<!-- Notifications -->
521521
<Border Classes="glass-card" Padding="30,25">
522522
<StackPanel Spacing="18">
523-
<TextBlock Classes="title" Text="🔔 Notifications" />
523+
<TextBlock Classes="title" Text="Notifications" />
524524

525525
<CheckBox
526526
Classes="glass-checkbox"
@@ -548,7 +548,7 @@
548548
<!-- Window Settings -->
549549
<Border Classes="glass-card" Padding="30,25">
550550
<StackPanel Spacing="18">
551-
<TextBlock Classes="title" Text="🪟 Window Settings" />
551+
<TextBlock Classes="title" Text="Window Settings" />
552552

553553
<CheckBox
554554
Classes="glass-checkbox"

0 commit comments

Comments
 (0)