New buttons for major terminals and rail cams

This commit is contained in:
Tony Bark 2024-09-10 01:23:51 -04:00
parent 42dcd70434
commit 761a822e27
3 changed files with 91 additions and 12 deletions

View file

@ -8,7 +8,7 @@
}, },
"package": { "package": {
"productName": "AMTK Status", "productName": "AMTK Status",
"version": "0.1.102" "version": "0.1.104"
}, },
"tauri": { "tauri": {
"allowlist": { "allowlist": {

View file

@ -8,12 +8,38 @@
<input id="greet-input" placeholder="3-character Station Code" @bind="CodeInput" /> <input id="greet-input" placeholder="3-character Station Code" @bind="CodeInput" />
<button type="submit">Submit</button> <button type="submit">Submit</button>
</form> </form>
<div class="row">
<div class="container">
<button @onclick="PennStation">NY Penn Station</button>
</div>
<div class="container">
<button @onclick="UnionStation">DC Union Station</button>
</div>
<div class="container">
<button @onclick="BostonSouth">Boston South Station</button>
</div>
</div>
<div class="row">
<div class="container">
<button @onclick="AshlandVA">Ashland, VA</button>
<button @onclick="SanJuanCA">San Juan Capistrano, CA</button>
<button @onclick="FortMadisonIA">Fort Madison, IA</button>
</div>
<div class="container">
<button @onclick="LaPltaMO">La Plata, MO</button>
<button @onclick="QuincyIL">Quincy, IL</button>
<button @onclick="SpartanburgSC">Spartanburg, SC</button>
</div>
</div>
</div>
<footer>
<sub> <sub>
<i> <i>
<p>Status Boards by Dixieland Software</p> <p>Status Boards by Dixieland Software</p>
</i> </i>
</sub> </sub>
</div> </footer>
@code @code
{ {
@ -21,10 +47,65 @@
private string? StationCode { get; set; } private string? StationCode { get; set; }
private async Task StationAsync() private async Task RedirectToStat(string code)
{ {
StationCode = await JsRuntime.InvokeAsync<string>("__TAURI__.tauri.invoke", "station", new { name = CodeInput }); StationCode = await JsRuntime.InvokeAsync<string>("__TAURI__.tauri.invoke", "station", new { name = code });
NavigationManager.NavigateTo(StationCode); NavigationManager.NavigateTo(StationCode);
} }
private async Task SanJuanCA()
{
await RedirectToStat("SNC");
}
private async Task AshlandVA()
{
await RedirectToStat("ASD");
}
private async Task LaPltaMO()
{
await RedirectToStat("LAP");
}
private async Task FortMadisonIA()
{
await RedirectToStat("FMD");
}
private async Task FlagstaffAZ()
{
await RedirectToStat("FLG");
}
private async Task QuincyIL()
{
await RedirectToStat("QCY");
}
private async Task PennStation()
{
await RedirectToStat("NYP");
}
private async Task UnionStation()
{
await RedirectToStat("WAS");
}
private async Task BostonSouth()
{
await RedirectToStat("BOS");
}
private async Task SpartanburgSC()
{
await RedirectToStat("SPB");
}
private async Task StationAsync()
{
await RedirectToStat(CodeInput!);
}
} }

View file

@ -28,6 +28,11 @@ footer {
text-align: center; text-align: center;
} }
footer {
position: absolute;
bottom: 0;
}
.logo { .logo {
height: 6em; height: 6em;
padding: 1.5em; padding: 1.5em;
@ -35,10 +40,6 @@ footer {
transition: 0.75s; transition: 0.75s;
} }
.logo.tauri:hover {
filter: drop-shadow(0 0 2em #24c8db);
}
.row { .row {
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -74,6 +75,7 @@ button {
button { button {
cursor: pointer; cursor: pointer;
margin: 5px;
} }
button:hover { button:hover {
@ -90,10 +92,6 @@ button {
outline: none; outline: none;
} }
#greet-input {
margin-right: 5px;
}
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
:root { :root {
color: #f6f6f6; color: #f6f6f6;