Vibe Google Analytics

This commit is contained in:
2026-06-25 18:55:04 -04:00
parent fdf8e754f5
commit 73ae3eac53
86 changed files with 53925 additions and 46039 deletions
+20 -14
View File
@@ -1,10 +1,11 @@
@page "/cards"
@inject HttpClient Http
@inject AnalyticsService AnalyticsService
<PageTitle>Chrono CCG - Card Gallery</PageTitle>
<HeadContent>
<meta name="description" content="Browse and filter all Chrono CCG cards. Explore agents, spells, and more." />
<meta name="description" content="Browse and filter all Chrono CCG cards. Explore agents, spells, and more."/>
</HeadContent>
<div class="gallery-container">
@@ -17,18 +18,19 @@
<button class="tab @(categoryFilter == "" ? "active" : "")" @onclick='@(() => SetCategory(""))'>
<i class="bi bi-grid-3x3-gap-fill"></i> All
</button>
<button class="tab agent @(categoryFilter == "Agent" ? "active" : "")" @onclick='@(() => SetCategory("Agent"))'>
<i class="bi bi-person-fill"></i> Agents
</button>
<button class="tab agent @(categoryFilter == "Immortalized" ? "active" : "")" @onclick='@(() => SetCategory("Immortalized"))'>
<button class="tab agent @(categoryFilter == "Immortalized" ? "active" : "")"
@onclick='@(() => SetCategory("Immortalized"))'>
<i class="bi bi-person-fill"></i> Immortalized
</button>
<!-- //Todo make agent being linked to immortal for side by side sorting
<button class="tab agent @(agentLink ? "active" : "")" @onclick='@(() => ToggleAgentLink())'>
<i class="bi bi-person-fill"></i> Link
</button>
-->
<!-- //Todo make agent being linked to immortal for side by side sorting
<button class="tab agent @(agentLink ? "active" : "")" @onclick='@(() => ToggleAgentLink())'>
<i class="bi bi-person-fill"></i> Link
</button>
-->
<button class="tab spell @(categoryFilter == "Spell" ? "active" : "")" @onclick='@(() => SetCategory("Spell"))'>
<i class="bi bi-wand"></i> Spells
</button>
@@ -118,7 +120,7 @@
{
<div class="card-grid @(showDetailedView ? "detailed-view" : "")">
@{ var idx = 0; }
@foreach (var card in filteredCards.Where(a=>a.Category is "Agent" or "Spell" or "Immortalized"))
@foreach (var card in filteredCards.Where(a => a.Category is "Agent" or "Spell" or "Immortalized"))
{
<div class="card-cell @(selectedCard == card ? "selected" : "")"
style="--i: @idx"
@@ -149,7 +151,7 @@
</div>
<div class="card-description-preview">@card.Description</div>
<div class="card-category-badge @card.Category?.ToLowerInvariant()">@card.Category</div>
</div>
}
</div>
@@ -171,7 +173,7 @@
@if (selectedCard != null)
{
<CardDialog Card="selectedCard" OnClose="CloseDetail" OnNavigate="SelectCard" />
<CardDialog Card="selectedCard" OnClose="CloseDetail" OnNavigate="SelectCard"/>
}
@code {
@@ -220,12 +222,12 @@
_ => sortDescending ? filtered.OrderByDescending(c => c.Name) : filtered.OrderBy(c => c.Name)
};
}
private void SetImmortal(string imm)
{
immortalFilter = immortalFilter == imm ? "" : imm;
}
private void ClearImmortalFilter()
{
immortalFilter = "";
@@ -234,11 +236,13 @@
private void SetCategory(string cat)
{
categoryFilter = categoryFilter == cat ? "" : cat;
_ = AnalyticsService.TrackEvent("filter_category", new { category = categoryFilter });
}
private void ClearCategoryFilter()
{
categoryFilter = "";
_ = AnalyticsService.TrackEvent("filter_category", new { category = "All" });
}
private void ClearFactionFilter()
@@ -250,7 +254,7 @@
{
agentLink = !agentLink;
}
private void ClearCostFilter()
{
costFilter = "";
@@ -264,6 +268,7 @@
private void SelectCard(CardData card)
{
selectedCard = card;
_ = AnalyticsService.TrackEvent("select_item", new { item_name = card.Name, item_category = card.Category });
}
private void CloseDetail()
@@ -278,4 +283,5 @@
factionFilter = "";
costFilter = "";
}
}