Skip to content

Commit

Permalink
优化上下课通知动画掉帧情况
Browse files Browse the repository at this point in the history
  • Loading branch information
STBBRD committed Nov 2, 2024
1 parent 94cf9ac commit bc5abc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
4 changes: 0 additions & 4 deletions ZongziTEK_Blackboard_Sticker/Helpers/WindowsHelper.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Interop;

Expand Down
12 changes: 6 additions & 6 deletions ZongziTEK_Blackboard_Sticker/TimetableNotificationWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private void Timer_Tick(object sender, EventArgs e)
timeLeft = timeToHide - DateTime.Now.TimeOfDay;
TextTime.Text = timeLeft.TotalSeconds.ToString("00");

if (timeLeft.TotalSeconds <= 1)
if (timeLeft.TotalSeconds <= 2)
{
if (!isTimeHidden)
HideTime();
Expand Down Expand Up @@ -133,13 +133,13 @@ private async void HideNotification()
{
isNotificationHidden = true;

DoubleAnimation opacityAnimation = new()
/*DoubleAnimation opacityAnimation = new()
{
From = 1,
To = 0,
Duration = TimeSpan.FromMilliseconds(750),
Duration = TimeSpan.FromMilliseconds(500),
EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseIn }
};
};*/

/*ThicknessAnimation marginAnimation = new()
{
Expand All @@ -153,11 +153,11 @@ private async void HideNotification()
{
From = 0,
To = -Height,
Duration = TimeSpan.FromMilliseconds(750),
Duration = TimeSpan.FromMilliseconds(500),
EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseIn }
};

GridNotification.BeginAnimation(OpacityProperty, opacityAnimation);
//GridNotification.BeginAnimation(OpacityProperty, opacityAnimation);
//GridNotification.BeginAnimation(MarginProperty, marginAnimation);
BeginAnimation(TopProperty, topAnimation);

Expand Down

0 comments on commit bc5abc6

Please sign in to comment.