Initial start on UI redesign

This commit is contained in:
Tony Bark 2024-09-19 07:50:36 -04:00
parent ebfe2d644c
commit 215dfbb45a
6 changed files with 72 additions and 91 deletions

View file

@ -1,18 +0,0 @@
@inject IJSRuntime JsRuntime
<a @onclick="OpenBrowserAsync">@Text</a>
@code {
[Parameter]
[Required]
public string? Text { get; set; }
[Parameter]
[Required]
public string? Address { get; set; }
private async Task OpenBrowserAsync()
{
await JsRuntime.InvokeAsync<string>("__TAURI__.tauri.invoke", "open_browser", new { address = Address });
}
}

View file

@ -0,0 +1,24 @@
@inject IJSRuntime JsRuntime
@if (IsButton)
{
<button @onclick="OpenBrowserAsync">@Text</button>
}
else
{
<a @onclick="OpenBrowserAsync">@Text</a>
}
@code {
[Parameter] public string? Text { get; set; }
[Parameter] public string? Address { get; set; }
[Parameter] public bool IsButton { get; set; }
private async Task OpenBrowserAsync()
{
await JsRuntime.InvokeAsync<string>("__TAURI__.tauri.invoke", "open_browser", new { address = Address });
}
}

View file

@ -5,6 +5,9 @@
<input id="greet-input" placeholder="3-character Station Code" @bind="Code" />
<button type="submit">Submit</button>
</form>
<p>Search
<OpenBrowser Text="Station Codes" Address="https://dixielandsoftware.net/Amtrak/solari/StationSearch.html" />
</p>
@code
{

View file

@ -1,43 +1,44 @@
@page "/"
<FluentLayout>
<FluentHeader>
<img src="img/amtkstat.svg" class="logo" alt="Amtrak Status" />
</FluentHeader>
<div class="container">
<div class="container">
<img src="img/amtkstat.svg" class="logo" alt="Amtrak Status" />
<StationInput />
<p>Search
<LaunchBrowser Text="Station Codes" Address="https://dixielandsoftware.net/Amtrak/solari/StationSearch.html" />
</p>
<div class="row">
<div class="container">
<StationBtn Code="NYP" Name="NY Penn Station" />
<StationForm />
<div class="row">
<div class="container">
<StationBtn Code="NYP" Name="NY Penn Station" />
</div>
<div class="container">
<StationBtn Code="WAS" Name="DC Union Station" />
</div>
<div class="container">
<StationBtn Code="BOS" Name="Boston South Station" />
</div>
</div>
<div class="container">
<StationBtn Code="WAS" Name="DC Union Station" />
</div>
<div class="container">
<StationBtn Code="BOS" Name="Boston South Station" />
<div class="row">
<div class="container">
<StationBtn Code="ASD" Name="Ashland, VA" />
<StationBtn Code="SNC" Name="San Juan Capistrano, CA" />
<StationBtn Code="FMD" Name="Fort Madison, IA" />
</div>
<div class="container">
<StationBtn Code="LAP" Name="La Plata, MO" />
<StationBtn Code="QCY" Name="Quincy, IL" />
<StationBtn Code="SPB" Name="Spartanburg, SC" />
</div>
</div>
</div>
<div class="row">
<div class="container">
<StationBtn Code="ASD" Name="Ashland, VA" />
<StationBtn Code="SNC" Name="San Juan Capistrano, CA" />
<StationBtn Code="FMD" Name="Fort Madison, IA" />
</div>
<div class="container">
<StationBtn Code="LAP" Name="La Plata, MO" />
<StationBtn Code="QCY" Name="Quincy, IL" />
<StationBtn Code="SPB" Name="Spartanburg, SC" />
</div>
</div>
</div>
<footer>
<sub>
<i>
<p>
<GitVersion /><br>Status Boards by
<LaunchBrowser Text="Dixieland Software" Address="https://dixielandsoftware.net/" />
</p>
</i>
</sub>
</footer>
<footer>
<sub>
<i>
<p>
<GitVersion /><br>Status Boards by
<OpenBrowser Text="Dixieland Software" Address="https://dixielandsoftware.net/" />
</p>
</i>
</sub>
</footer>
</FluentLayout>

View file

@ -1,3 +1,5 @@
@import '/_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css';
.logo.blazor:hover {
filter: drop-shadow(0 0 2em #5c2d91);
}
@ -33,40 +35,6 @@ footer {
bottom: 0;
}
/* The sidebar menu */
.sidenav {
height: 100%;
/* Full-height: remove this if you want "auto" height */
width: 160px;
/* Set the width of the sidebar */
position: fixed;
/* Fixed Sidebar (stay in place on scroll) */
z-index: 1;
/* Stay on top */
top: 0;
/* Stay at the top */
left: 0;
background-color: #111;
/* Black */
overflow-x: hidden;
/* Disable horizontal scroll */
padding-top: 20px;
}
/* The navigation menu links */
.sidenav a {
padding: 6px 8px 6px 16px;
text-decoration: none;
font-size: 25px;
color: #818181;
display: block;
}
/* When you mouse over the navigation links, change their color */
.sidenav a:hover {
color: #f1f1f1;
}
.logo {
height: 6em;
padding: 1.5em;
@ -126,7 +94,7 @@ button {
outline: none;
}
@media (prefers-color-scheme: dark) {
/* @media (prefers-color-scheme: dark) {
:root {
color: #f6f6f6;
background-color: #2f2f2f;
@ -145,4 +113,4 @@ button {
button:active {
background-color: #0f0f0f69;
}
}
} */

View file

@ -7,6 +7,9 @@
<title>Tauri + Blazor</title>
<base href="/" />
<link rel="stylesheet" href="css/app.css" />
<script src="_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js"
type="module" async></script>
<link href="_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" />
</head>
<body>