1- @page " /admin/system/theme"
2-
3- @using Microsoft .AspNetCore .Authorization
4- @using Moonlight .Client .UI .Components
51@using Moonlight .Shared .Misc
62
7- @attribute [Authorize(Policy = "permissions:admin.system.theme")]
8-
9- <NavTabs Index =" 1" Names =" UiConstants.AdminNavNames" Links =" UiConstants.AdminNavLinks" />
10-
11- <div class =" mt-5 grid grid-cols-3 gap-3" >
3+ <div class =" grid grid-cols-3 gap-3" >
124 <div class =" col-span-1 flex flex-col gap-3" >
135 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
14- <ColorSelector @bind-Value =" ThemeData .ColorBackground" />
6+ <ColorSelector @bind-Value =" Theme .ColorBackground" />
157 <span class =" ms-1" >Background</span >
168 </div >
179
1810 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
19- <ColorSelector @bind-Value =" ThemeData .ColorBaseContent" />
11+ <ColorSelector @bind-Value =" Theme .ColorBaseContent" />
2012 <span class =" ms-1" >Base Content</span >
2113 </div >
2214
2315 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
24- <ColorSelector @bind-Value =" ThemeData .ColorBase100" />
16+ <ColorSelector @bind-Value =" Theme .ColorBase100" />
2517 <span class =" ms-1" >Base 100</span >
2618 </div >
2719
2820 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
29- <ColorSelector @bind-Value =" ThemeData .ColorBase150" />
21+ <ColorSelector @bind-Value =" Theme .ColorBase150" />
3022 <span class =" ms-1" >Base 150</span >
3123 </div >
3224
3325 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
34- <ColorSelector @bind-Value =" ThemeData .ColorBase200" />
26+ <ColorSelector @bind-Value =" Theme .ColorBase200" />
3527 <span class =" ms-1" >Base 200</span >
3628 </div >
3729
3830 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
39- <ColorSelector @bind-Value =" ThemeData .ColorBase250" />
31+ <ColorSelector @bind-Value =" Theme .ColorBase250" />
4032 <span class =" ms-1" >Base 250</span >
4133 </div >
4234
4335 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
44- <ColorSelector @bind-Value =" ThemeData .ColorBase300" />
36+ <ColorSelector @bind-Value =" Theme .ColorBase300" />
4537 <span class =" ms-1" >Base 300</span >
4638 </div >
4739 </div >
4840
4941 <div class =" col-span-2 grid grid-cols-2 gap-3" >
5042 <div class =" col-span-1 flex flex-col gap-y-3" >
5143 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
52- <ColorSelector @bind-Value =" ThemeData .ColorPrimary" />
44+ <ColorSelector @bind-Value =" Theme .ColorPrimary" />
5345 <span class =" ms-1" >Primary</span >
5446 </div >
5547
5648 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
57- <ColorSelector Icon =" icon-type" @bind-Value =" ThemeData .ColorPrimaryContent" />
49+ <ColorSelector Icon =" icon-type" @bind-Value =" Theme .ColorPrimaryContent" />
5850 <span class =" ms-1" >Primary Content</span >
5951 </div >
6052 </div >
6153
6254 <div class =" col-span-1 flex flex-col gap-y-3" >
6355 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
64- <ColorSelector @bind-Value =" ThemeData .ColorSecondary" />
56+ <ColorSelector @bind-Value =" Theme .ColorSecondary" />
6557 <span class =" ms-1" >Secondary</span >
6658 </div >
6759
6860 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
69- <ColorSelector Icon =" icon-type" @bind-Value =" ThemeData .ColorSecondaryContent" />
61+ <ColorSelector Icon =" icon-type" @bind-Value =" Theme .ColorSecondaryContent" />
7062 <span class =" ms-1" >Secondary Content</span >
7163 </div >
7264 </div >
7365
7466 <div class =" col-span-1 flex flex-col gap-y-3" >
7567 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
76- <ColorSelector @bind-Value =" ThemeData .ColorAccent" />
68+ <ColorSelector @bind-Value =" Theme .ColorAccent" />
7769 <span class =" ms-1" >Accent</span >
7870 </div >
7971
8072 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
81- <ColorSelector Icon =" icon-type" @bind-Value =" ThemeData .ColorAccentContent" />
73+ <ColorSelector Icon =" icon-type" @bind-Value =" Theme .ColorAccentContent" />
8274 <span class =" ms-1" >Accent Content</span >
8375 </div >
8476 </div >
8577
8678 <div class =" col-span-1 flex flex-col gap-y-3" >
8779 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
88- <ColorSelector @bind-Value =" ThemeData .ColorInfo" />
80+ <ColorSelector @bind-Value =" Theme .ColorInfo" />
8981 <span class =" ms-1" >Info</span >
9082 </div >
9183
9284 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
93- <ColorSelector Icon =" icon-type" @bind-Value =" ThemeData .ColorInfoContent" />
85+ <ColorSelector Icon =" icon-type" @bind-Value =" Theme .ColorInfoContent" />
9486 <span class =" ms-1" >Info Content</span >
9587 </div >
9688 </div >
9789
9890 <div class =" col-span-1 flex flex-col gap-y-3" >
9991 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
100- <ColorSelector @bind-Value =" ThemeData .ColorSuccess" />
92+ <ColorSelector @bind-Value =" Theme .ColorSuccess" />
10193 <span class =" ms-1" >Success</span >
10294 </div >
10395
10496 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
105- <ColorSelector Icon =" icon-type" @bind-Value =" ThemeData .ColorSuccessContent" />
97+ <ColorSelector Icon =" icon-type" @bind-Value =" Theme .ColorSuccessContent" />
10698 <span class =" ms-1" >Success Content</span >
10799 </div >
108100 </div >
109101
110102 <div class =" col-span-1 flex flex-col gap-y-3" >
111103 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
112- <ColorSelector @bind-Value =" ThemeData .ColorWarning" />
104+ <ColorSelector @bind-Value =" Theme .ColorWarning" />
113105 <span class =" ms-1" >Warning</span >
114106 </div >
115107
116108 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
117- <ColorSelector Icon =" icon-type" @bind-Value =" ThemeData .ColorWarningContent" />
109+ <ColorSelector Icon =" icon-type" @bind-Value =" Theme .ColorWarningContent" />
118110 <span class =" ms-1" >Warning Content</span >
119111 </div >
120112 </div >
121113
122114 <div class =" col-span-1 flex flex-col gap-y-3" >
123115 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
124- <ColorSelector @bind-Value =" ThemeData .ColorError" />
116+ <ColorSelector @bind-Value =" Theme .ColorError" />
125117 <span class =" ms-1" >Error</span >
126118 </div >
127119
128120 <div class =" card card-body flex-row grow-0 items-center p-1.5 text-base-content" >
129- <ColorSelector Icon =" icon-type" @bind-Value =" ThemeData .ColorErrorContent" />
121+ <ColorSelector Icon =" icon-type" @bind-Value =" Theme .ColorErrorContent" />
130122 <span class =" ms-1" >Error Content</span >
131123 </div >
132124 </div >
133125 </div >
134126</div >
135127
136128
137-
138129@code
139130{
140- private ApplicationTheme ThemeData ;
141-
142- protected override void OnInitialized ()
143- {
144- ThemeData = CreateDefault ();
145- }
146-
147- private ApplicationTheme CreateDefault ()
148- {
149- return new ApplicationTheme ()
150- {
151- ColorBackground = " #0c0f18" ,
152-
153- ColorBase100 = " #1e2b47" ,
154- ColorBase150 = " #1a2640" ,
155- ColorBase200 = " #101a2e" ,
156- ColorBase250 = " #0f1729" ,
157- ColorBase300 = " #0c1221" ,
158-
159- ColorBaseContent = " #dde5f5" ,
160-
161- ColorPrimary = " #4f39f6" ,
162- ColorPrimaryContent = " #dde5f5" ,
163-
164- ColorSecondary = " #354052" ,
165- ColorSecondaryContent = " #dde5f5" ,
166-
167- ColorAccent = " #ad46ff" ,
168- ColorAccentContent = " #dde5f5" ,
169-
170- ColorNeutral = " #dde5f5" ,
171- ColorNeutralContent = " #09090b" ,
172-
173- ColorInfo = " #155dfc" ,
174- ColorInfoContent = " #dde5f5" ,
175-
176- ColorSuccess = " #00a63e" ,
177- ColorSuccessContent = " #dde5f5" ,
178-
179- ColorWarning = " #ffba00" ,
180- ColorWarningContent = " #dde5f5" ,
181-
182- ColorError = " #ec003f" ,
183- ColorErrorContent = " #dde5f5" ,
184-
185- RadiusSelector = 0 . 25 f ,
186- RadiusField = 0 . 5 f ,
187- RadiusBox = 0 . 5 f ,
188-
189- SizeSelector = 0 . 25 f ,
190- SizeField = 0 . 25 f ,
191-
192- Border = 1 f ,
193- Depth = 0 f ,
194- Noise = 0 f
195- };
196- }
197- }
131+ [Parameter ] public ApplicationTheme Theme { get ; set ; }
132+ }
0 commit comments