...vibing UI

This commit is contained in:
2026-06-17 22:04:42 -04:00
parent 36bd610ca4
commit 1d05e18306
26 changed files with 7210 additions and 6 deletions
+5
View File
@@ -19,6 +19,11 @@
<span class="bi bi-keyboard-nav-menu" aria-hidden="true"></span> Keyboard
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="docs">
<span class="bi bi-book-nav-menu" aria-hidden="true"></span> Docs
</NavLink>
</div>
</nav>
</div>
+331
View File
@@ -0,0 +1,331 @@
@page "/docs"
@using System.Text.RegularExpressions
<PageTitle>Fellowship Docs</PageTitle>
<div class="docs-page">
<div class="docs-header">
<h1 class="docs-title">Fellowship Reference</h1>
<p class="docs-subtitle">@DocsData.All.Count entries across @Groups.Count() categories</p>
<div class="docs-search">
<span class="search-icon">&#x1F50D;</span>
<input type="text" class="search-input" placeholder="Search docs..." @bind="searchTerm" @bind:after="OnSearchChanged" />
@if (!string.IsNullOrEmpty(searchTerm))
{
<button class="search-clear" @onclick="ClearSearch">&times;</button>
}
</div>
<div class="docs-filter-bar">
<button class="filter-btn @(activeFilter == null ? "active" : "")" @onclick="FilterAll">All</button>
<button class="filter-btn @(activeFilter == "Skill" ? "active" : "")" @onclick="FilterSkills">Skills</button>
<button class="filter-btn @(activeFilter == "Debuff" ? "active" : "")" @onclick="FilterDebuffs">Debuffs</button>
<button class="filter-btn @(activeFilter == "Buff" ? "active" : "")" @onclick="FilterBuffs">Buffs</button>
<button class="filter-btn @(activeFilter == "Key" ? "active" : "")" @onclick="FilterKeys">Keys</button>
</div>
</div>
<div class="docs-body">
<nav class="docs-sidebar">
<div class="sidebar-inner">
@foreach (var group in FilteredGroups)
{
var groupId = GetGroupId(group.Key);
<div class="sidebar-group">
<a class="sidebar-group-title" href="@($"#{groupId}")">@group.Key</a>
<div class="sidebar-items">
@foreach (var doc in group)
{
var docId = GetDocId(doc);
<a class="sidebar-item" href="@($"#{docId}")" title="@doc.FileName">
<span class="sidebar-item-badge @GetTypeClass(doc)"></span>
@GetDisplayName(doc)
</a>
}
</div>
</div>
}
</div>
</nav>
<div class="docs-content">
@if (!FilteredGroups.Any())
{
<div class="no-results">
<p>No docs match "@searchTerm"</p>
<button class="filter-btn" @onclick="ClearSearch">Clear search</button>
</div>
}
@foreach (var group in FilteredGroups)
{
var groupId = GetGroupId(group.Key);
<section class="group-section">
<div class="group-header" id="@groupId">
<h2 class="group-title">@group.Key</h2>
<span class="group-count">@group.Count()</span>
</div>
@foreach (var doc in group)
{
var docId = GetDocId(doc);
var typeName = doc.GetType().Name.Replace("Doc", "");
<article class="doc-card" id="@docId">
<div class="doc-card-header">
<div class="doc-card-title-row">
<h3 class="doc-card-title">@GetDisplayName(doc)</h3>
<span class="doc-type-badge @GetTypeClass(doc)">@typeName</span>
</div>
@if (doc is SkillDoc { Key: { } key } && !string.IsNullOrEmpty(key))
{
<div class="doc-key-badge">
<span class="key-icon">&#x2328;</span>
<span class="key-text">@key</span>
</div>
}
</div>
<div class="doc-card-body">
@if (doc is SkillDoc { Description: { } desc } && !string.IsNullOrEmpty(desc))
{
<div class="doc-description">
@{
var lines = desc.Split('\n');
foreach (var line in lines)
{
<p>@RenderWikiLinks(line)</p>
}
}
</div>
}
<div class="doc-fields">
@foreach (var field in GetOrderedFields(doc))
{
<div class="doc-field">
<span class="doc-field-label">@field.Label</span>
<span class="doc-field-value">@field.Value</span>
</div>
}
</div>
@if (GetBody(doc) is { } body && !string.IsNullOrWhiteSpace(body) && (doc is not SkillDoc || string.IsNullOrWhiteSpace(((SkillDoc)doc).Description)))
{
<div class="doc-body">
<pre class="doc-body-text">@body.Trim()</pre>
</div>
}
</div>
@if (doc is SkillDoc { Tags: { } tags } && tags.Count > 0)
{
<div class="doc-card-footer">
@foreach (var tag in tags)
{
<span class="tag-badge">@tag</span>
}
</div>
}
</article>
}
</section>
}
</div>
</div>
</div>
@code {
private string? searchTerm;
private string? activeFilter;
private List<IGrouping<string, DocEntry>> Groups = [];
private IEnumerable<IGrouping<string, DocEntry>> FilteredGroups => Groups
.Where(g => g.Any(d => MatchesFilter(d)))
.OrderBy(g => SortOrder(g.Key));
protected override void OnInitialized()
{
Groups = DocsData.All
.GroupBy(d => GetCharacterOrType(d))
.ToList();
}
private bool MatchesFilter(DocEntry doc)
{
if (!string.IsNullOrEmpty(searchTerm))
{
var term = searchTerm.Trim().ToLowerInvariant();
var name = GetDisplayName(doc).ToLowerInvariant();
if (!name.Contains(term)) return false;
}
if (activeFilter != null)
{
var type = doc.GetType().Name.Replace("Doc", "");
if (type != activeFilter) return false;
}
return true;
}
private static int SortOrder(string groupKey) => groupKey switch
{
"Xavian" => 0,
"Rime" => 1,
"Vigour" => 2,
"Keys" => 3,
_ => 99
};
private void OnSearchChanged()
{
StateHasChanged();
}
private void ClearSearch()
{
searchTerm = null;
activeFilter = null;
}
private void FilterAll() { activeFilter = null; }
private void FilterSkills() { activeFilter = activeFilter == "Skill" ? null : "Skill"; }
private void FilterDebuffs() { activeFilter = activeFilter == "Debuff" ? null : "Debuff"; }
private void FilterBuffs() { activeFilter = activeFilter == "Buff" ? null : "Buff"; }
private void FilterKeys() { activeFilter = activeFilter == "Key" ? null : "Key"; }
private static string GetCharacterOrType(DocEntry doc) => doc switch
{
SkillDoc s => s.Character,
DebuffDoc d => d.Character,
BuffDoc b => b.Character,
CharacterDoc c => c.Character,
KeyDoc => "Keys",
_ => "Other"
};
private static string GetDisplayName(DocEntry doc) =>
Path.GetFileNameWithoutExtension(doc.FileName);
private static string GetGroupId(string group) =>
$"group-{group.GetHashCode():x}";
private static string GetDocId(DocEntry doc) =>
$"doc-{doc.FileName.GetHashCode():x}";
private static string GetTypeClass(DocEntry doc) => doc switch
{
SkillDoc => "type-skill",
DebuffDoc => "type-debuff",
BuffDoc => "type-buff",
KeyDoc => "type-key",
CharacterDoc => "type-character",
_ => ""
};
private static MarkupString RenderWikiLinks(string line)
{
var result = Regex.Replace(line, @"\[\[([^\]]+)\]\]", m =>
{
var name = m.Groups[1].Value;
return $"<span class=\"wiki-link\">{name}</span>";
});
return new MarkupString(result);
}
private static readonly Dictionary<string, string> FieldLabels = new()
{
["Character"] = "Character",
["Cast"] = "Cast Time",
["Key"] = "Key Bind",
["Range"] = "Range",
["Damage"] = "Damage",
["DamageType"] = "Damage Type",
["Heal"] = "Healing",
["Shield"] = "Shield",
["Cooldown"] = "Cooldown",
["Mana"] = "Mana Cost",
["OffGlobalCooldown"] = "Off GCD",
["Gdc"] = "GDC",
["Duration"] = "Duration",
["DamageReduction"] = "Dmg Reduction",
["DamageTickTime"] = "Tick Interval",
["IsToggle"] = "Toggle",
["ManaUpkeepTick"] = "Mana Upkeep",
["ParryChance"] = "Parry Chance",
["DamageRedirection"] = "Dmg Redirection",
["SpiritCost"] = "Spirit Cost",
["SecondEffectDuration"] = "Effect 2 Duration",
["SecondEffectDamageReduction"] = "Effect 2 Dmg Reduction",
["HealingDuration"] = "Healing Duration",
["HealingTickTime"] = "Healing Tick",
["CostSwiftReprieval"] = "Cost: Swift Reprieval",
["GdcDuration"] = "GDC Duration",
["Effect"] = "Effect",
["GeneratesSpirit"] = "Generates Spirit",
["AreaDamagePercentage"] = "Cleave %",
["SwiftReprievalChance"] = "Swift Reprieval %",
["MaxStacks"] = "Max Stacks",
["Action"] = "Action",
["ParryChanceBonus"] = "Parry Bonus",
["ManaRestoreBase"] = "Mana Restore Base",
["ManaRestorePerStack"] = "Mana Per Stack",
["Order"] = "Order",
["Priority"] = "Priority",
["Completed"] = "Completed",
["Raw"] = "Raw",
};
private static readonly Dictionary<Type, string[]> FieldOrder = new()
{
[typeof(SkillDoc)] = ["Character", "Cast", "Key", "Range", "Damage", "DamageType", "Heal", "Shield", "Cooldown", "Mana", "OffGlobalCooldown", "Gdc", "Duration", "DamageReduction", "DamageTickTime", "IsToggle", "ManaUpkeepTick", "ParryChance", "DamageRedirection", "GeneratesSpirit", "AreaDamagePercentage", "SwiftReprievalChance", "Effect", "SpiritCost", "SecondEffectDuration", "SecondEffectDamageReduction", "HealingDuration", "HealingTickTime", "CostSwiftReprieval", "GdcDuration"],
[typeof(DebuffDoc)] = ["Character", "MaxStacks", "Duration", "ParryChanceBonus", "ManaRestoreBase", "ManaRestorePerStack"],
[typeof(BuffDoc)] = ["Character", "MaxStacks"],
[typeof(KeyDoc)] = ["Action"],
[typeof(CharacterDoc)] = ["Character"],
};
private static List<FieldEntry> GetOrderedFields(DocEntry doc)
{
var result = new List<FieldEntry>();
var type = doc.GetType();
var order = FieldOrder.GetValueOrDefault(type, []);
var allProps = new Dictionary<string, string>();
foreach (var prop in type.GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance))
{
var name = prop.Name;
if (name is "FileName" or "FilePath" or "Body" or "Description") continue;
var value = prop.GetValue(doc);
if (value == null) continue;
if (value is bool bVal && !bVal) continue;
if (value is string s && string.IsNullOrEmpty(s)) continue;
var display = value switch
{
List<string> list => string.Join(", ", list),
_ => value.ToString()
};
if (string.IsNullOrEmpty(display)) continue;
allProps[name] = display;
}
foreach (var key in order)
{
if (allProps.Remove(key, out var val))
{
result.Add(new FieldEntry(FieldLabels.GetValueOrDefault(key, key), val));
}
}
foreach (var (key, val) in allProps)
{
result.Add(new FieldEntry(FieldLabels.GetValueOrDefault(key, key), val));
}
return result;
}
private static string? GetBody(DocEntry doc) => doc.Body;
private record FieldEntry(string Label, string Value);
}
+433
View File
@@ -0,0 +1,433 @@
.docs-page {
max-width: 1400px;
margin: 0 auto;
color: #e0e0e0;
}
.docs-header {
padding: 24px 0 16px;
border-bottom: 1px solid #2a2a2a;
margin-bottom: 20px;
}
.docs-title {
font-size: 28px;
font-weight: 700;
color: #fff;
margin: 0 0 4px;
}
.docs-subtitle {
color: #888;
font-size: 13px;
margin: 0 0 16px;
}
.docs-search {
position: relative;
margin-bottom: 12px;
}
.search-icon {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
font-size: 14px;
opacity: 0.5;
pointer-events: none;
}
.search-input {
width: 100%;
padding: 10px 36px 10px 36px;
border: 1px solid #333;
border-radius: 8px;
background: #1a1a1a;
color: #e0e0e0;
font-size: 14px;
outline: none;
transition: border-color 0.2s, box-shadow 0.2s;
box-sizing: border-box;
}
.search-input:focus {
border-color: #5588ff;
box-shadow: 0 0 0 3px rgba(85, 136, 255, 0.15);
}
.search-input::placeholder {
color: #555;
}
.search-clear {
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
background: none;
border: none;
color: #888;
font-size: 20px;
cursor: pointer;
padding: 4px 8px;
line-height: 1;
}
.search-clear:hover {
color: #fff;
}
.docs-filter-bar {
display: flex;
gap: 6px;
flex-wrap: wrap;
}
.filter-btn {
padding: 6px 14px;
border: 1px solid #333;
border-radius: 6px;
background: transparent;
color: #aaa;
font-size: 13px;
cursor: pointer;
transition: all 0.15s;
}
.filter-btn:hover {
border-color: #5588ff;
color: #5588ff;
background: rgba(85, 136, 255, 0.08);
}
.filter-btn.active {
border-color: #5588ff;
color: #fff;
background: #5588ff;
}
.docs-body {
display: flex;
gap: 28px;
}
.docs-sidebar {
width: 220px;
flex-shrink: 0;
}
.sidebar-inner {
position: sticky;
top: 16px;
max-height: calc(100vh - 120px);
overflow-y: auto;
padding-right: 4px;
}
.sidebar-inner::-webkit-scrollbar {
width: 4px;
}
.sidebar-inner::-webkit-scrollbar-thumb {
background: #333;
border-radius: 2px;
}
.sidebar-group {
margin-bottom: 16px;
}
.sidebar-group-title {
display: block;
font-size: 11px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 1.2px;
color: #666;
text-decoration: none;
padding: 4px 8px;
margin-bottom: 4px;
transition: color 0.15s;
}
.sidebar-group-title:hover {
color: #aaa;
}
.sidebar-items {
display: flex;
flex-direction: column;
}
.sidebar-item {
display: flex;
align-items: center;
gap: 8px;
padding: 5px 8px 5px 12px;
font-size: 13px;
color: #999;
text-decoration: none;
border-radius: 4px;
transition: all 0.15s;
line-height: 1.3;
}
.sidebar-item:hover {
background: rgba(255, 255, 255, 0.04);
color: #ddd;
}
.sidebar-item-badge {
width: 8px;
height: 8px;
border-radius: 50%;
flex-shrink: 0;
}
.sidebar-item-badge.type-skill { background: #5588ff; }
.sidebar-item-badge.type-debuff { background: #ff5544; }
.sidebar-item-badge.type-buff { background: #44bb66; }
.sidebar-item-badge.type-key { background: #888; }
.sidebar-item-badge.type-character { background: #ffaa33; }
.docs-content {
flex: 1;
min-width: 0;
}
.no-results {
text-align: center;
padding: 60px 20px;
color: #888;
}
.no-results p {
font-size: 16px;
margin-bottom: 16px;
}
.group-section {
margin-bottom: 32px;
}
.group-header {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 16px;
padding-bottom: 8px;
border-bottom: 2px solid #2a2a2a;
}
.group-title {
font-size: 22px;
font-weight: 700;
color: #fff;
margin: 0;
}
.group-count {
font-size: 12px;
color: #666;
background: #1a1a1a;
padding: 2px 10px;
border-radius: 10px;
font-weight: 600;
}
.doc-card {
background: #161616;
border: 1px solid #2a2a2a;
border-radius: 12px;
margin-bottom: 16px;
overflow: hidden;
transition: border-color 0.2s, box-shadow 0.2s;
}
.doc-card:hover {
border-color: #3a3a3a;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.doc-card-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 16px 20px 12px;
background: linear-gradient(135deg, #1e1e1e, #181818);
border-bottom: 1px solid #2a2a2a;
gap: 12px;
}
.doc-card-title-row {
display: flex;
align-items: center;
gap: 10px;
min-width: 0;
}
.doc-card-title {
font-size: 17px;
font-weight: 700;
color: #fff;
margin: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.doc-type-badge {
font-size: 10px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.8px;
padding: 3px 10px;
border-radius: 4px;
white-space: nowrap;
}
.doc-type-badge.type-skill { background: rgba(85, 136, 255, 0.15); color: #7799ff; border: 1px solid rgba(85, 136, 255, 0.3); }
.doc-type-badge.type-debuff { background: rgba(255, 85, 68, 0.15); color: #ff7766; border: 1px solid rgba(255, 85, 68, 0.3); }
.doc-type-badge.type-buff { background: rgba(68, 187, 102, 0.15); color: #66dd88; border: 1px solid rgba(68, 187, 102, 0.3); }
.doc-type-badge.type-key { background: rgba(136, 136, 136, 0.15); color: #aaa; border: 1px solid rgba(136, 136, 136, 0.3); }
.doc-type-badge.type-character { background: rgba(255, 170, 51, 0.15); color: #ffbb55; border: 1px solid rgba(255, 170, 51, 0.3); }
.doc-key-badge {
display: flex;
align-items: center;
gap: 6px;
background: #0f0f0f;
border: 1px solid #333;
border-radius: 6px;
padding: 5px 12px;
flex-shrink: 0;
}
.key-icon {
font-size: 14px;
opacity: 0.6;
}
.key-text {
font-size: 13px;
font-weight: 700;
color: #fff;
font-family: 'Courier New', monospace;
}
.doc-card-body {
padding: 16px 20px;
}
.doc-description {
margin-bottom: 14px;
padding: 12px 16px;
background: #121212;
border-radius: 8px;
border: 1px solid #222;
}
.doc-description p {
margin: 0 0 4px;
font-size: 14px;
line-height: 1.6;
color: #ccc;
}
.doc-description p:last-child {
margin-bottom: 0;
}
.wiki-link {
color: #7799ff;
font-weight: 600;
border-bottom: 1px dashed rgba(85, 136, 255, 0.3);
cursor: default;
}
.doc-fields {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 6px 16px;
}
.doc-field {
display: flex;
flex-direction: column;
padding: 6px 10px;
background: #131313;
border-radius: 6px;
border: 1px solid #222;
}
.doc-field-label {
font-size: 10px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.6px;
color: #666;
margin-bottom: 2px;
}
.doc-field-value {
font-size: 14px;
color: #ddd;
font-weight: 500;
word-break: break-word;
}
.doc-body {
margin-top: 14px;
padding: 12px 16px;
background: #0f0f0f;
border-radius: 8px;
border: 1px solid #1a1a1a;
}
.doc-body-text {
margin: 0;
font-size: 13px;
line-height: 1.5;
color: #888;
white-space: pre-wrap;
font-family: inherit;
}
.doc-card-footer {
display: flex;
flex-wrap: wrap;
gap: 6px;
padding: 10px 20px 14px;
border-top: 1px solid #222;
}
.tag-badge {
font-size: 11px;
padding: 4px 12px;
border-radius: 4px;
background: rgba(85, 136, 255, 0.1);
color: #7799ff;
border: 1px solid rgba(85, 136, 255, 0.2);
font-weight: 500;
}
@media (max-width: 900px) {
.docs-sidebar {
display: none;
}
.docs-fields {
grid-template-columns: 1fr 1fr;
}
}
@media (max-width: 600px) {
.doc-card-header {
flex-direction: column;
}
.doc-fields {
grid-template-columns: 1fr;
}
}
+3
View File
@@ -16,4 +16,7 @@
<ProjectReference Include="..\Model\Model.csproj" />
</ItemGroup>
<Target Name="GenerateDocs" BeforeTargets="BeforeBuild">
<Exec Command="dotnet run --project ../Build/Build.csproj" />
</Target>
</Project>
+1
View File
@@ -6,5 +6,6 @@
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using Microsoft.JSInterop
@using Model
@using Web
@using Web.Layout