LANCommander/LANCommander.Launcher.Avalonia/Views/Components/CoverButton.axaml
2026-04-19 12:55:23 -05:00

101 lines
4.7 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vmComponents="using:LANCommander.Launcher.Avalonia.ViewModels.Components"
xmlns:local="using:LANCommander.Launcher.Avalonia.Views.Components"
x:Class="LANCommander.Launcher.Avalonia.Views.Components.CoverButton"
x:DataType="vmComponents:GameItemViewModel"
ClipToBounds="False">
<UserControl.Styles>
<Style Selector="Button.CoverButton">
<Setter Property="Padding" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="CornerRadius" Value="0" />
<Setter Property="RenderTransform" Value="scale(1)" />
<Setter Property="Transitions">
<Setter.Value>
<Transitions>
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.18" Easing="CubicEaseOut" />
</Transitions>
</Setter.Value>
</Setter>
</Style>
<Style Selector="Button.CoverButton:pointerover">
<Setter Property="RenderTransform" Value="scale(1.1)" />
</Style>
<Style Selector="Button.CoverButton Border.CoverShadow">
<Setter Property="BoxShadow" Value="0 0 64 32 #FF000000" />
<Setter Property="Opacity" Value="0" />
<Setter Property="Transitions">
<Setter.Value>
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.18" />
</Transitions>
</Setter.Value>
</Setter>
</Style>
<Style Selector="Button.CoverButton:pointerover Border.CoverShadow">
<Setter Property="Opacity" Value="1" />
</Style>
<Style Selector="Button.CoverButton Border.GlassOverlay">
<Setter Property="Opacity" Value="0" />
<Setter Property="Transitions">
<Setter.Value>
<Transitions>
<DoubleTransition Property="Opacity" Duration="0:0:0.2" />
</Transitions>
</Setter.Value>
</Setter>
</Style>
<Style Selector="Button.CoverButton:pointerover Border.GlassOverlay">
<Setter Property="Opacity" Value="1" />
</Style>
</UserControl.Styles>
<Button Classes="CoverButton"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
ClipToBounds="False"
Command="{Binding $parent[local:CoverButton].Command}"
CommandParameter="{Binding $parent[local:CoverButton].CommandParameter}">
<Panel>
<Border Classes="CoverShadow"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="Transparent"
IsHitTestVisible="False" />
<local:Cover Source="{Binding CoverPath}"
Title="{Binding Title}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<local:Cover.Overlay>
<Panel>
<Border Classes="GlassOverlay" IsHitTestVisible="False" CornerRadius="0">
<Border.Background>
<LinearGradientBrush StartPoint="0%,0%" EndPoint="70%,100%">
<GradientStop Color="#45FFFFFF" Offset="0" />
<GradientStop Color="#10FFFFFF" Offset="0.45" />
<GradientStop Color="#00FFFFFF" Offset="1" />
</LinearGradientBrush>
</Border.Background>
</Border>
<Border Background="#CC000000" CornerRadius="0"
HorizontalAlignment="Right" VerticalAlignment="Top"
Width="16" Height="16"
Margin="6"
IsVisible="{Binding ShowInLibraryBadge}">
<Icon Type="Regular" Value="Check" Width="9" Height="9"
VerticalAlignment="Center" HorizontalAlignment="Center" />
</Border>
</Panel>
</local:Cover.Overlay>
</local:Cover>
</Panel>
</Button>
</UserControl>