Files
ChronoCCG/Chrono/Shared/Pages/Home.razor
T
2026-07-18 15:21:20 -04:00

65 lines
1.8 KiB
Plaintext

@implements IDisposable
@namespace Shared.Pages
@page "/home"
<PageTitle>Slop Game Reference - Chrono CCG</PageTitle>
<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.
</p>
<div class="hero-actions">
<a class="cta-button primary" href="/">
<i class="bi bi-collection-fill"></i> Browse Cards
</a>
<a class="cta-button secondary" href="/agents">
<i class="bi bi-people-fill"></i> Agents Data Table
</a>
<a class="cta-button secondary" href="/decks">
<i class="bi bi-journal-text"></i> View Decks
</a>
</div>
</div>
</div>
@code {
private string _countdownString = "00:00:00";
private Timer? _timer;
protected override void OnInitialized()
{
_timer = new 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();
}
}