@page "/"
@inject NavigationManager navigator
@inject HttpClient httpClient
@inject Blazored.LocalStorage.ILocalStorageService localStorage
Index
@for (int i = 0; i < numOfChunks; i++)
{
}
Start learning!
@if (Charecters != null)
{
}
@code{
int numOfChunks = 100; //Exclusive index 0
int selectedChunk = 0;
protected override void OnInitialized()
{
SelectedChunk();
StateHasChanged();
}
async void StartLearning()
{
await localStorage.SetItemAsync("SelectedChunk", selectedChunk);
navigator.NavigateTo("/Learn");
}
CChar[]? Charecters;
async void SelectedChunk()
{
Charecters = await httpClient.GetFromJsonAsync($"Data/Normalized_chunk_{selectedChunk.ToString("000")}.json");
StateHasChanged();
}
}