diff --git a/BlazorClient/BlazorClient.csproj b/BlazorClient/BlazorClient.csproj
index da058a1..60333e1 100644
--- a/BlazorClient/BlazorClient.csproj
+++ b/BlazorClient/BlazorClient.csproj
@@ -10,14 +10,13 @@
-
-
-
-
+
+
+
diff --git a/BlazorClient/Pages/Play.razor b/BlazorClient/Pages/Play.razor
index 9e18b24..6663fd1 100644
--- a/BlazorClient/Pages/Play.razor
+++ b/BlazorClient/Pages/Play.razor
@@ -1,15 +1,7 @@
@page "/Play"
-@using Blazor.Extensions
-@using Blazor.Extensions.Canvas
-@using Blazor.Extensions.Canvas.Canvas2D
-@using Microsoft.AspNetCore.SignalR.Client
-@inject IJSRuntime JSRuntime
-@inject NavigationManager NavigationManager
-@inject ILogger Logger
+@using Snakes.BlazorUI
Sneks!
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/BlazorClient/Program.cs b/BlazorClient/Program.cs
index aea487b..d1a0d9b 100644
--- a/BlazorClient/Program.cs
+++ b/BlazorClient/Program.cs
@@ -1,5 +1,7 @@
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
+using Snakes.BlazorUI;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
+builder.Services.AddScoped();
await builder.Build().RunAsync();
diff --git a/BlazorUI/BlazorUI.csproj b/BlazorUI/BlazorUI.csproj
new file mode 100644
index 0000000..16f040a
--- /dev/null
+++ b/BlazorUI/BlazorUI.csproj
@@ -0,0 +1,24 @@
+
+
+
+ net6.0
+ enable
+ enable
+ Snakes.BlazorUI
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BlazorUI/GameJsInterop.cs b/BlazorUI/GameJsInterop.cs
new file mode 100644
index 0000000..6b4094e
--- /dev/null
+++ b/BlazorUI/GameJsInterop.cs
@@ -0,0 +1,42 @@
+using Microsoft.JSInterop;
+
+namespace Snakes.BlazorUI;
+
+public class GameJsInterop : IAsyncDisposable
+{
+ private readonly Lazy> _moduleTask;
+ private DotNetObjectReference? _instanceRef;
+
+ public GameJsInterop(IJSRuntime jsRuntime)
+ {
+ _moduleTask = new(() => jsRuntime.InvokeAsync(
+ "import", "./_content/BlazorUI/GameJsInterop.js").AsTask());
+ }
+
+ public async ValueTask InitializeGame(SnakeCanvas instance)
+ {
+ var module = await _moduleTask.Value;
+ _instanceRef = DotNetObjectReference.Create(instance);
+ await module.InvokeAsync