Adding a syndicate pairing page with some notes
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
@implements IDisposable
|
||||
@namespace Shared.Pages
|
||||
@page "/home"
|
||||
|
||||
@@ -6,6 +7,10 @@
|
||||
<div class="home-hero">
|
||||
<div class="hero-glow"></div>
|
||||
<div class="hero-content">
|
||||
<div class="free-pack-countdown">
|
||||
<span class="countdown-label">Free Pack Countdown:</span>
|
||||
<span class="countdown-value">@_countdownString</span>
|
||||
</div>
|
||||
<h1 class="hero-title">Slop Game Reference - Chrono CCG</h1>
|
||||
<p class="hero-subtitle">
|
||||
AI generated website for reference notes on playing Chrono CCG.
|
||||
@@ -23,3 +28,36 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private string _countdownString = "00:00:00";
|
||||
private System.Threading.Timer? _timer;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
_timer = new System.Threading.Timer(_ =>
|
||||
{
|
||||
UpdateCountdown();
|
||||
InvokeAsync(StateHasChanged);
|
||||
}, null, 0, 1000);
|
||||
}
|
||||
|
||||
private void UpdateCountdown()
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
var target = now.Date.AddHours(20); // 8 PM today
|
||||
|
||||
if (now >= target)
|
||||
{
|
||||
target = target.AddDays(1); // 8 PM tomorrow
|
||||
}
|
||||
|
||||
var remaining = target - now;
|
||||
_countdownString = $"{(int)remaining.TotalHours:D2}:{remaining.Minutes:D2}:{remaining.Seconds:D2}";
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_timer?.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user