more details, needs cleanup
This commit is contained in:
parent
d6d13a329c
commit
18e134d523
@ -13,11 +13,23 @@
|
||||
<div class="current-temperature">@Model.Current.Temperature<span class="degrees">°F</span></div>
|
||||
</div>
|
||||
|
||||
@foreach (var forecast in Model.Forecast)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col col-6">@forecast.Summary.ConditionName</div>
|
||||
<div class="col col-3">@forecast.Summary.HighTemp</div>
|
||||
<div class="col col-3">@forecast.Summary.LowTemp</div>
|
||||
</div>
|
||||
}
|
||||
<div class="detailed-conditions">
|
||||
|
||||
@foreach (var forecast in Model.Forecast)
|
||||
{
|
||||
<div class="row day-summary">
|
||||
<div class="col col-6">@forecast.Summary.ConditionName</div>
|
||||
<div class="col col-6">@forecast.Summary.HighTemp / @forecast.Summary.LowTemp</div>
|
||||
</div>
|
||||
|
||||
@foreach (var hourForecast in forecast.HourForecasts)
|
||||
{
|
||||
<div class="row day-detail">
|
||||
<div class="col">@hourForecast.Time</div>
|
||||
<div class="col">@hourForecast.ConditionName</div>
|
||||
<div class="col">@hourForecast.Temperature</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
</div>
|
@ -6,6 +6,13 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Models\**" />
|
||||
<Content Remove="Models\**" />
|
||||
<EmbeddedResource Remove="Models\**" />
|
||||
<None Remove="Models\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\Release.pubxml" />
|
||||
</ItemGroup>
|
||||
@ -18,8 +25,4 @@
|
||||
<ProjectReference Include="..\WeatherDashboard\WeatherDashboard.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,5 +1,5 @@
|
||||
html {
|
||||
font-size: 20px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
/*@media (min-width: 768px) {
|
||||
@ -9,18 +9,18 @@ html {
|
||||
}*/
|
||||
|
||||
.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;
|
||||
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
|
||||
}
|
||||
|
||||
html {
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Montserrat', sans-serif;
|
||||
color: #444;
|
||||
margin:40px;
|
||||
margin: 20px 10px;
|
||||
background-color: floralwhite;
|
||||
}
|
||||
|
||||
@ -38,4 +38,16 @@ body {
|
||||
.current-temperature {
|
||||
font-size: 100px;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.detailed-conditions {
|
||||
}
|
||||
|
||||
.detailed-conditions .day-summary {
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.detailed-conditions .day-detail {
|
||||
font-size: 13px;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
13
WeatherDashboard/DayForecast.cs
Normal file
13
WeatherDashboard/DayForecast.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace WeatherDashboard
|
||||
{
|
||||
public class DayForecast
|
||||
{
|
||||
[JsonProperty("day")]
|
||||
public ForecastSummary Summary { get; set; }
|
||||
|
||||
[JsonProperty("hour")]
|
||||
public ICollection<Forecast> HourForecasts { get; set; }
|
||||
}
|
||||
}
|
32
WeatherDashboard/Forecast.cs
Normal file
32
WeatherDashboard/Forecast.cs
Normal file
@ -0,0 +1,32 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace WeatherDashboard
|
||||
{
|
||||
[JsonConverter(typeof(JsonPathConverter))]
|
||||
public class Forecast
|
||||
{
|
||||
[JsonProperty("last_updated")]
|
||||
public DateTime? LastUpdated { get; set; }
|
||||
|
||||
[JsonProperty("time")]
|
||||
public DateTime? Time { get; set; }
|
||||
|
||||
[JsonProperty("temp_f")]
|
||||
public decimal Temperature { get; set; }
|
||||
|
||||
[JsonProperty("feelslike_f")]
|
||||
public decimal FeelsLike { get; set; }
|
||||
|
||||
[JsonProperty("humidity")]
|
||||
public decimal Humidity { get; set; }
|
||||
|
||||
[JsonProperty("wind_mph")]
|
||||
public decimal WindSpeed { get; set; }
|
||||
|
||||
[JsonProperty("wind_dir")]
|
||||
public string WindDirection { get; set; }
|
||||
|
||||
[JsonProperty("condition.text")]
|
||||
public string ConditionName { get; set; }
|
||||
}
|
||||
}
|
@ -3,15 +3,15 @@
|
||||
namespace WeatherDashboard
|
||||
{
|
||||
[JsonConverter(typeof(JsonPathConverter))]
|
||||
public class CurrentForecast
|
||||
public class ForecastSummary
|
||||
{
|
||||
[JsonProperty("last_updated")]
|
||||
public DateTime LastUpdated { get; set; }
|
||||
|
||||
[JsonProperty("temp_f")]
|
||||
public decimal Temperature { get; set; }
|
||||
|
||||
[JsonProperty("condition.text")]
|
||||
public string ConditionName { get; set; }
|
||||
|
||||
[JsonProperty("maxtemp_f")]
|
||||
public decimal HighTemp { get; set; }
|
||||
|
||||
[JsonProperty("mintemp_f")]
|
||||
public decimal LowTemp { get; set; }
|
||||
}
|
||||
}
|
@ -9,28 +9,9 @@ namespace WeatherDashboard
|
||||
public Location Location { get; set; }
|
||||
|
||||
[JsonProperty("current")]
|
||||
public CurrentForecast Current { get; set; }
|
||||
public Forecast Current { get; set; }
|
||||
|
||||
[JsonProperty("forecast.forecastday")]
|
||||
public ICollection<Forecast> Forecast { get; set; }
|
||||
}
|
||||
|
||||
public class Forecast
|
||||
{
|
||||
[JsonProperty("day")]
|
||||
public ForecastSummary Summary { get; set; }
|
||||
}
|
||||
|
||||
[JsonConverter(typeof(JsonPathConverter))]
|
||||
public class ForecastSummary
|
||||
{
|
||||
[JsonProperty("condition.text")]
|
||||
public string ConditionName { get; set; }
|
||||
|
||||
[JsonProperty("maxtemp_f")]
|
||||
public decimal HighTemp { get; set; }
|
||||
|
||||
[JsonProperty("mintemp_f")]
|
||||
public decimal LowTemp { get; set; }
|
||||
public ICollection<DayForecast> Forecast { get; set; }
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user