-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainPage.xaml
More file actions
155 lines (141 loc) · 9.38 KB
/
Copy pathMainPage.xaml
File metadata and controls
155 lines (141 loc) · 9.38 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:vm="clr-namespace:ToyPadMaui.ViewModels"
x:Class="ToyPadMaui.MainPage"
Shell.NavBarIsVisible="False"
BackgroundColor="#0e0d12">
<Grid x:Name="RootGrid">
<!-- Wallpaper background -->
<Image x:Name="BgImage" Aspect="AspectFill" Opacity="1" />
<BoxView Color="#0e0d12" Opacity="0.45" />
<Grid RowDefinitions="Auto,*" Padding="0">
<!-- Topbar: logo + horizontally scrollable actions -->
<Grid Row="0" Padding="10,8" RowDefinitions="Auto,Auto" RowSpacing="6"
BackgroundColor="#e60e0d18">
<Image Grid.Row="0" x:Name="LogoImage" HeightRequest="48"
Aspect="AspectFit" HorizontalOptions="Center" />
<ScrollView Grid.Row="1" Orientation="Horizontal"
HorizontalScrollBarVisibility="Never">
<HorizontalStackLayout Spacing="6" Padding="4,0"
HorizontalOptions="Center">
<Ellipse x:Name="ConnDot" WidthRequest="10" HeightRequest="10"
Fill="#555" VerticalOptions="Center" />
<Label x:Name="ConnText" Text="sin conexión" TextColor="#8a8aa0"
FontSize="12" VerticalOptions="Center" Margin="0,0,6,0" />
<Button x:Name="AboutBtn" Text="¿Qué es?" Clicked="OnAbout" Style="{StaticResource Ghost}" />
<Button x:Name="ImportBtn" Text="Importar" Clicked="OnImport" Style="{StaticResource Ghost}" />
<Button x:Name="PlatformButton" Text="Modo: PS3" Clicked="OnTogglePlatform" Style="{StaticResource Ghost}" />
<Button x:Name="InstallButton" Text="Instalar" Clicked="OnInstall" Style="{StaticResource Primary}" />
<Button x:Name="ConnectBtn" Text="Conectar" Clicked="OnConnect" Style="{StaticResource Ghost}" />
<Button x:Name="CreditsBtn" Text="Créditos" Clicked="OnCredits" Style="{StaticResource Ghost}" />
<Button x:Name="LangBtn" Text="ES / EN" Clicked="OnToggleLanguage" Style="{StaticResource Ghost}" />
</HorizontalStackLayout>
</ScrollView>
</Grid>
<!-- Body: pad (+ library on the side in landscape) -->
<Grid Row="1" x:Name="BodyGrid" Padding="12" RowSpacing="12" ColumnSpacing="12">
<ScrollView x:Name="PadScroll">
<VerticalStackLayout Spacing="12">
<!-- Toy Pad image with the three light zones overlaid.
PadImageWrap is forced to the image's 4:3 aspect in
code-behind; the zones are positioned proportionally
in LayoutPadZones(). -->
<Grid x:Name="PadImageWrap" HorizontalOptions="Center"
VerticalOptions="Start" MaximumWidthRequest="680">
<Image x:Name="PadImage" Aspect="Fill" />
<AbsoluteLayout x:Name="PadOverlay" />
</Grid>
<HorizontalStackLayout Spacing="8" HorizontalOptions="Center">
<Button x:Name="SyncBtn" Text="↻ Sincronizar" Clicked="OnSync" Style="{StaticResource Ghost}" />
<Button x:Name="ClearBtn" Text="Limpiar todo" Clicked="OnClear" Style="{StaticResource Danger}" />
</HorizontalStackLayout>
<Label x:Name="HintLabel"
Text="Arrastra una figura a un espacio, o toca un espacio y luego una figura. Arrastra entre espacios para mover o intercambiar. Toca un espacio lleno para quitar."
TextColor="#8a8aa0" FontSize="12"
HorizontalTextAlignment="Center" />
</VerticalStackLayout>
</ScrollView>
</Grid>
</Grid>
<!-- Library panel. Reparented by code-behind:
landscape -> docked beside the pad (inside BodyGrid)
portrait -> bottom sheet overlay (inside RootGrid) -->
<Border x:Name="LibPanel" StrokeShape="RoundRectangle 6"
Stroke="#2c2c38" BackgroundColor="#181820" Padding="12">
<Grid RowDefinitions="Auto,Auto,Auto,*" RowSpacing="10">
<!-- Drag handle / close (visible only in portrait sheet) -->
<Grid Row="0" x:Name="SheetHandle" IsVisible="False"
HeightRequest="28">
<BoxView WidthRequest="44" HeightRequest="5" CornerRadius="3"
Color="#3c3c4d" HorizontalOptions="Center"
VerticalOptions="Center" />
<Button Text="✕" Clicked="OnCloseSheet"
BackgroundColor="Transparent" TextColor="#8a8aa0"
FontSize="16" Padding="0" WidthRequest="36" HeightRequest="28"
HorizontalOptions="End" VerticalOptions="Center" />
</Grid>
<ScrollView Grid.Row="1" Orientation="Horizontal"
HorizontalScrollBarVisibility="Never">
<HorizontalStackLayout Spacing="4">
<Button x:Name="CatAll" Text="Todos" Clicked="OnCat" Style="{StaticResource Cat}" />
<Button x:Name="CatChar" Text="Personajes" Clicked="OnCat" Style="{StaticResource Cat}" />
<Button x:Name="CatVeh" Text="Vehículos" Clicked="OnCat" Style="{StaticResource Cat}" />
<Button x:Name="CatGad" Text="Gadgets" Clicked="OnCat" Style="{StaticResource Cat}" />
</HorizontalStackLayout>
</ScrollView>
<SearchBar Grid.Row="2" x:Name="SearchBox"
Placeholder="Buscar (Batman, TARDIS, ...)"
TextChanged="OnSearch"
BackgroundColor="#0e0d12" TextColor="#ececf2" />
<CollectionView Grid.Row="3" x:Name="LibCollection"
SelectionMode="None">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical" Span="3"
HorizontalItemSpacing="6" VerticalItemSpacing="6" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="vm:FigureVm">
<Border StrokeThickness="1" Padding="0" Margin="0"
HeightRequest="128"
BackgroundColor="#1f1f2a">
<Border.Stroke>#2c2c38</Border.Stroke>
<Border.StrokeShape>
<RoundRectangle CornerRadius="6" />
</Border.StrokeShape>
<Border.GestureRecognizers>
<TapGestureRecognizer Tapped="OnFigureCardTapped" />
<DragGestureRecognizer DragStarting="OnFigureDragStarting" />
</Border.GestureRecognizers>
<VerticalStackLayout Spacing="4" Padding="6"
InputTransparent="True" CascadeInputTransparent="True">
<Image Source="{Binding Thumb}" Aspect="AspectFit"
HeightRequest="80" InputTransparent="True" />
<Label Text="{Binding Name}" FontSize="11"
TextColor="#ececf2"
HorizontalTextAlignment="Center"
LineBreakMode="WordWrap" MaxLines="2"
InputTransparent="True" />
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</Border>
<!-- Floating button to open the library (portrait only) -->
<Button x:Name="FabFiguras" Text="🧩 Figuras" Clicked="OnOpenSheet"
IsVisible="False"
BackgroundColor="#f5c518" TextColor="#1a1a1a" FontAttributes="Bold"
CornerRadius="24" HeightRequest="48" Padding="20,0"
HorizontalOptions="Center" VerticalOptions="End"
Margin="0,0,0,18" />
<!-- Scrim behind the sheet (portrait only) -->
<BoxView x:Name="Scrim" Color="#000000" Opacity="0" IsVisible="False"
InputTransparent="False">
<BoxView.GestureRecognizers>
<TapGestureRecognizer Tapped="OnCloseSheet" />
</BoxView.GestureRecognizers>
</BoxView>
</Grid>
</ContentPage>