Tech stack stub page and changing project to be just one Web Assembly project for now

This commit is contained in:
2026-05-27 11:25:04 -04:00
parent 8a20cfec4f
commit dd74f9b69f
140 changed files with 64156 additions and 97 deletions
+117
View File
@@ -0,0 +1,117 @@
@page "/building-calculator"
@using System.Text.Json
@using WebAssembly.Throwaway
<div class="calculator-page">
<h1>Building Plan Calculator</h1>
<p>Simulates resource income each turn and tracks build completion times for ordered buildings.</p>
<section>
<h2>Build Order</h2>
<table class="calculator-table">
<thead>
<tr>
<th>Turn Requested</th>
<th>Building</th>
<th>Finish Turn</th>
<th>Industry Remaining</th>
</tr>
</thead>
<tbody>
@foreach (var entry in Result.BuildOrder)
{
<tr>
<td>@entry.RequestedTurn</td>
<td>@entry.Name</td>
<td>@(entry.BuiltFinishTurn == 0 ? "Starting" : entry.BuiltFinishTurn.ToString())</td>
<td>@entry.IndustryCostRemaining</td>
</tr>
}
</tbody>
</table>
</section>
<section>
<h2>Gold Over Time</h2>
<table class="calculator-table">
<thead>
<tr>
<th>Turn</th>
<th>Stored Gold</th>
<th>Income</th>
<th>Upkeep</th>
</tr>
</thead>
<tbody>
@foreach (var snapshot in Result.ResourceHistory)
{
<tr>
<td>@snapshot.Turn</td>
<td>@snapshot.Stored.Gold</td>
<td>@snapshot.TotalIncome.Gold</td>
<td>@snapshot.TotalUpkeep.Gold</td>
</tr>
}
</tbody>
</table>
</section>
<section>
<h2>Result JSON</h2>
<pre class="json-output">@Json</pre>
</section>
</div>
@code {
private BuildPlanResult Result = new();
private string Json = string.Empty;
protected override void OnInitialized()
{
Result = BuildingPlanCalculator.CreateSampleBuildPlan();
Json = JsonSerializer.Serialize(Result, new JsonSerializerOptions
{
WriteIndented = true
});
}
}
<style>
.calculator-page {
padding: 2rem;
max-width: 1100px;
margin: 0 auto;
}
.calculator-table {
width: 100%;
border-collapse: collapse;
margin-bottom: 1.75rem;
}
.calculator-table th,
.calculator-table td {
padding: 0.75rem 1rem;
border: 1px solid #d3d3d3;
text-align: left;
font-size: 0.95rem;
}
.calculator-table th {
background-color: #f3f6fb;
font-weight: 600;
}
.json-output {
display: block;
white-space: pre-wrap;
background: #1f2937;
color: #f8fafc;
padding: 1rem;
border-radius: 0.5rem;
overflow-x: auto;
font-family: Consolas, "Courier New", monospace;
font-size: 0.9rem;
}
</style>
+19
View File
@@ -0,0 +1,19 @@
@page "/counter"
<PageTitle>Counter</PageTitle>
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}
+185
View File
@@ -0,0 +1,185 @@
@page "/"
@using WebAssembly.Data
<div class="home-container">
<h1>Welcome to AOW4 Game Reference</h1>
<p class="subtitle">Basic game reference project developed with AI assisted coding and agents.</p>
<div class="sections-grid">
@foreach (var section in sections)
{
<div class="section-card">
<div class="section-header">
<h2>@section.Name</h2>
@if (!string.IsNullOrEmpty(section.Description))
{
<p class="section-description">@section.Description</p>
}
</div>
<div class="section-links">
@if (section.Links.Any())
{
<ul>
@foreach (var link in section.Links)
{
<li>
<a href="@link.Url">
<span class="link-title">@link.Title</span>
@if (!string.IsNullOrEmpty(link.Description))
{
<span class="link-description">@link.Description</span>
}
</a>
</li>
}
</ul>
}
else
{
<p class="no-links">Coming soon...</p>
}
</div>
</div>
}
</div>
</div>
@code {
private List<Section> sections = new();
protected override void OnInitialized()
{
sections = SectionsData.GetAllSections();
}
}
<style>
.home-container {
padding: 2rem;
max-width: 1200px;
margin: 0 auto;
}
h1 {
text-align: center;
font-size: 2.5rem;
margin-bottom: 0.5rem;
color: #333;
}
.subtitle {
text-align: center;
font-size: 1.1rem;
color: #666;
margin-bottom: 2rem;
}
.sections-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
gap: 2rem;
margin-bottom: 2rem;
}
.section-card {
border: 2px solid #e0e0e0;
border-radius: 8px;
overflow: hidden;
background-color: #ffffff;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
transition: box-shadow 0.3s ease, transform 0.3s ease;
display: flex;
flex-direction: column;
}
.section-card:hover {
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
transform: translateY(-2px);
}
.section-header {
padding: 1.5rem;
border-bottom: 2px solid #e0e0e0;
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}
.section-header h2 {
margin: 0 0 0.5rem 0;
font-size: 1.8rem;
color: #333;
}
.section-description {
margin: 0;
font-size: 0.95rem;
color: #666;
}
.section-links {
padding: 1.5rem;
flex-grow: 1;
}
.section-links ul {
list-style: none;
padding: 0;
margin: 0;
}
.section-links li {
margin-bottom: 0.75rem;
}
.section-links li:last-child {
margin-bottom: 0;
}
.section-links a {
display: flex;
flex-direction: column;
padding: 0.75rem 1rem;
background-color: #f9f9f9;
border-left: 4px solid #4a90e2;
text-decoration: none;
border-radius: 4px;
transition: all 0.2s ease;
}
.section-links a:hover {
background-color: #f0f0f0;
border-left-color: #2563eb;
padding-left: 1.25rem;
}
.link-title {
font-weight: 600;
color: #2c3e50;
font-size: 0.95rem;
}
.link-description {
font-size: 0.85rem;
color: #7f8c8d;
margin-top: 0.25rem;
}
.no-links {
text-align: center;
color: #bdc3c7;
font-style: italic;
padding: 2rem 0;
margin: 0;
}
@@media (max-width: 768px) {
.sections-grid {
grid-template-columns: 1fr;
}
h1 {
font-size: 2rem;
}
}
</style>
@@ -0,0 +1,106 @@
@page "/references/magic-materials"
@using WebAssembly.Data
<div class="page-container">
<h1>Magic Materials Reference</h1>
<p class="subtitle">A reference view of the `MagicMaterial` data loaded from `MagicMaterialsData.RawData`.</p>
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Name</th>
<th>Category</th>
<th>Annex Resources</th>
<th>Global Bonus</th>
<th>Infusion 1</th>
<th>Infusion 2</th>
<th>Infusion 3</th>
</tr>
</thead>
<tbody>
@foreach (var material in MagicMaterialsData.RawData)
{
<tr>
<td>@material.Name</td>
<td>@material.Category</td>
<td>@FormatAnnexResources(material)</td>
<td>@material.GlobalBonus</td>
<td>
<div class="preformatted">@material.InfusionEffects1</div>
</td>
<td>
<div class="preformatted">@material.InfusionEffects2</div>
</td>
<td>
<div class="preformatted">@material.InfusionEffects3</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
@code {
private static string FormatAnnexResources(MagicMaterial material)
{
var parts = new List<string>();
void Add(string label, int? value)
{
if (value.HasValue)
{
parts.Add(value.Value < 0 ? $"{value.Value}% {label}" : $"+{value.Value} {label}");
}
}
Add("Production", material.IncreaseProduction);
Add("Gold", material.IncreaseGold);
Add("Mana", material.IncreaseMana);
Add("Draft", material.IncreaseDraft);
Add("Knowledge", material.IncreaseKnowledge);
Add("Food", material.IncreaseFood);
Add("Stability", material.IncreaseStability);
Add("Imperium", material.IncreaseImperium);
Add("Allegiance from Whispering Stones", material.IncreaseAllegianceFromWhisperingStones);
Add("Relations with Free Cities and Rulers", material.IncreaseRelationWithFreeCitiesAndRulers);
Add("Combat Casting Points", material.IncreaseCombatCastingPoints);
Add("World Map Casting Points", material.IncreaseWorldCastingPoints);
Add("HP Regeneration", material.IncreaseHpRegen);
Add("Hit Points", material.IncreaseHitPoints);
Add("Experience Percent", material.IncreaseExperiencePercent);
Add("Allegiance from Umbral Dwellings", material.IncreaseAllegianceFromUmbralDwellings);
Add("Draft Cost Reduction", material.DecreaseDraftCostPercent);
Add("Recruitment Cost Reduction", material.DecreaseRecruitmentCostPercent);
Add("Knowledge Research Cost Reduction", material.DecreaseKnowledgeResearchCostPercent);
Add("Turn Reduction to Found/Absorb/Migrate", material.DecreaseTurnsTakenToFoundAbsorbMigrateCities);
return parts.Count > 0 ? string.Join("; ", parts) : "—";
}
}
<style>
.page-container {
padding: 2rem;
max-width: 1200px;
margin: 0 auto;
}
.subtitle {
color: #666;
margin-bottom: 1.5rem;
}
.table-responsive {
overflow-x: auto;
}
.preformatted {
white-space: pre-wrap;
font-family: var(--bs-font-sans-serif);
color: #333;
}
</style>
+5
View File
@@ -0,0 +1,5 @@
@page "/not-found"
@layout MainLayout
<h3>Not Found</h3>
<p>Sorry, the content you are looking for does not exist.</p>
@@ -0,0 +1,75 @@
@page "/references/province-improvements"
@using WebAssembly.Data
<div class="page-container">
<h1>Province Improvements Reference</h1>
<p class="subtitle">A reference view of the `ProvinceImprovement` data loaded from
`ProvinceImprovementsData.RawData`.</p>
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Name</th>
<th>Category</th>
<th>Source</th>
<th>Cost (Prod/Gold)</th>
<th>Effects</th>
<th>Requirements</th>
</tr>
</thead>
<tbody>
@foreach (var improvement in ProvinceImprovementsData.RawData)
{
<tr>
<td>@improvement.Name</td>
<td>@improvement.Category</td>
<td>@improvement.Source</td>
<td>@improvement.CostProduction / @improvement.CostGold</td>
<td>
<div class="preformatted">@improvement.Effects</div>
</td>
<td>
<div class="preformatted">@improvement.Requirements</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
@code {
}
<style>
.page-container {
padding: 2rem;
max-width: 1400px;
margin: 0 auto;
}
.subtitle {
color: #666;
margin-bottom: 1.5rem;
}
.table-responsive {
overflow-x: auto;
}
.preformatted {
white-space: pre-wrap;
font-family: var(--bs-font-sans-serif);
color: #333;
}
.table {
font-size: 0.9rem;
}
.table th {
background-color: #f8f9fa;
font-weight: 600;
}
</style>
+78
View File
@@ -0,0 +1,78 @@
@page "/tech-stack"
@using MudBlazor
@using WebAssembly.Services
@inject IMyDialogService DialogService
<div class="techStackPage">
<h1>Tech Stack</h1>
<div class="techStackGrid">
@foreach (var tech in Data.TechStackData.RawData)
{
<div class="techStackItem @(tech.InUse ? "" : "notInUse")" @onclick="() => OpenDialog(tech)">
<div class="techStackName">@tech.Name</div>
<div class="techStackDescription">@tech.Description</div>
</div>
}
</div>
</div>
<style>
.techStackPage {
padding: 20px;
color: white;
}
h1 {
margin-bottom: 30px;
}
.techStackGrid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 20px;
}
.techStackItem {
background-color: var(--paper);
border: 1px solid var(--paper-border);
border-radius: var(--dialog-radius);
padding: 20px;
cursor: pointer;
transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.techStackItem:hover {
background-color: var(--paper-hover);
border-color: var(--paper-border-hover);
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}
.techStackItem.notInUse {
opacity: 0.5;
filter: grayscale(1);
}
.techStackName {
font-size: 1.5em;
font-weight: bold;
margin-bottom: 10px;
}
.techStackDescription {
font-size: 1em;
color: #ccc;
}
</style>
@code {
private void OpenDialog(Data.TechStack tech)
{
DialogService.Show(new DialogContents
{
Title = tech.Name,
TechStack = tech
});
}
}
+60
View File
@@ -0,0 +1,60 @@
@page "/weather"
@inject HttpClient Http
<PageTitle>Weather</PageTitle>
<h1>Weather</h1>
<p>This component demonstrates fetching data from the server.</p>
@if (forecasts == null)
{
<p>
<em>Loading...</em>
</p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th aria-label="Temperature in Celsius">Temp. (C)</th>
<th aria-label="Temperature in Fahrenheit">Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}
@code {
private WeatherForecast[]? forecasts;
protected override async Task OnInitializedAsync()
{
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
}
public class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public string? Summary { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
}