2023-07-07 19:41:56 +02:00
|
|
|
using CCharLearn;
|
2023-06-28 22:03:48 +02:00
|
|
|
using Microsoft.AspNetCore.Components.Web;
|
|
|
|
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
|
|
|
using MudBlazor;
|
|
|
|
using Blazored.LocalStorage;
|
|
|
|
using MudBlazor.Services;
|
2023-07-04 21:20:33 +02:00
|
|
|
using Toolbelt.Blazor.Extensions.DependencyInjection;
|
2023-06-28 22:03:48 +02:00
|
|
|
|
2023-07-07 19:41:56 +02:00
|
|
|
namespace CCharLearn
|
2023-06-28 22:03:48 +02:00
|
|
|
{
|
|
|
|
public class Program
|
|
|
|
{
|
2023-06-29 12:47:18 +02:00
|
|
|
public static int CCharsLeft = 0;
|
|
|
|
public static Action UpdateUiEvent;
|
|
|
|
|
2023-06-28 22:03:48 +02:00
|
|
|
public static async Task Main(string[] args)
|
|
|
|
{
|
|
|
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
|
|
|
builder.RootComponents.Add<App>("#app");
|
|
|
|
builder.RootComponents.Add<HeadOutlet>("head::after");
|
|
|
|
|
|
|
|
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
|
|
|
builder.Services.AddMudServices(config =>
|
|
|
|
{
|
|
|
|
config.SnackbarConfiguration.ShowTransitionDuration = 100;
|
|
|
|
config.SnackbarConfiguration.HideTransitionDuration = 100;
|
2023-07-06 20:44:52 +02:00
|
|
|
config.SnackbarConfiguration.VisibleStateDuration = 5000;
|
2023-06-29 10:28:51 +02:00
|
|
|
config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomCenter;
|
2023-06-28 22:03:48 +02:00
|
|
|
});
|
|
|
|
builder.Services.AddBlazoredLocalStorage();
|
2023-07-04 21:20:33 +02:00
|
|
|
builder.Services.AddSpeechSynthesis();
|
2023-06-28 22:03:48 +02:00
|
|
|
|
|
|
|
await builder.Build().RunAsync();
|
|
|
|
}
|
2023-06-29 12:47:18 +02:00
|
|
|
|
|
|
|
public static void InvokeUiUpdate() => UpdateUiEvent?.Invoke();
|
2023-06-28 22:03:48 +02:00
|
|
|
}
|
|
|
|
}
|