Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kikipoulet committed Sep 13, 2024
1 parent 1f0de91 commit d5ff4ec
Showing 1 changed file with 22 additions and 80 deletions.
102 changes: 22 additions & 80 deletions SukiUI/Theme/ToggleSwitchStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,19 @@
CornerRadius="{DynamicResource MediumCornerRadius}">
<Border />
<Border.Transitions>
<Transitions />
<Transitions >

<DoubleTransition Property="Width" Duration="0:0:0.15">
<DoubleTransition.Easing>
<QuadraticEaseOut />
</DoubleTransition.Easing>
</DoubleTransition>
<DoubleTransition Property="Canvas.Left" Duration="0:0:0.45">
<DoubleTransition.Easing>
<QuarticEaseOut />
</DoubleTransition.Easing>
</DoubleTransition>
</Transitions>
</Border.Transitions>
</Border>

Expand All @@ -186,100 +198,30 @@


<Style Selector="ToggleSwitch:unchecked /template/ Border#SwitchKnob">
<Style.Animations>
<Animation FillMode="Both" Duration="0:0:0.25">
<Animation.Easing>
<SineEaseOut />
</Animation.Easing>

<KeyFrame Cue="30%">
<Setter Property="Width" Value="25" />
<Setter Property="Canvas.Left" Value="11" />

</KeyFrame>
<KeyFrame Cue="70%">
<Setter Property="Width" Value="25" />
<Setter Property="Canvas.Left" Value="2" />

</KeyFrame>


<KeyFrame Cue="100%">
<Setter Property="Width" Value="18" />
<Setter Property="Canvas.Left" Value="2" />

</KeyFrame>

</Animation>
</Style.Animations>
<Setter Property="Width" Value="18" />
<Setter Property="Canvas.Left" Value="2" />

</Style>

<Style Selector="ToggleSwitch:checked /template/ Border#SwitchKnob">

<Setter Property="BoxShadow" Value="0 0 0 0 White" />
<Style.Animations>
<Animation FillMode="Both" Duration="0:0:0.25">
<Animation.Easing>
<SineEaseOut />
</Animation.Easing>


<KeyFrame Cue="30%">
<Setter Property="Width" Value="25" />
<Setter Property="Canvas.Left" Value="2" />
</KeyFrame>

<KeyFrame Cue="70%">
<Setter Property="Width" Value="25" />
<Setter Property="Canvas.Left" Value="11" />

</KeyFrame>

<KeyFrame Cue="100%">
<Setter Property="Width" Value="18" />
<Setter Property="Canvas.Left" Value="20" />

</KeyFrame>

</Animation>
</Style.Animations>
<Setter Property="Width" Value="18" />
<Setter Property="Canvas.Left" Value="20" />


</Style>


<Style Selector="ToggleSwitch:pressed[IsChecked=False] /template/ Border#SwitchKnob">
<Style.Animations>
<Animation FillMode="Forward" Duration="0:0:0.15">
<KeyFrame Cue="0%">
<Setter Property="Width" Value="16" />
</KeyFrame>

<KeyFrame Cue="100%">
<Setter Property="Width" Value="20" />
</KeyFrame>

</Animation>
</Style.Animations>
<Setter Property="Width" Value="22" />

</Style>

<Style Selector="ToggleSwitch:pressed[IsChecked=True] /template/ Border#SwitchKnob">
<Style.Animations>
<Animation FillMode="Forward" Duration="0:0:0.1">
<KeyFrame Cue="0%">
<Setter Property="Width" Value="16" />
<Setter Property="Canvas.Left" Value="22" />
</KeyFrame>

<KeyFrame Cue="100%">
<Setter Property="Width" Value="20" />
<Setter Property="Canvas.Left" Value="18" />
</KeyFrame>

</Animation>
</Style.Animations>
<Setter Property="Width" Value="20" />

<Setter Property="Canvas.Left" Value="16" />
<Setter Property="Width" Value="22" />
</Style>


Expand Down

0 comments on commit d5ff4ec

Please sign in to comment.