-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainPage.xaml
117 lines (112 loc) · 8.53 KB
/
MainPage.xaml
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
<Page
x:Class="PaletteGenerator.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:PaletteGenerator"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:UI="using:Microsoft.Advertising.WinRT.UI"
mc:Ignorable="d">
<Grid Background="White">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="640" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Target="mainStack.Orientation" Value="Horizontal" />
<Setter Target="mainStack.HorizontalAlignment" Value="Center" />
<Setter Target="mainStack.VerticalAlignment" Value="Center" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
<VisualStateGroup>
<VisualState>
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="540" />
</VisualState.StateTriggers>
<VisualState.Setters>
<!--<Setter Target="Advertisement.Width" Value="728" />
<Setter Target="Advertisement.Height" Value="90" />
<Setter Target="Advertisement.Margin" Value="-384,20,0,0" />-->
<Setter Target="shareButton.Visibility" Value="Visible" />
<Setter Target="Advertisement.Visibility" Value="Visible" />
<Setter Target="Advertisement2.Visibility" Value="Collapsed" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<StackPanel Name="mainStack" Orientation="Horizontal">
<StackPanel>
<StackPanel>
<TextBlock Text="Palette Generator" FontSize="29.333" Margin="20,5,0,0"/>
<TextBlock Text="Generate a random color palette." Margin="20,0,0,0"/>
<TextBlock Text="Click on the colors to copy them to clipboard in ARGB format." FontSize="10" Margin="20,0,0,0"/>
<StackPanel x:Name="inputPanel" Orientation="Horizontal" Margin="0,10,0,0">
<Button x:Name="generateButton" Content="Generate!" Click="noBase" HorizontalAlignment="Center" Margin="20,0,0,0"/>
<TextBlock x:Name="copiedText" Text="Copied!" FontSize="20" Foreground="#FF3A55BD" Opacity="0" Margin="20,0,0,0"/>
</StackPanel>
<StackPanel>
<StackPanel.Resources>
<Storyboard x:Name="copiedStoryboard">
<DoubleAnimation Storyboard.TargetName="copiedText" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.5"/>
</Storyboard>
</StackPanel.Resources>
</StackPanel>
<StackPanel Margin="20,5,0,0" Orientation="Horizontal">
<Rectangle x:Name="colorRect1" Fill="#F4F4F4" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="50" PointerPressed="toClipboard"/>
<Rectangle x:Name="colorRect2" Fill="#D4D4D4" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="50" PointerPressed="toClipboard"/>
<Rectangle x:Name="colorRect3" Fill="#B4B4B4" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="50" PointerPressed="toClipboard"/>
<Rectangle x:Name="colorRect4" Fill="#949494" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="50" PointerPressed="toClipboard"/>
<Rectangle x:Name="colorRect5" Fill="#D4D4D4" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="50" PointerPressed="toClipboard"/>
<Rectangle x:Name="colorRect6" Fill="#B4B4B4" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="50" PointerPressed="toClipboard"/>
</StackPanel>
<CheckBox Name="baseColor" Margin="20,0,0,0" Content="Lock first color (can be set in hex value box)" FontSize="14">
<ToolTipService.ToolTip>
<ToolTip HorizontalOffset="5" VerticalOffset="5">Lock the first color and generate the rest from it. You can set the first color in the Hex Values boxes.</ToolTip>
</ToolTipService.ToolTip>
</CheckBox>
<StackPanel Margin="20,0,0,0" Orientation="Horizontal">
<TextBlock Text="Mode:" FontSize="20"/>
<ComboBox Margin="5,0,0,0" Width="111">
<ComboBoxItem Name="smoothMode">Smooth</ComboBoxItem>
<ComboBoxItem Name="accentMode">Accent</ComboBoxItem>
<ComboBoxItem Name="variedMode">Varied</ComboBoxItem>
<ComboBoxItem Name="crazyMode">Crazy</ComboBoxItem>
<ComboBoxItem Name="randomMode" IsSelected="True">Random</ComboBoxItem>
</ComboBox>
</StackPanel>
</StackPanel>
<StackPanel>
<StackPanel.Resources>
<Storyboard x:Name="invalidStoryboardIn">
<DoubleAnimation Storyboard.TargetName="invalidText" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.5"/>
</Storyboard>
<Storyboard x:Name="invalidStoryboardOut">
<DoubleAnimation Storyboard.TargetName="invalidText" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.3"/>
</Storyboard>
</StackPanel.Resources>
</StackPanel>
<StackPanel Margin="20,5,0,0">
<StackPanel Orientation="Horizontal">
<TextBlock Text="Hex Values" FontSize="20" Margin="0,0,0,5"/>
<TextBlock x:Name="invalidText" Text="Invalid Hex" FontSize="20" Foreground="#FFFF3E2B" Opacity="0" Margin="5,0,0,0"/>
</StackPanel>
<TextBox x:Name="colorText1" HorizontalAlignment="Left" Margin="0,0,0,5" TextWrapping="Wrap" Text="#F4F4F4" VerticalAlignment="Top" Width="200"/>
<TextBox x:Name="colorText2" IsReadOnly="True" HorizontalAlignment="Left" Margin="0,0,0,5" TextWrapping="Wrap" Text="#D4D4D4" VerticalAlignment="Top" Width="200"/>
<TextBox x:Name="colorText3" IsReadOnly="True" HorizontalAlignment="Left" Margin="0,0,0,5" TextWrapping="Wrap" Text="#B4B4B4" VerticalAlignment="Top" Width="200"/>
<TextBox x:Name="colorText4" IsReadOnly="True" HorizontalAlignment="Left" Margin="0,0,0,5" TextWrapping="Wrap" Text="#949494" VerticalAlignment="Top" Width="200"/>
<TextBox x:Name="colorText5" IsReadOnly="True" HorizontalAlignment="Left" Margin="0,0,0,5" TextWrapping="Wrap" Text="#D4D4D4" VerticalAlignment="Top" Width="200"/>
<TextBox x:Name="colorText6" IsReadOnly="True" HorizontalAlignment="Left" Margin="0,0,0,5" TextWrapping="Wrap" Text="#B4B4B4" VerticalAlignment="Top" Width="200"/>
<StackPanel Orientation="Horizontal">
<!--<Button x:Name="saveButton" Content="Save as Image" Click="savePalette" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,0,10,0"/>-->
<Button x:Name="shareButton" Content="Share Palette" Click="sharePalette" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,0,0,0" Visibility="Collapsed"/>
<UI:AdControl Name="Advertisement2" ApplicationId="3f83fe91-d6be-434d-a0ae-7351c5a997f1" AdUnitId="10865270" VerticalAlignment="Top" Width="300" Height="50" Margin="0,0,0,0" HorizontalAlignment="Left" Visibility="Visible"/>
</StackPanel>
</StackPanel>
</StackPanel>
<UI:AdControl Name="Advertisement" ApplicationId="3f83fe91-d6be-434d-a0ae-7351c5a997f1" AdUnitId="10865270" VerticalAlignment="Top" Width="160" Height="600" Margin="20,20,0,0" HorizontalAlignment="Left" Visibility="Collapsed"/>
</StackPanel>
</Grid>
</Page>