Adding a syndicate pairing page with some notes
This commit is contained in:
@@ -38,11 +38,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (Card.Faction != null)
|
||||
@if (Card.Syndicate != null)
|
||||
{
|
||||
<div class="detail-field">
|
||||
<span class="field-label"><i class="bi bi-flag-fill"></i> Syndicate</span>
|
||||
<span class="field-value">@Card.Faction</span>
|
||||
<span class="field-label"><i class="bi bi-diagram-3-fill"></i> Syndicate</span>
|
||||
<span class="field-value">@Card.Syndicate</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
@@ -176,10 +176,7 @@
|
||||
}
|
||||
|
||||
.detail-field.description {
|
||||
background: var(--bg-elevated);
|
||||
padding: 0.6rem 0.75rem;
|
||||
border-radius: var(--radius-sm);
|
||||
border-left: 3px solid var(--accent);
|
||||
padding: 0;
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
@@ -205,7 +202,6 @@
|
||||
|
||||
.detail-field.description .field-value {
|
||||
color: var(--text-primary);
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.card-detail::-webkit-scrollbar {
|
||||
|
||||
@@ -31,6 +31,11 @@
|
||||
<i class="bi bi-journal-text nav-icon"></i> Decks
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="syndicates">
|
||||
<i class="bi bi-diagram-2-fill nav-icon"></i> Syndicates
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="docs">
|
||||
<i class="bi bi-book-fill nav-icon"></i> Docs
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
@using System.Text.RegularExpressions
|
||||
@namespace Chrono.Components
|
||||
|
||||
@if (Doc != null)
|
||||
{
|
||||
<div class="modal-backdrop" @onclick="HandleBackdropClick"></div>
|
||||
<div class="card-detail card-detail-noimg">
|
||||
<button class="detail-close" @onclick="HandleClose"><i class="bi bi-x-lg"></i></button>
|
||||
<div class="detail-layout layout-noimg">
|
||||
<div class="detail-info">
|
||||
<div class="detail-header">
|
||||
<div class="syndicate-badges">
|
||||
@if (Doc.Syndicates != null)
|
||||
{
|
||||
foreach (var syn in Doc.Syndicates)
|
||||
{
|
||||
<span class="syn-icon @syn.ToLowerInvariant()" title="@syn"></span>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<h2>@Doc.Title</h2>
|
||||
</div>
|
||||
|
||||
@if (!string.IsNullOrWhiteSpace(Doc.Content))
|
||||
{
|
||||
<div class="detail-field description">
|
||||
<span class="field-value">@RenderDescription(Doc.Content)</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@code {
|
||||
[Parameter] public DocData? Doc { get; set; }
|
||||
[Parameter] public EventCallback OnClose { get; set; }
|
||||
[Parameter] public EventCallback<CardData> OnNavigate { get; set; }
|
||||
|
||||
private void HandleClose()
|
||||
{
|
||||
_ = OnClose.InvokeAsync();
|
||||
}
|
||||
|
||||
private void HandleBackdropClick()
|
||||
{
|
||||
_ = OnClose.InvokeAsync();
|
||||
}
|
||||
|
||||
private void Navigate(CardData card)
|
||||
{
|
||||
_ = OnNavigate.InvokeAsync(card);
|
||||
}
|
||||
|
||||
private static CardData? LookupCard(string cardName)
|
||||
{
|
||||
return CardDatabase.Cards.FirstOrDefault(c =>
|
||||
string.Equals(c.Name, cardName, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
private RenderFragment RenderDescription(string description)
|
||||
{
|
||||
return builder =>
|
||||
{
|
||||
var cardNames = CardDatabase.Cards
|
||||
.Select(c => c.Name)
|
||||
.Where(n => !string.IsNullOrWhiteSpace(n))
|
||||
.OrderByDescending(n => n.Length)
|
||||
.ToList();
|
||||
|
||||
var seq = 0;
|
||||
var remaining = description;
|
||||
|
||||
while (!string.IsNullOrEmpty(remaining))
|
||||
{
|
||||
var bestIdx = -1;
|
||||
string? bestName = null;
|
||||
|
||||
foreach (var name in cardNames)
|
||||
{
|
||||
var pattern = $@"\b{Regex.Escape(name)}\b";
|
||||
var match = Regex.Match(remaining, pattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (match.Success)
|
||||
{
|
||||
if (bestIdx == -1 || match.Index < bestIdx)
|
||||
{
|
||||
bestIdx = match.Index;
|
||||
bestName = match.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Also check for [[Card Name]] format which is common in docs
|
||||
var bracketMatch = Regex.Match(remaining, @"\[\[(.*?)\]\]");
|
||||
if (bracketMatch.Success)
|
||||
{
|
||||
if (bestIdx == -1 || bracketMatch.Index < bestIdx)
|
||||
{
|
||||
bestIdx = bracketMatch.Index;
|
||||
bestName = bracketMatch.Value;
|
||||
}
|
||||
}
|
||||
|
||||
if (bestIdx != -1 && bestName != null)
|
||||
{
|
||||
if (bestIdx > 0)
|
||||
builder.AddContent(seq++, remaining[..bestIdx]);
|
||||
|
||||
var cleanName = bestName.StartsWith("[[") && bestName.EndsWith("]]")
|
||||
? bestName.Substring(2, bestName.Length - 4)
|
||||
: bestName;
|
||||
|
||||
var card = LookupCard(cleanName);
|
||||
if (card != null)
|
||||
{
|
||||
builder.OpenElement(seq++, "button");
|
||||
builder.AddAttribute(seq++, "class", "inline-card-btn");
|
||||
builder.AddAttribute(seq++, "onclick",
|
||||
EventCallback.Factory.Create(this, () => Navigate(card)));
|
||||
builder.AddContent(seq++, cleanName);
|
||||
builder.CloseElement();
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.AddContent(seq++, cleanName);
|
||||
}
|
||||
|
||||
remaining = remaining[(bestIdx + bestName.Length)..];
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.AddContent(seq++, remaining);
|
||||
remaining = "";
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
.modal-backdrop {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1040;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
backdrop-filter: blur(4px);
|
||||
animation: fade-in 0.2s ease-out;
|
||||
}
|
||||
|
||||
@keyframes fade-in {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
.card-detail {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 1050;
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 20px;
|
||||
padding: 0;
|
||||
max-width: 1100px;
|
||||
width: 95vw;
|
||||
height: 90vh;
|
||||
max-height: 95vh;
|
||||
overflow-y: auto;
|
||||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
|
||||
color: var(--text-primary);
|
||||
animation: detail-enter 0.25s ease-out;
|
||||
}
|
||||
|
||||
@keyframes detail-enter {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate(-50%, -50%) scale(0.95);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translate(-50%, -50%) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.detail-close {
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
z-index: 1;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
color: var(--text-primary);
|
||||
width: 2.2rem;
|
||||
height: 2.2rem;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
font-size: 0.9rem;
|
||||
transition: all var(--transition);
|
||||
}
|
||||
|
||||
.detail-close:hover {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.detail-layout {
|
||||
display: flex;
|
||||
padding: 2.5rem 2rem 2rem;
|
||||
}
|
||||
|
||||
.detail-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.detail-header {
|
||||
text-align: center;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.syndicate-badges {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 0.75rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.syn-icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 50%;
|
||||
background: currentColor;
|
||||
box-shadow: 0 0 15px currentColor;
|
||||
border: 2px solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.detail-header h2 {
|
||||
margin: 0 0 0.5rem;
|
||||
font-size: 1.8rem;
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.02em;
|
||||
background: linear-gradient(135deg, #fff 0%, #aaa 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
}
|
||||
|
||||
.detail-meta {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.meta-badge {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
padding: 0.3rem 0.8rem;
|
||||
border-radius: 4px;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
color: var(--text-muted);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.detail-field {
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.detail-field .field-label {
|
||||
display: block;
|
||||
color: var(--text-muted);
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.detail-field .field-value {
|
||||
color: var(--text-secondary);
|
||||
font-size: 1rem;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.detail-field.description {
|
||||
padding: 0;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.detail-field.description .field-label {
|
||||
margin-bottom: 0.75rem;
|
||||
color: var(--accent);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.detail-field.description .field-value {
|
||||
color: var(--text-primary);
|
||||
display: block;
|
||||
font-size: 1.1rem;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
/* Syndicate Colors */
|
||||
.lifeblood { color: #ef5350; }
|
||||
.phasetide { color: #2196f3; }
|
||||
.silence { color: #9e9e9e; }
|
||||
.singularity { color: #ffffff; }
|
||||
.splintergleam { color: #4caf50; }
|
||||
.sungrace { color: #ffeb3b; }
|
||||
|
||||
.inline-card-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
font-weight: 600;
|
||||
color: var(--accent);
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 2px;
|
||||
text-decoration-color: rgba(108, 99, 255, 0.3);
|
||||
transition: all var(--transition);
|
||||
}
|
||||
|
||||
.inline-card-btn:hover {
|
||||
color: #7b73ff;
|
||||
text-decoration-color: #7b73ff;
|
||||
}
|
||||
|
||||
.card-detail::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
.card-detail::-webkit-scrollbar-thumb {
|
||||
background: var(--border);
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.card-detail {
|
||||
width: 95vw;
|
||||
max-height: 90vh;
|
||||
}
|
||||
.detail-layout {
|
||||
padding: 2rem 1.25rem;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user