Merge branch 'dev' of http://8.153.108.90:3000/YD/Wpf_AiSportsMicrospace into dev
This commit is contained in:
commit
512933f650
@ -9,14 +9,14 @@
|
||||
|
||||
>
|
||||
<Grid>
|
||||
<Grid x:Name="great" Visibility="Hidden" HorizontalAlignment="Left" Height="172" Width="221" VerticalAlignment="Bottom" Margin="-110,0,0,0" >
|
||||
<Grid x:Name="great" Visibility="Hidden" Panel.ZIndex="1000" HorizontalAlignment="Left" Height="172" Width="221" VerticalAlignment="Bottom" Margin="-105,0,0,0" >
|
||||
<Image Source="/Resources/Img/play_img/music_rope/great.png" HorizontalAlignment="Right" Width="90" VerticalAlignment="Top" Margin="0,0,0,0"/>
|
||||
<Image Source="/Resources/Img/play_img/music_rope/great-p.png" Width="145" Height="141" VerticalAlignment="Bottom" />
|
||||
</Grid>
|
||||
<Image x:Name="miss" Source="/Resources/Img/play_img/music_rope/miss.png" Visibility="Hidden" HorizontalAlignment="Left" Width="157" Height="85" VerticalAlignment="Bottom" Margin="0,0,0,86"/>
|
||||
|
||||
<Image x:Name="head_g" Source="/Resources/Img/play_img/music_rope/head_g.png" Visibility="Visible" HorizontalAlignment="Right" Width="152" Height="85" VerticalAlignment="Top" Margin="0,0,0,0"/>
|
||||
<Image x:Name="head_m" Source="/Resources/Img/play_img/music_rope/head_m.png" Visibility="Visible" HorizontalAlignment="Right" Width="152" Height="85" VerticalAlignment="Top" Margin="0,0,0,0"/>
|
||||
<Image x:Name="head_g" Source="/Resources/Img/play_img/music_rope/head_g.png" Visibility="Hidden" HorizontalAlignment="Right" Width="152" Height="85" VerticalAlignment="Top" Margin="0,0,0,0"/>
|
||||
<Image x:Name="head_m" Source="/Resources/Img/play_img/music_rope/head_m.png" Visibility="Hidden" HorizontalAlignment="Right" Width="152" Height="85" VerticalAlignment="Top" Margin="0,0,0,0"/>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Grid Width="3" Height="140" Background="#fedd40" ClipToBounds="False" Margin="0,500,0,0"></Grid>
|
||||
<Grid Width="580" Height="87" Background="#25ffffff" ClipToBounds="False" Margin="0,500,0,0" HorizontalAlignment="Left">
|
||||
|
||||
@ -163,14 +163,14 @@ namespace Wpf_AiSportsMicrospace.MyUserControl
|
||||
private void OnTimePointReached(double timePoint)
|
||||
{
|
||||
Console.WriteLine($"触发时间点: {timePoint}");
|
||||
if (_isMiss)
|
||||
if (isMiss)
|
||||
{
|
||||
head_m.Visibility = Visibility.Visible;
|
||||
miss.Visibility = Visibility.Visible;
|
||||
head_g.Visibility = Visibility.Hidden;
|
||||
great.Visibility = Visibility.Hidden;
|
||||
// 200ms 后隐藏
|
||||
var hideTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(200) };
|
||||
var hideTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(300) };
|
||||
hideTimer.Start();
|
||||
hideTimer.Tick += (s, e) =>
|
||||
{
|
||||
@ -185,8 +185,10 @@ namespace Wpf_AiSportsMicrospace.MyUserControl
|
||||
great.Visibility = Visibility.Visible;
|
||||
head_m.Visibility = Visibility.Hidden;
|
||||
miss.Visibility = Visibility.Hidden;
|
||||
ShowImageWithAnimation(great , 221 , 172);
|
||||
ShowImageWithAnimation(head_g , 152 , 82);
|
||||
// 200ms 后隐藏
|
||||
var hideTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(200) };
|
||||
var hideTimer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(300) };
|
||||
hideTimer.Start();
|
||||
hideTimer.Tick += (s, e) =>
|
||||
{
|
||||
@ -197,6 +199,44 @@ namespace Wpf_AiSportsMicrospace.MyUserControl
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void ShowImageWithAnimation(UIElement ui , int width, int height)
|
||||
{
|
||||
|
||||
|
||||
// 透明度动画
|
||||
DoubleAnimation opacityAnimation = new DoubleAnimation
|
||||
{
|
||||
From = 0,
|
||||
To = 1,
|
||||
Duration = TimeSpan.FromSeconds(0.1)
|
||||
};
|
||||
|
||||
// 缩放动画
|
||||
DoubleAnimation scaleYAnimation = new DoubleAnimation
|
||||
{
|
||||
From = height - 12,
|
||||
To = height + 12,
|
||||
Duration = TimeSpan.FromSeconds(0.3),
|
||||
EasingFunction = new ElasticEase { EasingMode = EasingMode.EaseOut }
|
||||
};
|
||||
|
||||
DoubleAnimation scaleXAnimation = new DoubleAnimation
|
||||
{
|
||||
From = width - 30,
|
||||
To = width + 20,
|
||||
Duration = TimeSpan.FromSeconds(0.3),
|
||||
EasingFunction = new ElasticEase { EasingMode = EasingMode.EaseOut}
|
||||
};
|
||||
|
||||
ui.BeginAnimation(Image.OpacityProperty, opacityAnimation);
|
||||
ui.BeginAnimation(Image.WidthProperty, scaleXAnimation);
|
||||
ui.BeginAnimation(Image.HeightProperty, scaleYAnimation);
|
||||
//ui.BeginAnimation(RotateTransform.AngleProperty, rotateAnimation);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class TimedEventTrigger
|
||||
|
||||
BIN
Wpf_AiSportsMicrospace/Resources/Img/Album/leigh.gif
Normal file
BIN
Wpf_AiSportsMicrospace/Resources/Img/Album/leigh.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 MiB |
BIN
Wpf_AiSportsMicrospace/Resources/Img/Album/leight.gif
Normal file
BIN
Wpf_AiSportsMicrospace/Resources/Img/Album/leight.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
@ -57,12 +57,22 @@
|
||||
<Image
|
||||
gif:ImageBehavior.AnimatedSource="/Resources/Img/Album/1.gif"
|
||||
gif:ImageBehavior.RepeatBehavior="Forever"
|
||||
HorizontalAlignment="right"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalAlignment="right"
|
||||
VerticalAlignment="Top"
|
||||
Margin="50,10,200,20"
|
||||
/>
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
<Image
|
||||
gif:ImageBehavior.AnimatedSource="/Resources/Img/Album/leight.gif"
|
||||
gif:ImageBehavior.RepeatBehavior="Forever"
|
||||
gif:ImageBehavior.AnimateInDesignMode="True"
|
||||
VerticalAlignment="Top"
|
||||
Margin="20,80,0,0"
|
||||
Width="880"
|
||||
/>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@ -43,7 +43,7 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope
|
||||
|
||||
|
||||
// 容忍时间(节拍误差)
|
||||
public double _beatTolerance = 0.22; // ±150ms
|
||||
public double _beatTolerance = 0.24; // ±150ms
|
||||
private int _totalDots = 0;
|
||||
// 滚动显示的节拍点集合
|
||||
public ObservableCollection<BeatItem> BeatDisplayLeft { get; set; } = new();
|
||||
@ -326,8 +326,8 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope
|
||||
lose1.Margin = new Thickness(60, 0, 0, 0);
|
||||
lose2.Margin = new Thickness(60, 0, 0, 0);
|
||||
lose3.Margin = new Thickness(60, 0, 0, 0);
|
||||
win1.Margin = new Thickness(60, -123, 0, 0);
|
||||
win2.Margin = new Thickness(60, -123, 0, 0);
|
||||
win1.Margin = new Thickness(980, -123, 0, 0);
|
||||
win2.Margin = new Thickness(980, -123, 0, 0);
|
||||
|
||||
text1.Text = "LOSE";
|
||||
text2.Text = "WIN";
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
xmlns:local="clr-namespace:Wpf_AiSportsMicrospace.Views"
|
||||
xmlns:gif="http://wpfanimatedgif.codeplex.com"
|
||||
WindowStyle="None"
|
||||
mc:Ignorable="d" WindowState="Maximized">
|
||||
mc:Ignorable="d" WindowState="Maximized" MouseDoubleClick="Window_MouseDoubleClick">
|
||||
<Grid>
|
||||
<!-- 过渡容器 -->
|
||||
<ContentControl x:Name="MainContent"/>
|
||||
|
||||
@ -379,6 +379,15 @@ namespace Wpf_AiSportsMicrospace.Views
|
||||
time3.Visibility = Visibility.Hidden;
|
||||
num++;
|
||||
}
|
||||
|
||||
private void Window_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
// 确认是左键双击
|
||||
if (e.ChangedButton == MouseButton.Right)
|
||||
{
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
<None Remove="Resources\Img\Album\home_history.png" />
|
||||
<None Remove="Resources\Img\Album\home_play.png" />
|
||||
<None Remove="Resources\Img\Album\home_test.png" />
|
||||
<None Remove="Resources\Img\Album\leight.gif" />
|
||||
<None Remove="Resources\Img\Album\title.png" />
|
||||
<None Remove="Resources\Img\Album\vs.png" />
|
||||
<None Remove="Resources\Img\Badge\1.jpg" />
|
||||
@ -97,6 +98,9 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Img\Album\leight.gif">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="Resources\Img\play_img\music_rope\back.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user