From fc83b60e1d53fe83608028b3f6646085c97e979c Mon Sep 17 00:00:00 2001 From: Kira Jiroux Date: Mon, 17 Feb 2025 11:53:46 -0500 Subject: [PATCH] Initial push before branching. --- Portfolio.WebUI.Server/Components/App.razor | 5 +- .../Components/Layout/NavMenu.razor | 5 ++ .../Components/Pages/Home.razor | 2 +- .../Components/Pages/PokemonSleep.razor | 64 +++++++++++++++++++ Portfolio.WebUI.Server/wwwroot/app.css | 4 ++ Portfolio.sln | 2 +- 6 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 Portfolio.WebUI.Server/Components/Pages/PokemonSleep.razor diff --git a/Portfolio.WebUI.Server/Components/App.razor b/Portfolio.WebUI.Server/Components/App.razor index 62eee1f..fb3f60a 100644 --- a/Portfolio.WebUI.Server/Components/App.razor +++ b/Portfolio.WebUI.Server/Components/App.razor @@ -5,9 +5,10 @@ - - + + + diff --git a/Portfolio.WebUI.Server/Components/Layout/NavMenu.razor b/Portfolio.WebUI.Server/Components/Layout/NavMenu.razor index b62ca77..e16f3e7 100644 --- a/Portfolio.WebUI.Server/Components/Layout/NavMenu.razor +++ b/Portfolio.WebUI.Server/Components/Layout/NavMenu.razor @@ -19,6 +19,11 @@ Weather + diff --git a/Portfolio.WebUI.Server/Components/Pages/Home.razor b/Portfolio.WebUI.Server/Components/Pages/Home.razor index 0d8c9f5..6a63508 100644 --- a/Portfolio.WebUI.Server/Components/Pages/Home.razor +++ b/Portfolio.WebUI.Server/Components/Pages/Home.razor @@ -2,7 +2,7 @@ Home -

Hello, world!

+

Hello, world!

Ensuring that git is connected properly.

Welcome to your new app. diff --git a/Portfolio.WebUI.Server/Components/Pages/PokemonSleep.razor b/Portfolio.WebUI.Server/Components/Pages/PokemonSleep.razor new file mode 100644 index 0000000..5cfd636 --- /dev/null +++ b/Portfolio.WebUI.Server/Components/Pages/PokemonSleep.razor @@ -0,0 +1,64 @@ +@page "/pokemonsleep" +@attribute [StreamRendering] + +Pokemon Sleep + +

Pokemon Sleep

+ +

This component will eventually show data from the PokemonSleepAPI. For right now it copies Weather.

+ +@if (forecasts == null) +{ +

Loading...

+} +else +{ + + + + + + + + + + + @foreach (var forecast in forecasts) + { + + + + + + + } + +
DateTemp. (C)Temp. (F)Summary
@forecast.Date.ToShortDateString()@forecast.TemperatureC@forecast.TemperatureF@forecast.Summary
+} + +@code { + private WeatherForecast[]? forecasts; + + protected override async Task OnInitializedAsync() + { + // Simulate asynchronous loading to demonstrate streaming rendering + await Task.Delay(500); + + var startDate = DateOnly.FromDateTime(DateTime.Now); + var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" }; + forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast + { + Date = startDate.AddDays(index), + TemperatureC = Random.Shared.Next(-20, 55), + Summary = summaries[Random.Shared.Next(summaries.Length)] + }).ToArray(); + } + + private 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); + } +} diff --git a/Portfolio.WebUI.Server/wwwroot/app.css b/Portfolio.WebUI.Server/wwwroot/app.css index 2bd9b78..13b3169 100644 --- a/Portfolio.WebUI.Server/wwwroot/app.css +++ b/Portfolio.WebUI.Server/wwwroot/app.css @@ -12,6 +12,10 @@ a, .btn-link { border-color: #1861ac; } +.test{ + border: 1px dashed hotpink; +} + .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; } diff --git a/Portfolio.sln b/Portfolio.sln index a868a17..97e72c4 100644 --- a/Portfolio.sln +++ b/Portfolio.sln @@ -5,7 +5,7 @@ VisualStudioVersion = 17.11.35327.3 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{491A0B76-7D94-42C5-BD6B-F90036F33A04}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Portfolio.WebUI.Server", "Portfolio.WebUI.Server\Portfolio.WebUI.Server.csproj", "{334A4A79-9DF9-4FAD-9B06-B2FA02443620}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Portfolio.WebUI.Server", "Portfolio.WebUI.Server\Portfolio.WebUI.Server.csproj", "{334A4A79-9DF9-4FAD-9B06-B2FA02443620}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution