@page "/admin/system/customisation/themes/create" @using Moonlight.Client.Services @using Moonlight.Shared.Misc @using Moonlight.Client.UI.Components @using Moonlight.Shared.Http.Requests.Admin.Sys.Theme @inject ThemeService ThemeService @inject ToastService ToastService @inject NavigationManager NavigationManager Back Create Name Author Version This field will be used for update checks @code { private HandleForm Form; private CreateThemeRequest Request = new(); protected override void OnInitialized() { Request.Content = CreateDefault(); } private async Task OnValidSubmit() { await ThemeService.CreateAsync(Request); await ToastService.SuccessAsync("Successfully created theme"); NavigationManager.NavigateTo("/admin/system/customisation"); } private ApplicationTheme CreateDefault() { return new ApplicationTheme() { ColorBase100 = "#1e2b47", ColorBase200 = "#101a2e", ColorBase300 = "#0c1221", ColorBaseContent = "#dde5f5", ColorPrimary = "#4f39f6", ColorPrimaryContent = "#dde5f5", ColorSecondary = "#354052", ColorSecondaryContent = "#dde5f5", ColorAccent = "#7008e7", ColorAccentContent = "#dde5f5", ColorNeutral = "#1a273a", ColorNeutralContent = "#dde5f5", ColorInfo = "#155dfc", ColorInfoContent = "#dde5f5", ColorSuccess = "#00a63e", ColorSuccessContent = "#dde5f5", ColorWarning = "#ffba00", ColorWarningContent = "#dde5f5", ColorError = "#ec003f", ColorErrorContent = "#dde5f5", RadiusSelector = 0.25f, RadiusField = 0.5f, RadiusBox = 0.5f, SizeSelector = 0.25f, SizeField = 0.25f, Border = 1f, Depth = 0, Noise = 0 }; } }