Important feature

This commit is contained in:
pizzaboxer 2024-10-10 23:41:20 +01:00
parent 43921a6ddf
commit d10b4fdfd0
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
4 changed files with 44 additions and 4 deletions

View File

@ -20,6 +20,7 @@
<Resource Include="Resources\Fonts\Rubik-VariableFont_wght.ttf" /> <Resource Include="Resources\Fonts\Rubik-VariableFont_wght.ttf" />
<Resource Include="Resources\BootstrapperStyles\ByfronDialog\ByfronLogoDark.jpg" /> <Resource Include="Resources\BootstrapperStyles\ByfronDialog\ByfronLogoDark.jpg" />
<Resource Include="Resources\BootstrapperStyles\ByfronDialog\ByfronLogoLight.jpg" /> <Resource Include="Resources\BootstrapperStyles\ByfronDialog\ByfronLogoLight.jpg" />
<Resource Include="Resources\BootstrapperStyles\ByfronDialog\Matt.png" />
<Resource Include="Resources\MessageBox\Error.png" /> <Resource Include="Resources\MessageBox\Error.png" />
<Resource Include="Resources\MessageBox\Information.png" /> <Resource Include="Resources\MessageBox\Information.png" />
<Resource Include="Resources\MessageBox\Question.png" /> <Resource Include="Resources\MessageBox\Question.png" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 KiB

View File

@ -12,12 +12,17 @@
d:DesignHeight="1500" d:DesignWidth="800" d:DesignHeight="1500" d:DesignWidth="800"
d:DataContext="{d:DesignInstance dmodels:AboutViewModel, IsDesignTimeCreatable=True}" d:DataContext="{d:DesignInstance dmodels:AboutViewModel, IsDesignTimeCreatable=True}"
Title="AboutPage" Title="AboutPage"
KeyDown="UiPage_KeyDown"
Scrollable="True"> Scrollable="True">
<ui:UiPage.Resources>
<Storyboard x:Key="EggStoryboard">
<DoubleAnimation Storyboard.TargetName="Image1" Storyboard.TargetProperty="Opacity" From="1.0" To="0.0" Duration="0:0:3" />
<DoubleAnimation Storyboard.TargetName="Image2" Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:3" />
</Storyboard>
</ui:UiPage.Resources>
<StackPanel Margin="0,0,14,14"> <StackPanel Margin="0,0,14,14">
<StackPanel.Resources>
<FrameworkElement x:Key="ProxyElement" DataContext="{Binding}"/>
</StackPanel.Resources>
<Grid Margin="0,0,0,24" HorizontalAlignment="Center"> <Grid Margin="0,0,0,24" HorizontalAlignment="Center">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@ -25,7 +30,9 @@
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Image Grid.Column="0" Width="72" Height="72" VerticalAlignment="Center" Source="pack://application:,,,/Bloxstrap.ico" RenderOptions.BitmapScalingMode="HighQuality" /> <Image x:Name="Image1" Grid.Column="0" Width="72" Height="72" VerticalAlignment="Center" Source="pack://application:,,,/Bloxstrap.ico" RenderOptions.BitmapScalingMode="HighQuality" />
<Image x:Name="Image2" Grid.Column="0" Width="72" Height="72" VerticalAlignment="Center" Source="pack://application:,,,/Resources/BootstrapperStyles/ByfronDialog/Matt.png" RenderOptions.BitmapScalingMode="HighQuality" Opacity="0" />
<StackPanel Grid.Column="1" Margin="12,0,0,0" VerticalAlignment="Center"> <StackPanel Grid.Column="1" Margin="12,0,0,0" VerticalAlignment="Center">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>

View File

@ -1,5 +1,8 @@
using Bloxstrap.UI.ViewModels.About; using Bloxstrap.UI.ViewModels.About;
using System.Windows.Input;
using System.Windows.Media.Animation;
namespace Bloxstrap.UI.Elements.About.Pages namespace Bloxstrap.UI.Elements.About.Pages
{ {
/// <summary> /// <summary>
@ -7,10 +10,39 @@ namespace Bloxstrap.UI.Elements.About.Pages
/// </summary> /// </summary>
public partial class AboutPage public partial class AboutPage
{ {
private readonly Queue<Key> _keys = new();
private readonly List<Key> _expectedKeys = new() { Key.M, Key.A, Key.T, Key.T, Key.LeftShift, Key.D1 };
private bool _triggered = false;
public AboutPage() public AboutPage()
{ {
DataContext = new AboutViewModel(); DataContext = new AboutViewModel();
InitializeComponent(); InitializeComponent();
} }
private void UiPage_KeyDown(object sender, KeyEventArgs e)
{
if (_triggered)
return;
if (_keys.Count >= 6)
_keys.Dequeue();
var key = e.Key;
if (key == Key.RightShift)
key = Key.LeftShift;
_keys.Enqueue(key);
if (_keys.SequenceEqual(_expectedKeys))
{
_triggered = true;
var storyboard = Resources["EggStoryboard"] as Storyboard;
storyboard!.Begin();
}
}
} }
} }