-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
127 lines (114 loc) · 5.68 KB
/
Copy pathMainWindow.xaml
File metadata and controls
127 lines (114 loc) · 5.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<Window x:Class="smartClass.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
Title="SmartClass"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
Topmost="True"
ShowInTaskbar="False"
Height="70">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemeResources RequestedTheme="{x:Null}"/>
<ui:XamlControlsResources/>
</ResourceDictionary.MergedDictionaries>
<!-- 时钟入场动画:弹性缩放 + 淡入 -->
<Storyboard x:Key="ClockEntranceAnimation">
<DoubleAnimation Storyboard.TargetName="ClockScaleTransform"
Storyboard.TargetProperty="ScaleX"
From="0.7" To="1.0"
Duration="0:0:0.7">
<DoubleAnimation.EasingFunction>
<BackEase EasingMode="EaseOut" Amplitude="0.4"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="ClockScaleTransform"
Storyboard.TargetProperty="ScaleY"
From="0.7" To="1.0"
Duration="0:0:0.7">
<DoubleAnimation.EasingFunction>
<BackEase EasingMode="EaseOut" Amplitude="0.4"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="ClockLabel"
Storyboard.TargetProperty="Opacity"
From="0" To="1"
Duration="0:0:0.35"/>
</Storyboard>
</ResourceDictionary>
</Window.Resources>
<Grid>
<!-- 背景层:高斯模糊 + 主题色半透明 -->
<Border Name="BackgroundBorder">
<Border.Effect>
<BlurEffect Radius="12" KernelType="Gaussian"/>
</Border.Effect>
<Border.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#00101018" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
</Border>
<!-- 内容层 -->
<Grid Margin="24,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<!-- ========== 左栏 ========== -->
<StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center">
<!-- 日期 + 星期(暗色模式→白 / 浅色模式→黑) -->
<TextBlock Name="DateLabel" VerticalAlignment="Center"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
FontSize="24" FontWeight="SemiBold"
Text="6月26日 周五"/>
<!-- 分割线 -->
<Border Name="SeparatorLine"
Width="1" Height="40" Margin="20,0"
Background="{DynamicResource CardStrokeColorDefaultBrush}"
Opacity="0.4"/>
<!-- 倒计时(主题强调色) -->
<TextBlock Name="CountdownLabel" VerticalAlignment="Center"
Foreground="{DynamicResource AccentTextFillColorPrimaryBrush}"
FontSize="18"
Text="距期末 0 天"/>
</StackPanel>
<!-- ========== 中栏 — 时钟(带入场动画) ========== -->
<StackPanel Grid.Column="1" VerticalAlignment="Center" Name="ClockPanel"
HorizontalAlignment="Center"
RenderTransformOrigin="0.5,0.5">
<StackPanel.RenderTransform>
<ScaleTransform x:Name="ClockScaleTransform" ScaleX="0.7" ScaleY="0.7"/>
</StackPanel.RenderTransform>
<TextBlock Name="ClockLabel"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
FontSize="24" FontWeight="Light"
FontFamily="Consolas" Cursor="Hand"
Opacity="0"
ToolTip="点击进入全屏时钟"
Text="00:00:00"/>
</StackPanel>
<!-- ========== 右栏 ========== -->
<StackPanel Grid.Column="2" Orientation="Horizontal"
HorizontalAlignment="Right" VerticalAlignment="Center">
<!-- 课程信息 -->
<StackPanel VerticalAlignment="Center">
<TextBlock Name="NextCourseLabel"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
FontSize="20" FontWeight="SemiBold"
TextAlignment="Right"
Text="下一节"/>
<TextBlock Name="Next2CourseLabel"
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
FontSize="15"
TextAlignment="Right"
Text=""/>
</StackPanel>
</StackPanel>
</Grid>
</Grid>
</Window>