Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tmacharia
Created November 24, 2019 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmacharia/32c8db3242a79e7bb17665b070f874c7 to your computer and use it in GitHub Desktop.
Save tmacharia/32c8db3242a79e7bb17665b070f874c7 to your computer and use it in GitHub Desktop.
Clock second hand
<Grid Background="#242631" Height="400" Width="400" VerticalAlignment="Center" HorizontalAlignment="Center">
<!-- Clock Ellipse/Frame -->
<Border x:Name="ClockEllipse" CornerRadius="400" Background="#323443"/>
<Canvas HorizontalAlignment="Center" VerticalAlignment="Center">
<Path x:Name="SecHandPath" StrokeThickness="1" Stroke="DeepPink" Data="M 0,40 L 0 -150" RenderTransformOrigin="0,0">
<Path.Resources>
<Storyboard x:Name="SpinSecHandStoryBoard">
<DoubleAnimation x:Name="SpinSecHandAnim" Storyboard.TargetName="SecHandPath" FillBehavior="HoldEnd" AutoReverse="False" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)">
</DoubleAnimation>
</Storyboard>
</Path.Resources>
<Path.RenderTransform>
<RotateTransform />
</Path.RenderTransform>
</Path>
</Canvas>
<!-- Central Markers -->
<Border Height="30" Width="30" CornerRadius="70" Background="#242631"/>
<Border Height="12" Width="12" CornerRadius="20" Background="LightGray"/>
<!-- O'Clock Markers -->
<Border Height="10" Width="10" CornerRadius="10" Margin="15" Background="DeepPink" VerticalAlignment="Top" HorizontalAlignment="Center"/>
<Border Height="10" Width="10" CornerRadius="10" Margin="15" Background="DeepPink" VerticalAlignment="Center" HorizontalAlignment="Right"/>
<Border Height="10" Width="10" CornerRadius="10" Margin="15" Background="DeepPink" VerticalAlignment="Bottom" HorizontalAlignment="Center"/>
<Border Height="10" Width="10" CornerRadius="10" Margin="15" Background="DeepPink" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</Grid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment