mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-22 02:21:27 -07:00
49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
using Bloxstrap.UI.ViewModels.About;
|
|
|
|
using System.Windows.Input;
|
|
using System.Windows.Media.Animation;
|
|
|
|
namespace Bloxstrap.UI.Elements.About.Pages
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for AboutPage.xaml
|
|
/// </summary>
|
|
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()
|
|
{
|
|
DataContext = new AboutViewModel();
|
|
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();
|
|
}
|
|
}
|
|
}
|
|
}
|