@page "/Card/{baid}"
@using SharedProject.Models.Responses
@using SharedProject.Enums
@using SharedProject.Models
@inject HttpClient Client
Card: @Baid
@if (response is not null)
{
Profile Options
@for (uint i = 0; i < 8; i++)
{
var index = i;
@titlePlateStrings[index]
}
@foreach (var item in Enum.GetValues())
{
}
Song Options
@for (uint i = 0; i < 15; i++)
{
var index = i;
@speedStrings[index]
}
@foreach (var item in Enum.GetValues())
{
}
@for (uint i = 0; i < 19; i++)
{
var index = i;
@toneStrings[index]
}
Notes Position
@if (isSavingOptions)
{
Saving...
}
else
{
Save
}
}
@code {
[Parameter]
public string? Baid { get; set; }
private UserSetting? response;
private bool isSavingOptions;
private readonly string[] speedStrings =
{
"1.0", "1.1", "1.2", "1.3", "1.4",
"1.5", "1.6", "1.7", "1.8", "1.9",
"2.0", "2.5", "3.0", "3.5", "4.0"
};
private readonly string[] notePositionStrings = { "-5", "-4", "-3", "-2", "-1", "0", "+1", "+2", "+3", "+4", "+5" };
private readonly string[] toneStrings = {
"Taiko", "Festival", "Dogs & Cats", "Deluxe",
"Drumset", "Tambourine", "Don Wada", "Clapping",
"Conga", "8-Bit", "Heave-ho", "Mecha",
"Bujain", "Rap", "Hosogai", "Akemi",
"Synth Drum", "Shuriken", "Bubble Pop", "Electric Guitar"
};
private readonly string[] titlePlateStrings = {
"Wood", "Rainbow", "Gold", "Purple",
"AI 1", "AI 2", "AI 3", "AI 4"
};
private List breadcrumbs = new()
{
new BreadcrumbItem("Dashboard", href: ""),
};
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
isSavingOptions = false;
response = await Client.GetFromJsonAsync($"api/UserSettings/{Baid}");
breadcrumbs.Add(new BreadcrumbItem($"Card: {Baid}", href: null, disabled: true));
}
private async Task SaveOptions()
{
isSavingOptions = true;
await Client.PostAsJsonAsync($"api/UserSettings/{Baid}", response);
isSavingOptions = false;
}
}