EcoTrackerHomeView.xaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.EcoTrackerHomeView">
  4. <ScrollViewer VerticalScrollBarVisibility="Auto">
  5. <StackPanel Spacing="0">
  6. <!-- Hero Card wrapped in a clickable Button -->
  7. <Button Padding="0"
  8. Background="Transparent"
  9. BorderThickness="0"
  10. HorizontalAlignment="Stretch"
  11. HorizontalContentAlignment="Stretch"
  12. Margin="16,20,16,0"
  13. Click="OnHeroClick">
  14. <Border CornerRadius="16" ClipToBounds="True">
  15. <Panel>
  16. <!-- Gradient background -->
  17. <Border>
  18. <Border.Background>
  19. <LinearGradientBrush StartPoint="0%,0%" EndPoint="100%,100%">
  20. <GradientStop Color="#2E7D32" Offset="0"/>
  21. <GradientStop Color="#1B5E20" Offset="1"/>
  22. </LinearGradientBrush>
  23. </Border.Background>
  24. </Border>
  25. <!-- Decorative circle top-right -->
  26. <Border Width="140" Height="140"
  27. CornerRadius="70"
  28. Background="#14FFFFFF"
  29. HorizontalAlignment="Right"
  30. VerticalAlignment="Top"
  31. Margin="0,-40,-40,0"/>
  32. <!-- Content grid -->
  33. <Grid ColumnDefinitions="*,Auto" Margin="20">
  34. <!-- Left: stats + text -->
  35. <StackPanel Spacing="4" VerticalAlignment="Center">
  36. <TextBlock Text="TREES SAVED"
  37. FontSize="10" FontWeight="Bold"
  38. Foreground="#A5D6A7"/>
  39. <StackPanel Orientation="Horizontal" Spacing="4">
  40. <TextBlock Text="15"
  41. FontSize="48" FontWeight="Black"
  42. Foreground="White"/>
  43. <StackPanel VerticalAlignment="Bottom" Margin="0,0,0,10">
  44. <TextBlock Text="/20"
  45. FontSize="16" FontWeight="Medium"
  46. Foreground="#A5D6A7"/>
  47. </StackPanel>
  48. </StackPanel>
  49. <TextBlock Text="Keep going! 5 more to reach your goal"
  50. FontSize="12" Foreground="#A5D6A7"/>
  51. </StackPanel>
  52. <!-- Right: ring with leaf icon -->
  53. <Panel Width="72" Height="72"
  54. Grid.Column="1"
  55. VerticalAlignment="Center">
  56. <Border Width="72" Height="72"
  57. CornerRadius="36"
  58. BorderBrush="#3CA5D6A7"
  59. BorderThickness="5"/>
  60. <PathIcon Width="32" Height="32"
  61. Data="M12 3C9 6 6 9 6 13C6 17.4 8.7 21 12 22C15.3 21 18 17.4 18 13C18 9 15 6 12 3Z"
  62. Foreground="#4CAF50"
  63. HorizontalAlignment="Center"
  64. VerticalAlignment="Center"/>
  65. </Panel>
  66. </Grid>
  67. </Panel>
  68. </Border>
  69. </Button>
  70. <!-- Weekly Impact section -->
  71. <StackPanel Margin="16,20,16,0" Spacing="10">
  72. <TextBlock Text="WEEKLY IMPACT"
  73. FontSize="11" FontWeight="Bold"
  74. Foreground="#90A4AE"
  75. LetterSpacing="1.5"/>
  76. <StackPanel Orientation="Horizontal" Spacing="10">
  77. <!-- Water Saved card -->
  78. <Border CornerRadius="12" Background="White"
  79. Padding="14,12" HorizontalAlignment="Stretch">
  80. <Grid ColumnDefinitions="Auto,*">
  81. <Border Width="40" Height="40" CornerRadius="10"
  82. Background="#192196F3"
  83. VerticalAlignment="Center">
  84. <PathIcon Width="20" Height="20"
  85. Data="M12,20A6,6 0 0,1 6,14C6,10 12,3.25 12,3.25C12,3.25 18,10 18,14A6,6 0 0,1 12,20Z"
  86. Foreground="#2196F3"
  87. HorizontalAlignment="Center"
  88. VerticalAlignment="Center"/>
  89. </Border>
  90. <StackPanel Grid.Column="1" Margin="10,0,0,0"
  91. VerticalAlignment="Center" Spacing="2">
  92. <TextBlock Text="Water Saved"
  93. FontSize="11" FontWeight="Medium"
  94. Foreground="#90A4AE"/>
  95. <TextBlock Text="120 L"
  96. FontSize="18" FontWeight="Bold"
  97. Foreground="#2196F3"/>
  98. </StackPanel>
  99. </Grid>
  100. </Border>
  101. <!-- Carbon Reduced card -->
  102. <Border CornerRadius="12" Background="White"
  103. Padding="14,12" HorizontalAlignment="Stretch">
  104. <Grid ColumnDefinitions="Auto,*">
  105. <Border Width="40" Height="40" CornerRadius="10"
  106. Background="#194CAF50"
  107. VerticalAlignment="Center">
  108. <PathIcon Width="20" Height="20"
  109. Data="M19.35 10.04A7.49 7.49 0 0 0 12 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 0 0 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96z"
  110. Foreground="#4CAF50"
  111. HorizontalAlignment="Center"
  112. VerticalAlignment="Center"/>
  113. </Border>
  114. <StackPanel Grid.Column="1" Margin="10,0,0,0"
  115. VerticalAlignment="Center" Spacing="2">
  116. <TextBlock Text="Carbon Reduced"
  117. FontSize="11" FontWeight="Medium"
  118. Foreground="#90A4AE"/>
  119. <TextBlock Text="15 kg"
  120. FontSize="18" FontWeight="Bold"
  121. Foreground="#4CAF50"/>
  122. </StackPanel>
  123. </Grid>
  124. </Border>
  125. </StackPanel>
  126. </StackPanel>
  127. <!-- Daily Tasks section -->
  128. <StackPanel Margin="16,20,16,16" Spacing="10">
  129. <Grid ColumnDefinitions="*,Auto">
  130. <TextBlock Text="DAILY TASKS"
  131. FontSize="11" FontWeight="Bold"
  132. Foreground="#90A4AE"/>
  133. <TextBlock Grid.Column="1"
  134. Text="3 of 5 completed"
  135. FontSize="11"
  136. Foreground="#4CAF50"/>
  137. </Grid>
  138. <!-- Task 1: completed -->
  139. <Border CornerRadius="10" Background="White" Padding="12,10">
  140. <Grid ColumnDefinitions="Auto,*">
  141. <Border Width="24" Height="24" CornerRadius="6"
  142. Background="#4CAF50"
  143. VerticalAlignment="Center">
  144. <PathIcon Width="14" Height="14"
  145. Data="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"
  146. Foreground="White"
  147. HorizontalAlignment="Center"
  148. VerticalAlignment="Center"/>
  149. </Border>
  150. <TextBlock Grid.Column="1"
  151. Text="Use reusable water bottle"
  152. FontSize="14"
  153. Foreground="#90A4AE"
  154. Margin="10,0,0,0"
  155. VerticalAlignment="Center"
  156. TextDecorations="Strikethrough"/>
  157. </Grid>
  158. </Border>
  159. <!-- Task 2: completed -->
  160. <Border CornerRadius="10" Background="White" Padding="12,10">
  161. <Grid ColumnDefinitions="Auto,*">
  162. <Border Width="24" Height="24" CornerRadius="6"
  163. Background="#4CAF50"
  164. VerticalAlignment="Center">
  165. <PathIcon Width="14" Height="14"
  166. Data="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"
  167. Foreground="White"
  168. HorizontalAlignment="Center"
  169. VerticalAlignment="Center"/>
  170. </Border>
  171. <TextBlock Grid.Column="1"
  172. Text="Walk or bike to work"
  173. FontSize="14"
  174. Foreground="#90A4AE"
  175. Margin="10,0,0,0"
  176. VerticalAlignment="Center"
  177. TextDecorations="Strikethrough"/>
  178. </Grid>
  179. </Border>
  180. <!-- Task 3: completed -->
  181. <Border CornerRadius="10" Background="White" Padding="12,10">
  182. <Grid ColumnDefinitions="Auto,*">
  183. <Border Width="24" Height="24" CornerRadius="6"
  184. Background="#4CAF50"
  185. VerticalAlignment="Center">
  186. <PathIcon Width="14" Height="14"
  187. Data="M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"
  188. Foreground="White"
  189. HorizontalAlignment="Center"
  190. VerticalAlignment="Center"/>
  191. </Border>
  192. <TextBlock Grid.Column="1"
  193. Text="Meatless meal"
  194. FontSize="14"
  195. Foreground="#90A4AE"
  196. Margin="10,0,0,0"
  197. VerticalAlignment="Center"
  198. TextDecorations="Strikethrough"/>
  199. </Grid>
  200. </Border>
  201. <!-- Task 4: not completed -->
  202. <Border CornerRadius="10" Background="White" Padding="12,10">
  203. <Grid ColumnDefinitions="Auto,*">
  204. <Border Width="24" Height="24" CornerRadius="6"
  205. Background="#E0E0E0"
  206. VerticalAlignment="Center"/>
  207. <TextBlock Grid.Column="1"
  208. Text="30-min shorter shower"
  209. FontSize="14"
  210. Foreground="#1A2E1C"
  211. Margin="10,0,0,0"
  212. VerticalAlignment="Center"/>
  213. </Grid>
  214. </Border>
  215. <!-- Task 5: not completed -->
  216. <Border CornerRadius="10" Background="White" Padding="12,10">
  217. <Grid ColumnDefinitions="Auto,*">
  218. <Border Width="24" Height="24" CornerRadius="6"
  219. Background="#E0E0E0"
  220. VerticalAlignment="Center"/>
  221. <TextBlock Grid.Column="1"
  222. Text="Sort recycling"
  223. FontSize="14"
  224. Foreground="#1A2E1C"
  225. Margin="10,0,0,0"
  226. VerticalAlignment="Center"/>
  227. </Grid>
  228. </Border>
  229. </StackPanel>
  230. </StackPanel>
  231. </ScrollViewer>
  232. </UserControl>