330 lines
20 KiB
XML
330 lines
20 KiB
XML
<Window x:Class="Raton.Windows.Games"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
Title="Games" Height="560" Width="840" WindowStartupLocation="CenterScreen" Background="#1C1C1C"
|
|
WindowStyle="SingleBorderWindow" AllowsTransparency="false" ResizeMode="CanMinimize"
|
|
FontFamily="Segoe UI">
|
|
<FrameworkElement.Resources>
|
|
<SolidColorBrush x:Key="BgMain" Color="#1C1C1C"/>
|
|
<SolidColorBrush x:Key="BgPanel" Color="#202020"/>
|
|
<SolidColorBrush x:Key="Accent" Color="#5C4B8A"/>
|
|
<SolidColorBrush x:Key="AccentLight" Color="#7B5EA7"/>
|
|
<SolidColorBrush x:Key="AccentDim" Color="#2A2035"/>
|
|
<SolidColorBrush x:Key="Border1" Color="#2A2A2A"/>
|
|
<SolidColorBrush x:Key="Border2" Color="#383838"/>
|
|
<SolidColorBrush x:Key="TextPrimary" Color="#DDDDDD"/>
|
|
<SolidColorBrush x:Key="TextSecondary" Color="#888888"/>
|
|
<SolidColorBrush x:Key="TextMuted" Color="#555555"/>
|
|
<SolidColorBrush x:Key="Green" Color="#4CAF50"/>
|
|
<SolidColorBrush x:Key="Red" Color="#EF5350"/>
|
|
<Style x:Key="TabBtn" TargetType="{x:Type Button}">
|
|
<Setter Property="Control.Background" Value="Transparent"/>
|
|
<Setter Property="Control.Foreground" Value="{StaticResource TextSecondary}"/>
|
|
<Setter Property="Control.BorderThickness" Value="0"/>
|
|
<Setter Property="Control.Padding" Value="16,0"/>
|
|
<Setter Property="Control.FontSize" Value="12.5"/>
|
|
<Setter Property="FrameworkElement.Height" Value="42"/>
|
|
<Setter Property="FrameworkElement.Cursor" Value="Hand"/>
|
|
<Setter Property="Control.Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
<Grid>
|
|
<Border x:Name="bg" Background="{TemplateBinding Control.Background}" CornerRadius="4"/>
|
|
<Border x:Name="indicator" Height="2" VerticalAlignment="Bottom" Background="Transparent"
|
|
CornerRadius="2,2,0,0" Margin="10,0"/>
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="{TemplateBinding Control.Padding}"/>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="UIElement.IsMouseOver" Value="true">
|
|
<Setter TargetName="bg" Property="Border.Background" Value="#252525"/>
|
|
<Setter Value="{StaticResource TextPrimary}" Property="Control.Foreground"/>
|
|
</Trigger>
|
|
<Trigger Property="ButtonBase.IsPressed" Value="true">
|
|
<Setter TargetName="bg" Property="Border.Background" Value="#2E2E2E"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="TabBtnActive" TargetType="{x:Type Button}">
|
|
<Setter Property="Control.Background" Value="#252525"/>
|
|
<Setter Property="Control.Foreground" Value="{StaticResource TextPrimary}"/>
|
|
<Setter Property="Control.BorderThickness" Value="0"/>
|
|
<Setter Property="Control.Padding" Value="16,0"/>
|
|
<Setter Property="Control.FontSize" Value="12.5"/>
|
|
<Setter Property="Control.FontWeight" Value="SemiBold"/>
|
|
<Setter Property="FrameworkElement.Height" Value="42"/>
|
|
<Setter Property="FrameworkElement.Cursor" Value="Hand"/>
|
|
<Setter Property="Control.Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
<Grid>
|
|
<Border x:Name="bg" Background="{TemplateBinding Control.Background}" CornerRadius="4"/>
|
|
<Border x:Name="indicator" Height="2" VerticalAlignment="Bottom" Background="{StaticResource Accent}"
|
|
CornerRadius="2,2,0,0" Margin="10,0"/>
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="{TemplateBinding Control.Padding}"/>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="UIElement.IsMouseOver" Value="true">
|
|
<Setter TargetName="bg" Property="Border.Background" Value="#2E2E2E"/>
|
|
</Trigger>
|
|
<Trigger Property="ButtonBase.IsPressed" Value="true">
|
|
<Setter TargetName="bg" Property="Border.Background" Value="#333333"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="ActionBtn" TargetType="{x:Type Button}">
|
|
<Setter Property="Control.Background" Value="{StaticResource Accent}"/>
|
|
<Setter Property="Control.Foreground" Value="White"/>
|
|
<Setter Property="Control.BorderThickness" Value="0"/>
|
|
<Setter Property="FrameworkElement.Height" Value="26"/>
|
|
<Setter Property="Control.Padding" Value="13,0"/>
|
|
<Setter Property="Control.FontSize" Value="11.5"/>
|
|
<Setter Property="FrameworkElement.Cursor" Value="Hand"/>
|
|
<Setter Property="Control.Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
<Border x:Name="bd" Background="{TemplateBinding Control.Background}" CornerRadius="5"
|
|
Padding="{TemplateBinding Control.Padding}">
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="UIElement.IsMouseOver" Value="true">
|
|
<Setter TargetName="bd" Value="{StaticResource AccentLight}" Property="Border.Background"/>
|
|
</Trigger>
|
|
<Trigger Property="ButtonBase.IsPressed" Value="true">
|
|
<Setter TargetName="bd" Property="Border.Background" Value="#3E2A6A"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="SwatchBtn" TargetType="{x:Type Button}">
|
|
<Setter Property="FrameworkElement.Width" Value="22"/>
|
|
<Setter Property="FrameworkElement.Height" Value="22"/>
|
|
<Setter Property="Control.BorderThickness" Value="2"/>
|
|
<Setter Property="Control.BorderBrush" Value="Transparent"/>
|
|
<Setter Property="FrameworkElement.Cursor" Value="Hand"/>
|
|
<Setter Property="Control.Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Button}">
|
|
<Border x:Name="bd" Background="{TemplateBinding Control.Background}"
|
|
BorderBrush="{TemplateBinding Control.BorderBrush}"
|
|
BorderThickness="{TemplateBinding Control.BorderThickness}" CornerRadius="5"/>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="UIElement.IsMouseOver" Value="true">
|
|
<Setter TargetName="bd" Value="{StaticResource AccentLight}" Property="Border.BorderBrush"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</FrameworkElement.Resources>
|
|
<Grid Background="{StaticResource BgMain}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="46"/>
|
|
<RowDefinition Height="1"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="26"/>
|
|
</Grid.RowDefinitions>
|
|
<Border Grid.Row="0" Background="{StaticResource BgPanel}" BorderBrush="{StaticResource Border1}"
|
|
BorderThickness="0,0,0,0" Padding="8,0">
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
<Button Click="Nav_Snake" x:Name="BtnSnake" Style="{StaticResource TabBtnActive}">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="🐍" FontSize="13" VerticalAlignment="Center"/>
|
|
<TextBlock Text=" Snake" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Button>
|
|
<Button Click="Nav_Paint" x:Name="BtnPaint" Style="{StaticResource TabBtn}" Margin="2,0,0,0">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="🎨" FontSize="13" VerticalAlignment="Center"/>
|
|
<TextBlock Text=" Paint" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Button>
|
|
<Button Click="Nav_Minesweeper" x:Name="BtnMine" Style="{StaticResource TabBtn}" Margin="2,0,0,0">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="💣" FontSize="13" VerticalAlignment="Center"/>
|
|
<TextBlock Text=" Minesweeper" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Button>
|
|
<Button Click="Nav_Flappy" x:Name="BtnFlappy" Style="{StaticResource TabBtn}" Margin="2,0,0,0">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="🐀 " FontSize="13" VerticalAlignment="Center"/>
|
|
<TextBlock Text=" Flappy rat" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</Button>
|
|
</StackPanel>
|
|
</Border>
|
|
<Border Grid.Row="1">
|
|
<Border.Background>
|
|
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
|
|
<GradientStop Color="#5C4B8A" Offset="0.0"/>
|
|
<GradientStop Color="#2A2A2A" Offset="0.45"/>
|
|
<GradientStop Color="#1C1C1C" Offset="1.0"/>
|
|
</LinearGradientBrush>
|
|
</Border.Background>
|
|
</Border>
|
|
<Grid x:Name="PanelSnake" Row="2" Background="{StaticResource BgMain}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="36"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Border Grid.Row="0" Background="{StaticResource BgPanel}" BorderBrush="{StaticResource Border1}"
|
|
BorderThickness="0,0,0,1" Padding="14,0">
|
|
<Grid VerticalAlignment="Center">
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
<TextBlock Text="SCORE" Foreground="{StaticResource TextMuted}" FontSize="10" FontWeight="SemiBold"
|
|
VerticalAlignment="Center" Margin="0,0,8,0"/>
|
|
<TextBlock x:Name="SnakeScoreTxt" Text="0" Foreground="{StaticResource AccentLight}" FontSize="14"
|
|
FontWeight="Bold" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
|
|
<TextBlock x:Name="SnakeStatusTxt" Text="Press SPACE to start" Foreground="{StaticResource TextSecondary}"
|
|
FontSize="11.5" VerticalAlignment="Center" Margin="0,0,10,0"/>
|
|
<Button Click="SnakeRestart" Style="{StaticResource ActionBtn}" Content="↺ New game "/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
<Border Grid.Row="1" Margin="12" Background="{StaticResource BgPanel}"
|
|
BorderBrush="{StaticResource Border1}" BorderThickness="1" CornerRadius="6" ClipToBounds="true">
|
|
<Canvas KeyDown="SnakeCanvas_KeyDown" x:Name="SnakeCanvas" Focusable="true" Background="Transparent"/>
|
|
</Border>
|
|
</Grid>
|
|
<Grid x:Name="PanelPaint" Row="2" Background="{StaticResource BgMain}" Visibility="Collapsed">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="44"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Border Grid.Row="0" Background="{StaticResource BgPanel}" BorderBrush="{StaticResource Border1}"
|
|
BorderThickness="0,0,0,1" Padding="10,0">
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
<Button Click="PaintColor_Click" Style="{StaticResource SwatchBtn}" Background="#DDDDDD" Tag="#DDDDDD"/>
|
|
<Button Click="PaintColor_Click" Style="{StaticResource SwatchBtn}" Background="#EF5350" Tag="#EF5350"
|
|
Margin="3,0,0,0"/>
|
|
<Button Click="PaintColor_Click" Style="{StaticResource SwatchBtn}" Background="#4CAF50" Tag="#4CAF50"
|
|
Margin="3,0,0,0"/>
|
|
<Button Click="PaintColor_Click" Style="{StaticResource SwatchBtn}" Background="#64B5F6" Tag="#64B5F6"
|
|
Margin="3,0,0,0"/>
|
|
<Button Click="PaintColor_Click" Style="{StaticResource SwatchBtn}" Background="#FFB74D" Tag="#FFB74D"
|
|
Margin="3,0,0,0"/>
|
|
<Button Click="PaintColor_Click" Style="{StaticResource SwatchBtn}" Background="#CE93D8" Tag="#CE93D8"
|
|
Margin="3,0,0,0"/>
|
|
<Button Click="PaintColor_Click" Style="{StaticResource SwatchBtn}" Background="#7B5EA7" Tag="#7B5EA7"
|
|
Margin="3,0,0,0"/>
|
|
<Button Click="PaintColor_Click" Style="{StaticResource SwatchBtn}" Background="#1C1C1C" Tag="#1C1C1C"
|
|
Margin="3,0,0,0" BorderBrush="{StaticResource Border2}" BorderThickness="2"/>
|
|
<Rectangle Width="1" Fill="{StaticResource Border2}" Margin="10,6"/>
|
|
<TextBlock Text="SIZE" Foreground="{StaticResource TextMuted}" FontSize="10" FontWeight="SemiBold"
|
|
VerticalAlignment="Center" Margin="0,0,7,0"/>
|
|
<Slider ValueChanged="BrushSlider_Changed" x:Name="BrushSlider" Minimum="2" Maximum="50" Value="12"
|
|
Width="80" VerticalAlignment="Center">
|
|
<FrameworkElement.Resources>
|
|
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#5C4B8A"/>
|
|
</FrameworkElement.Resources>
|
|
</Slider>
|
|
<Rectangle Width="1" Fill="{StaticResource Border2}" Margin="10,6"/>
|
|
<Button Click="PaintEraser_Click" x:Name="BtnEraser" Style="{StaticResource TabBtn}" Height="26"
|
|
Padding="10,0" FontSize="11.5" Content="⌫ Eraser"/>
|
|
<Button Click="PaintClear_Click" Style="{StaticResource ActionBtn}" Content="🗑 Clear" Margin="5,0,0,0"/>
|
|
<Rectangle Width="1" Fill="{StaticResource Border2}" Margin="10,6"/>
|
|
<Border x:Name="ColorPreview" Width="22" Height="22" CornerRadius="11" Background="#DDDDDD"
|
|
BorderBrush="{StaticResource Accent}" BorderThickness="2"/>
|
|
</StackPanel>
|
|
</Border>
|
|
<Border Grid.Row="1" Margin="12" Background="White" BorderBrush="{StaticResource Border1}"
|
|
BorderThickness="1" CornerRadius="6" ClipToBounds="true">
|
|
<Canvas MouseDown="PaintCanvas_MouseDown" MouseMove="PaintCanvas_MouseMove" MouseUp="PaintCanvas_MouseUp"
|
|
x:Name="PaintCanvas" Background="White" Cursor="Cross"/>
|
|
</Border>
|
|
</Grid>
|
|
<Grid x:Name="PanelMine" Row="2" Background="{StaticResource BgMain}" Visibility="Collapsed">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="36"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Border Grid.Row="0" Background="{StaticResource BgPanel}" BorderBrush="{StaticResource Border1}"
|
|
BorderThickness="0,0,0,1" Padding="14,0">
|
|
<Grid VerticalAlignment="Center">
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
<TextBlock Text="MINES" Foreground="{StaticResource TextMuted}" FontSize="10" FontWeight="SemiBold"
|
|
VerticalAlignment="Center" Margin="0,0,8,0"/>
|
|
<TextBlock x:Name="MineCountTxt" Text="10" Foreground="{StaticResource Red}" FontSize="14" FontWeight="Bold"
|
|
VerticalAlignment="Center"/>
|
|
<TextBlock Text=" · " Foreground="{StaticResource TextMuted}" FontSize="12" VerticalAlignment="Center"/>
|
|
<TextBlock Text="TIME" Foreground="{StaticResource TextMuted}" FontSize="10" FontWeight="SemiBold"
|
|
VerticalAlignment="Center" Margin="0,0,8,0"/>
|
|
<TextBlock x:Name="MineTimerTxt" Text="0s" Foreground="{StaticResource TextSecondary}" FontSize="14"
|
|
FontWeight="Bold" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
|
|
<TextBlock x:Name="MineStatusTxt" Text="Left-click reveal · Right-click flag"
|
|
Foreground="{StaticResource TextSecondary}" FontSize="11.5" VerticalAlignment="Center"
|
|
Margin="0,0,10,0"/>
|
|
<Button Click="MineRestart" Style="{StaticResource ActionBtn}" Content="↺ New Game"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
|
|
Background="{StaticResource BgMain}">
|
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
|
|
<Border x:Name="MineOverlay" Visibility="Collapsed" Background="{StaticResource AccentDim}"
|
|
BorderBrush="{StaticResource Accent}" BorderThickness="1" CornerRadius="6" Padding="18,9"
|
|
Margin="0,0,0,12" HorizontalAlignment="Center">
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock x:Name="MineOverlayIcon" Text="" FontSize="18" VerticalAlignment="Center"/>
|
|
<TextBlock x:Name="MineOverlayTxt" Text="BOOM!" Foreground="{StaticResource TextPrimary}" FontSize="14"
|
|
FontWeight="SemiBold" VerticalAlignment="Center" Margin="9,0,0,0"/>
|
|
</StackPanel>
|
|
</Border>
|
|
<UniformGrid x:Name="MineGridCtrl" Rows="9" Columns="9"/>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
<Grid x:Name="PanelFlappy" Row="2" Background="{StaticResource BgMain}" Visibility="Collapsed">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="36"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Border Grid.Row="0" Background="{StaticResource BgPanel}" BorderBrush="{StaticResource Border1}"
|
|
BorderThickness="0,0,0,1" Padding="14,0">
|
|
<Grid VerticalAlignment="Center">
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
|
<TextBlock Text="SCORE" Foreground="{StaticResource TextMuted}" FontSize="10" FontWeight="SemiBold"
|
|
VerticalAlignment="Center" Margin="0,0,8,0"/>
|
|
<TextBlock x:Name="FlappyScoreTxt" Text="0" Foreground="{StaticResource AccentLight}" FontSize="14"
|
|
FontWeight="Bold" VerticalAlignment="Center"/>
|
|
<TextBlock Text=" · BEST" Foreground="{StaticResource TextMuted}" FontSize="10" FontWeight="SemiBold"
|
|
VerticalAlignment="Center" Margin="0,0,8,0"/>
|
|
<TextBlock x:Name="FlappyBestTxt" Text="0" Foreground="{StaticResource Green}" FontSize="14" FontWeight="Bold"
|
|
VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
|
|
<TextBlock x:Name="FlappyStatusTxt" Text="SPACE / Click to flap" Foreground="{StaticResource TextSecondary}"
|
|
FontSize="11.5" VerticalAlignment="Center" Margin="0,0,10,0"/>
|
|
<Button Click="FlappyRestart" Style="{StaticResource ActionBtn}" Content="↺ Restart"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
<Border Grid.Row="1" Margin="12" Background="#0A0A0A" BorderBrush="{StaticResource Border1}"
|
|
BorderThickness="1" CornerRadius="6" ClipToBounds="true">
|
|
<Canvas KeyDown="FlappyCanvas_KeyDown" MouseDown="FlappyCanvas_MouseDown" x:Name="FlappyCanvas"
|
|
Focusable="true" Background="Transparent"/>
|
|
</Border>
|
|
</Grid>
|
|
<Border Grid.Row="3" Background="{StaticResource BgPanel}" BorderBrush="{StaticResource Border1}"
|
|
BorderThickness="0,1,0,0" Padding="14,0">
|
|
<Grid VerticalAlignment="Center">
|
|
<TextBlock x:Name="StatusBarLeft" Text="Ready" Foreground="{StaticResource TextMuted}" FontSize="11"/>
|
|
</Grid>
|
|
</Border>
|
|
</Grid>
|
|
</Window> |