248 lines
16 KiB
XML
248 lines
16 KiB
XML
<UserControl x:Class="UtopiaCanteenSystem.Views.MainDashboardView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
<UserControl.Resources>
|
|
<SolidColorBrush x:Key="PrimaryTextBrush" Color="#1a2e35"/>
|
|
<SolidColorBrush x:Key="MutedTextBrush" Color="#718096"/>
|
|
<SolidColorBrush x:Key="AccentBrush" Color="#5BA3A0"/>
|
|
|
|
<Style x:Key="StatusBorderStyle" TargetType="Border">
|
|
<Setter Property="Background" Value="#dcfce7"/>
|
|
<Setter Property="BorderBrush" Value="#86efac"/>
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
<Setter Property="CornerRadius" Value="8"/>
|
|
<Setter Property="Padding" Value="20"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsSuccess}" Value="False">
|
|
<Setter Property="Background" Value="#fee2e2"/>
|
|
<Setter Property="BorderBrush" Value="#fca5a5"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<Style x:Key="StatusTextStyle" TargetType="TextBlock">
|
|
<Setter Property="Foreground" Value="#22c55e"/>
|
|
<Setter Property="FontSize" Value="16"/>
|
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsSuccess}" Value="False">
|
|
<Setter Property="Foreground" Value="#ef4444"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<Style x:Key="StatusIconStyle" TargetType="TextBlock">
|
|
<Setter Property="Text" Value="✔"/>
|
|
<Setter Property="Foreground" Value="#22c55e"/>
|
|
<Setter Property="FontSize" Value="18"/>
|
|
<Setter Property="FontWeight" Value="Bold"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsSuccess}" Value="False">
|
|
<Setter Property="Text" Value="✖"/>
|
|
<Setter Property="Foreground" Value="#ef4444"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
<Style x:Key="RoundedButtonBase" TargetType="Button">
|
|
<Setter Property="MinHeight" Value="50"/>
|
|
<Setter Property="FontSize" Value="18"/>
|
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
<Setter Property="Padding" Value="24,12"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
CornerRadius="8">
|
|
<ContentPresenter HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"/>
|
|
</Border>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="SecondaryButtonStyle" TargetType="Button" BasedOn="{StaticResource RoundedButtonBase}">
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="BorderBrush" Value="#e2e8f0"/>
|
|
<Setter Property="Foreground" Value="#1a2e35"/>
|
|
</Style>
|
|
|
|
<Style x:Key="SettingsButtonStyle" TargetType="Button" BasedOn="{StaticResource RoundedButtonBase}">
|
|
<Setter Property="Background" Value="#f4f7f7"/>
|
|
<Setter Property="BorderBrush" Value="#e2e8f0"/>
|
|
<Setter Property="Foreground" Value="#1a2e35"/>
|
|
</Style>
|
|
</UserControl.Resources>
|
|
|
|
<Grid Background="#F0F2F5">
|
|
<ScrollViewer VerticalScrollBarVisibility="Auto"
|
|
HorizontalScrollBarVisibility="Disabled"
|
|
Padding="40">
|
|
<Border HorizontalAlignment="Center"
|
|
VerticalAlignment="Top"
|
|
Width="{Binding RelativeSource={RelativeSource AncestorType=ScrollViewer}, Path=ViewportWidth}"
|
|
MaxWidth="1400"
|
|
Padding="40"
|
|
Background="White"
|
|
CornerRadius="12">
|
|
<Border.Effect>
|
|
<DropShadowEffect BlurRadius="24" Opacity="0.08" ShadowDepth="4"/>
|
|
</Border.Effect>
|
|
|
|
<StackPanel>
|
|
<Border Padding="24" BorderThickness="0,0,0,1" BorderBrush="#e2e8f0" Margin="0,0,0,16">
|
|
<StackPanel>
|
|
<TextBlock Text="Utopia Canteen System"
|
|
FontSize="32"
|
|
FontWeight="Bold"
|
|
Foreground="{StaticResource PrimaryTextBrush}"/>
|
|
<TextBlock Text="Dashboard"
|
|
FontSize="18"
|
|
Foreground="{StaticResource MutedTextBrush}"
|
|
Margin="0,6,0,0"/>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<StackPanel Margin="24,0,24,24">
|
|
<Border Background="#f4f7f7" CornerRadius="8" Padding="24" Margin="0,0,0,16">
|
|
<StackPanel HorizontalAlignment="Center">
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,10">
|
|
<Canvas Width="40" Height="40">
|
|
<Rectangle Width="3" Height="30" Fill="{StaticResource AccentBrush}" Canvas.Left="2" Canvas.Top="5"/>
|
|
<Rectangle Width="2" Height="30" Fill="{StaticResource AccentBrush}" Canvas.Left="8" Canvas.Top="5"/>
|
|
<Rectangle Width="5" Height="30" Fill="{StaticResource AccentBrush}" Canvas.Left="13" Canvas.Top="5"/>
|
|
<Rectangle Width="2" Height="30" Fill="{StaticResource AccentBrush}" Canvas.Left="20" Canvas.Top="5"/>
|
|
<Rectangle Width="6" Height="30" Fill="{StaticResource AccentBrush}" Canvas.Left="25" Canvas.Top="5"/>
|
|
<Rectangle Width="3" Height="30" Fill="{StaticResource AccentBrush}" Canvas.Left="33" Canvas.Top="5"/>
|
|
</Canvas>
|
|
<TextBlock Text="{Binding ScanCount}"
|
|
FontSize="56"
|
|
FontWeight="Bold"
|
|
Foreground="{StaticResource PrimaryTextBrush}"
|
|
Margin="12,0,0,0"
|
|
VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
<TextBlock Text="Today's Scans"
|
|
FontSize="18"
|
|
Foreground="{StaticResource MutedTextBrush}"
|
|
HorizontalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<Border BorderBrush="#e2e8f0" BorderThickness="1" CornerRadius="8" Margin="0,0,0,16">
|
|
<StackPanel>
|
|
<Border Padding="16" BorderBrush="#e2e8f0" BorderThickness="0,0,0,1">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Border Width="40" Height="40" Background="#f4f7f7" CornerRadius="6" VerticalAlignment="Center">
|
|
<Viewbox Margin="6">
|
|
<Canvas Width="28" Height="28">
|
|
<Rectangle Width="3" Height="20" Fill="{StaticResource AccentBrush}" Canvas.Left="2" Canvas.Top="4"/>
|
|
<Rectangle Width="2" Height="20" Fill="{StaticResource AccentBrush}" Canvas.Left="7" Canvas.Top="4"/>
|
|
<Rectangle Width="4" Height="20" Fill="{StaticResource AccentBrush}" Canvas.Left="11" Canvas.Top="4"/>
|
|
<Rectangle Width="2" Height="20" Fill="{StaticResource AccentBrush}" Canvas.Left="17" Canvas.Top="4"/>
|
|
<Rectangle Width="4" Height="20" Fill="{StaticResource AccentBrush}" Canvas.Left="22" Canvas.Top="4"/>
|
|
</Canvas>
|
|
</Viewbox>
|
|
</Border>
|
|
<StackPanel Grid.Column="1" Margin="12,0,0,0">
|
|
<TextBlock Text="LAST CARD ID"
|
|
FontSize="12"
|
|
Foreground="{StaticResource MutedTextBrush}"
|
|
FontWeight="SemiBold"/>
|
|
<TextBlock Text="{Binding LastCardId}"
|
|
FontSize="20"
|
|
FontWeight="SemiBold"
|
|
FontFamily="Consolas"
|
|
Foreground="{StaticResource PrimaryTextBrush}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<Border Padding="16">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Border Width="40" Height="40" Background="#f4f7f7" CornerRadius="6" VerticalAlignment="Center">
|
|
<Viewbox Margin="6">
|
|
<Canvas Width="28" Height="28">
|
|
<Ellipse Width="28" Height="28" Stroke="{StaticResource AccentBrush}" StrokeThickness="2"/>
|
|
<Line X1="14" Y1="14" X2="14" Y2="7" Stroke="{StaticResource AccentBrush}" StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round"/>
|
|
<Line X1="14" Y1="14" X2="20" Y2="14" Stroke="{StaticResource AccentBrush}" StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round"/>
|
|
</Canvas>
|
|
</Viewbox>
|
|
</Border>
|
|
<StackPanel Grid.Column="1" Margin="12,0,0,0">
|
|
<TextBlock Text="LAST SCAN TIME"
|
|
FontSize="12"
|
|
Foreground="{StaticResource MutedTextBrush}"
|
|
FontWeight="SemiBold"/>
|
|
<TextBlock Text="{Binding LastScanTime}"
|
|
FontSize="20"
|
|
FontWeight="SemiBold"
|
|
Foreground="{StaticResource PrimaryTextBrush}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<Border Style="{StaticResource StatusBorderStyle}" Margin="0,0,0,16">
|
|
<StackPanel Orientation="Horizontal">
|
|
<Border Width="24" Height="24" CornerRadius="12" BorderThickness="2" Margin="0,0,12,0">
|
|
<Border.Style>
|
|
<Style TargetType="Border">
|
|
<Setter Property="BorderBrush" Value="#22c55e"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsSuccess}" Value="False">
|
|
<Setter Property="BorderBrush" Value="#ef4444"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Border.Style>
|
|
<TextBlock Style="{StaticResource StatusIconStyle}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
</Border>
|
|
<TextBlock Text="{Binding StatusMessage}" Style="{StaticResource StatusTextStyle}" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Border>
|
|
|
|
<TextBlock Text="{Binding CurrentTime}"
|
|
FontSize="16"
|
|
Foreground="{StaticResource MutedTextBrush}"
|
|
HorizontalAlignment="Center"
|
|
Margin="0,0,0,16"/>
|
|
|
|
<WrapPanel HorizontalAlignment="Center">
|
|
<Button Command="{Binding BackToLoginCommand}" Style="{StaticResource SecondaryButtonStyle}" Margin="0,0,16,0">
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
<TextBlock Text="←" FontSize="18" Margin="0,0,10,0" VerticalAlignment="Center"/>
|
|
<TextBlock Text="Back to Scanner" FontSize="18" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Button>
|
|
<Button Command="{Binding GoToSettingsCommand}"
|
|
Style="{StaticResource SettingsButtonStyle}"
|
|
Visibility="Visible">
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
<TextBlock Text="⚙" FontSize="18" Margin="0,0,10,0" VerticalAlignment="Center"/>
|
|
<TextBlock Text="Settings" FontSize="18" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Button>
|
|
</WrapPanel>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Border>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
|
|
</UserControl>
|