Move and rename Blazor project

This commit is contained in:
2024-03-07 21:23:37 +00:00
parent 3affeac196
commit a18b68beca
27 changed files with 1870 additions and 13 deletions

View File

@@ -0,0 +1,82 @@
@page "/"
@implements IDisposable
@inject IJSRuntime JSRuntime
<PageTitle>Home - Beau Findlay</PageTitle>
@if (!hasPreviouslyRendered)
{
<h1 class="text-4xl">
<Typewriter Text="Hi, I'm Beau."/>
</h1>
<p class="text-xl mt-4">
<Typewriter Name="@TypewriterConstants.Name.IntroComplete" Text="I'm a UK-based software engineer and I love building cool stuff."/>
</p>
<h2 class="text-2xl mt-16 font-semibold">
<Typewriter Text="A bit about me"/>
</h2>
<p class="text-xl mt-4">
<Typewriter Text="I mostly specialise in back-end C#/.NET development and I've built systems that scale for hundreds-of-thousands of global users."/>
</p>
<p class="text-xl mt-4">
<Typewriter Text="I'm currently heading up the tech as CTO at a cool startup called un:hurd."/>
</p>
}
else
{
<h1 class="text-4xl">Hi, I'm Beau.</h1>
<p class="text-xl mt-4">I'm a UK-based software engineer and I love building cool stuff.</p>
<h2 class="text-3xl mt-16 font-semibold">A bit about me</h2>
<p class="text-xl mt-4">I mostly specialise in back-end C#/.NET development and I've built systems that scale for hundreds-of-thousands of global users.</p>
<p class="text-xl mt-4">I'm currently heading up the tech as CTO at a cool startup called <a href="https://unhurd.co.uk" target="_blank" class="underline">un:hurd</a>.</p>
}
@code {
private const string ComponentKey = "ComponentRendered_Home";
private bool hasPreviouslyRendered;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
Typewriter.OnAllTypingCompleted += HandleTypingCompleted;
var renderedBeforeAsString = await JSRuntime.InvokeAsync<string>("localStorage.getItem", ComponentKey);
var previousValue = hasPreviouslyRendered;
hasPreviouslyRendered = !string.IsNullOrEmpty(renderedBeforeAsString) && bool.Parse(renderedBeforeAsString);
if (!hasPreviouslyRendered)
{
await JSRuntime.InvokeVoidAsync("localStorage.setItem", ComponentKey, "true");
}
if (previousValue != hasPreviouslyRendered)
{
StateHasChanged();
}
}
}
private static void HandleTypingCompleted()
{
Console.WriteLine("Typewriter finished typing.");
}
public void Dispose()
{
Typewriter.OnAllTypingCompleted -= HandleTypingCompleted;
}
}

View File

@@ -0,0 +1,7 @@
@page "/this"
<h3>ThisApp</h3>
@code {
}