Hyplayer 新版主页(概念)
2022/12/29
去年做的一个设计稿。
头图来自Unsplash
XAML
把XAML直接当成设计软件用了...代码会有点奇怪
<Page
x:Class="HyPlayer.Pages.Test.TestHomePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:HyPlayer.Pages.Test"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:play="using:HyPlayer.HyPlayControl"
mc:Ignorable="d">
<ScrollViewer>
<Grid Margin="36,36,36,128" RowSpacing="12">
<Grid.RowDefinitions>
<RowDefinition Height="400" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock
Canvas.ZIndex="1"
FontSize="24"
Style="{StaticResource TitleTextBlockStyle}"
Text="正在播放" />
<Grid
Height="400"
Margin="-36,-36,-36,0"
VerticalAlignment="Top">
<controls:ImageEx
Canvas.ZIndex="0"
Source="https://flarum.csur.fun/2022-12-25/1671970508-774457-image.png"
Stretch="UniformToFill" />
<StackPanel
Margin="36"
VerticalAlignment="Center"
Spacing="4">
<TextBlock
FontSize="36"
FontWeight="SemiBold"
Text="{x:Bind play:HyPlayList.NowPlayingItem.PlayItem.Name, Mode=OneWay}" />
<TextBlock
FontSize="16"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="{x:Bind play:HyPlayList.NowPlayingItem.PlayItem.ArtistString, Mode=OneWay}" />
</StackPanel>
<Border>
<Border.Background>
<LinearGradientBrush StartPoint="1,0">
<GradientStop Offset="0.6" Color="#0000" />
<GradientStop Offset="0.90" Color="#80303030" />
<GradientStop Offset="1" Color="#272727" />
</LinearGradientBrush>
</Border.Background>
</Border>
</Grid>
<StackPanel
VerticalAlignment="Center"
Spacing="2"
Visibility="Collapsed">
<StackPanel Orientation="Horizontal">
<TextBlock
HorizontalAlignment="Left"
FontSize="32"
Style="{StaticResource TitleTextBlockStyle}"
Text="欢迎," />
<TextBlock
Margin="-10,-1,0,0"
FontSize="34"
FontWeight="Bold"
Foreground="{StaticResource SystemAccentColorLight2}"
Style="{StaticResource TitleTextBlockStyle}"
Text="Betta_Fish" />
</StackPanel>
<TextBlock
FontSize="16"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="用音乐开启新的一天吧" />
</StackPanel>
<StackPanel
x:Name="ActionPanel"
Grid.Row="0"
Margin="0,0,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Canvas.ZIndex="1"
Orientation="Horizontal"
Spacing="12">
<Button Padding="16" CornerRadius="12">
<StackPanel Orientation="Horizontal" Spacing="12">
<FontIcon FontSize="24" Glyph="" />
<TextBlock FontSize="16" Text="我的喜欢" />
</StackPanel>
</Button>
<Button Padding="16" CornerRadius="12">
<StackPanel Orientation="Horizontal" Spacing="12">
<FontIcon FontSize="24" Glyph="" />
<TextBlock FontSize="16" Text="每日推荐" />
</StackPanel>
</Button>
<Button Padding="16" CornerRadius="12">
<StackPanel Orientation="Horizontal" Spacing="12">
<FontIcon FontSize="24" Glyph="" />
<TextBlock FontSize="16" Text="私人FM" />
</StackPanel>
</Button>
</StackPanel>
<Grid Grid.Row="2" RowSpacing="8">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Text="推荐歌曲" />
<HyperlinkButton HorizontalAlignment="Right" Content="查看更多" />
<controls:AdaptiveGridView
Grid.Row="1"
DesiredWidth="320"
ItemHeight="100"
SelectionMode="None">
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<StackPanel
Margin="16,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal"
Spacing="12">
<Border
Width="64"
Height="64"
VerticalAlignment="Center"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="4">
<FontIcon FontSize="24" Glyph="" />
</Border>
<StackPanel VerticalAlignment="Center">
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="标题" />
<TextBlock Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}" Text="歌手" />
<TextBlock Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}" Text="专辑名" />
</StackPanel>
</StackPanel>
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="00:00" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<StackPanel
Margin="16,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal"
Spacing="12">
<Border
Width="64"
Height="64"
VerticalAlignment="Center"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="4">
<FontIcon FontSize="24" Glyph="" />
</Border>
<StackPanel VerticalAlignment="Center">
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="标题" />
<TextBlock Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}" Text="歌手" />
<TextBlock Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}" Text="专辑名" />
</StackPanel>
</StackPanel>
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="00:00" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<StackPanel
Margin="16,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal"
Spacing="12">
<Border
Width="64"
Height="64"
VerticalAlignment="Center"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="4">
<FontIcon FontSize="24" Glyph="" />
</Border>
<StackPanel VerticalAlignment="Center">
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="标题" />
<TextBlock Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}" Text="歌手" />
<TextBlock Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}" Text="专辑名" />
</StackPanel>
</StackPanel>
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="00:00" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<StackPanel
Margin="16,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal"
Spacing="12">
<Border
Width="64"
Height="64"
VerticalAlignment="Center"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="4">
<FontIcon FontSize="24" Glyph="" />
</Border>
<StackPanel VerticalAlignment="Center">
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="标题" />
<TextBlock Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}" Text="歌手" />
<TextBlock Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}" Text="专辑名" />
</StackPanel>
</StackPanel>
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="00:00" />
</Grid>
</Border>
</controls:AdaptiveGridView>
</Grid>
<Grid Grid.Row="3" RowSpacing="8">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Text="推荐歌单" />
<HyperlinkButton HorizontalAlignment="Right" Content="查看更多" />
<controls:AdaptiveGridView
Grid.Row="1"
DesiredWidth="256"
ItemHeight="100"
SelectionMode="None">
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<StackPanel
Margin="16,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal"
Spacing="12">
<Border
Width="64"
Height="64"
VerticalAlignment="Center"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="4">
<FontIcon FontSize="24" Glyph="" />
</Border>
<StackPanel VerticalAlignment="Center">
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="标题" />
<TextBlock
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="用户"
TextTrimming="WordEllipsis" />
</StackPanel>
</StackPanel>
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<StackPanel
Margin="16,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal"
Spacing="12">
<Border
Width="64"
Height="64"
VerticalAlignment="Center"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="4">
<FontIcon FontSize="24" Glyph="" />
</Border>
<StackPanel VerticalAlignment="Center">
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="标题" />
<TextBlock
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="用户"
TextTrimming="WordEllipsis" />
</StackPanel>
</StackPanel>
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<StackPanel
Margin="16,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal"
Spacing="12">
<Border
Width="64"
Height="64"
VerticalAlignment="Center"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="4">
<FontIcon FontSize="24" Glyph="" />
</Border>
<StackPanel VerticalAlignment="Center">
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="标题" />
<TextBlock
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="用户"
TextTrimming="WordEllipsis" />
</StackPanel>
</StackPanel>
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<StackPanel
Margin="16,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal"
Spacing="12">
<Border
Width="64"
Height="64"
VerticalAlignment="Center"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="4">
<FontIcon FontSize="24" Glyph="" />
</Border>
<StackPanel VerticalAlignment="Center">
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="标题" />
<TextBlock
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="用户"
TextTrimming="WordEllipsis" />
</StackPanel>
</StackPanel>
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<StackPanel
Margin="16,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal"
Spacing="12">
<Border
Width="64"
Height="64"
VerticalAlignment="Center"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="4">
<FontIcon FontSize="24" Glyph="" />
</Border>
<StackPanel VerticalAlignment="Center">
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="标题" />
<TextBlock
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="用户"
TextTrimming="WordEllipsis" />
</StackPanel>
</StackPanel>
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<StackPanel
Margin="16,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal"
Spacing="12">
<Border
Width="64"
Height="64"
VerticalAlignment="Center"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
CornerRadius="4">
<FontIcon FontSize="24" Glyph="" />
</Border>
<StackPanel VerticalAlignment="Center">
<TextBlock
FontSize="20"
FontWeight="SemiBold"
Text="标题" />
<TextBlock
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="用户"
TextTrimming="WordEllipsis" />
</StackPanel>
</StackPanel>
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
</controls:AdaptiveGridView>
</Grid>
<Grid
Grid.Row="4"
Margin="0,12,0,0"
RowSpacing="8">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Text="排行榜" />
<HyperlinkButton HorizontalAlignment="Right" Content="查看更多" />
<controls:AdaptiveGridView
Grid.Row="1"
DesiredWidth="240"
ItemHeight="128"
SelectionMode="None">
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<FontIcon FontSize="40" Glyph="" />
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<FontIcon FontSize="40" Glyph="" />
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<FontIcon FontSize="40" Glyph="" />
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<FontIcon FontSize="40" Glyph="" />
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<FontIcon FontSize="40" Glyph="" />
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<FontIcon FontSize="40" Glyph="" />
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<FontIcon FontSize="40" Glyph="" />
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
<Border
Margin="2,4,2,0"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
CornerRadius="8">
<Grid>
<FontIcon FontSize="40" Glyph="" />
<TextBlock
Margin="16"
HorizontalAlignment="Right"
VerticalAlignment="Bottom"
Foreground="{StaticResource SystemControlForegroundBaseMediumBrush}"
Text="10W" />
</Grid>
</Border>
</controls:AdaptiveGridView>
</Grid>
</Grid>
</ScrollViewer>
</Page>