Skip to content

Commit f53aeae

Browse files
committed
feat: 更新骨架屏样式
1 parent 4fe81fd commit f53aeae

1 file changed

Lines changed: 53 additions & 9 deletions

File tree

Utils/Converters/Converters.xaml

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@
4747

4848
<!-- 骨架屏样式 -->
4949
<Style x:Key="SkeletonLoaderStyle" TargetType="Rectangle">
50-
<Setter Property="Fill" Value="{DynamicResource SurfaceBrush}"/>
50+
<Setter Property="Fill" Value="{DynamicResource SurfaceElevatedBrush}"/>
5151
<Setter Property="RadiusX" Value="4"/>
5252
<Setter Property="RadiusY" Value="4"/>
5353
<Style.Triggers>
5454
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
5555
<BeginStoryboard>
5656
<Storyboard RepeatBehavior="Forever" AutoReverse="True">
5757
<DoubleAnimation Storyboard.TargetProperty="Opacity"
58-
From="0.3" To="0.6" Duration="0:0:1.5">
58+
From="0.5" To="0.9" Duration="0:0:1.2">
5959
<DoubleAnimation.EasingFunction>
6060
<SineEase EasingMode="EaseInOut"/>
6161
</DoubleAnimation.EasingFunction>
@@ -66,22 +66,66 @@
6666
</Style.Triggers>
6767
</Style>
6868

69-
<!-- 骨架屏卡片样式(用于版本列表、MOD卡片等) -->
69+
<!-- 骨架屏卡片样式(用于版本列表、MOD卡片等)- 支持主题切换,带明显的闪动效果 -->
7070
<Style x:Key="SkeletonCardStyle" TargetType="Border">
71-
<Setter Property="Background" Value="{DynamicResource SurfaceBrush}"/>
71+
<Setter Property="Background" Value="{DynamicResource SkeletonBackgroundBrush}"/>
7272
<Setter Property="CornerRadius" Value="12"/>
7373
<Setter Property="Padding" Value="16"/>
7474
<Setter Property="Margin" Value="0,0,0,12"/>
75+
<Setter Property="BorderThickness" Value="1"/>
76+
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
7577
<Style.Triggers>
7678
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
7779
<BeginStoryboard>
7880
<Storyboard RepeatBehavior="Forever" AutoReverse="True">
79-
<ColorAnimation Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)"
80-
From="#2C2C2C" To="#3A3A3A" Duration="0:0:1.5">
81-
<ColorAnimation.EasingFunction>
81+
<!-- 透明度动画 - 明显的闪动效果(颜色使用动态资源,自动跟随主题) -->
82+
<DoubleAnimation Storyboard.TargetProperty="Opacity"
83+
From="0.3" To="0.7" Duration="0:0:0.8">
84+
<DoubleAnimation.EasingFunction>
85+
<SineEase EasingMode="EaseInOut"/>
86+
</DoubleAnimation.EasingFunction>
87+
</DoubleAnimation>
88+
</Storyboard>
89+
</BeginStoryboard>
90+
</EventTrigger>
91+
</Style.Triggers>
92+
</Style>
93+
94+
<!-- 骨架屏矩形(用于文本占位)- 支持主题切换,明显的闪动效果 -->
95+
<Style x:Key="SkeletonRectangleStyle" TargetType="Rectangle">
96+
<Setter Property="Fill" Value="{DynamicResource SkeletonFillBrush}"/>
97+
<Setter Property="RadiusX" Value="4"/>
98+
<Setter Property="RadiusY" Value="4"/>
99+
<Setter Property="Height" Value="16"/>
100+
<Style.Triggers>
101+
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
102+
<BeginStoryboard>
103+
<Storyboard RepeatBehavior="Forever" AutoReverse="True">
104+
<DoubleAnimation Storyboard.TargetProperty="Opacity"
105+
From="0.3" To="0.7" Duration="0:0:0.8">
106+
<DoubleAnimation.EasingFunction>
107+
<SineEase EasingMode="EaseInOut"/>
108+
</DoubleAnimation.EasingFunction>
109+
</DoubleAnimation>
110+
</Storyboard>
111+
</BeginStoryboard>
112+
</EventTrigger>
113+
</Style.Triggers>
114+
</Style>
115+
116+
<!-- 骨架屏圆形(用于头像/图标占位)- 支持主题切换,明显的闪动效果 -->
117+
<Style x:Key="SkeletonCircleStyle" TargetType="Ellipse">
118+
<Setter Property="Fill" Value="{DynamicResource SkeletonFillBrush}"/>
119+
<Style.Triggers>
120+
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
121+
<BeginStoryboard>
122+
<Storyboard RepeatBehavior="Forever" AutoReverse="True">
123+
<DoubleAnimation Storyboard.TargetProperty="Opacity"
124+
From="0.3" To="0.7" Duration="0:0:0.8">
125+
<DoubleAnimation.EasingFunction>
82126
<SineEase EasingMode="EaseInOut"/>
83-
</ColorAnimation.EasingFunction>
84-
</ColorAnimation>
127+
</DoubleAnimation.EasingFunction>
128+
</DoubleAnimation>
85129
</Storyboard>
86130
</BeginStoryboard>
87131
</EventTrigger>

0 commit comments

Comments
 (0)