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 class="current-temperature">@Model.Current.Temperature<span class="degrees">°F</span></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@foreach (var forecast in Model.Forecast)
|
<div class="detailed-conditions">
|
||||||
{
|
|
||||||
<div class="row">
|
@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.ConditionName</div>
|
||||||
<div class="col col-3">@forecast.Summary.HighTemp</div>
|
<div class="col col-6">@forecast.Summary.HighTemp / @forecast.Summary.LowTemp</div>
|
||||||
<div class="col col-3">@forecast.Summary.LowTemp</div>
|
|
||||||
</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>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="Models\**" />
|
||||||
|
<Content Remove="Models\**" />
|
||||||
|
<EmbeddedResource Remove="Models\**" />
|
||||||
|
<None Remove="Models\**" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<_WebToolingArtifacts Remove="Properties\PublishProfiles\Release.pubxml" />
|
<_WebToolingArtifacts Remove="Properties\PublishProfiles\Release.pubxml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@ -18,8 +25,4 @@
|
|||||||
<ProjectReference Include="..\WeatherDashboard\WeatherDashboard.csproj" />
|
<ProjectReference Include="..\WeatherDashboard\WeatherDashboard.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Models\" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -20,7 +20,7 @@ html {
|
|||||||
body {
|
body {
|
||||||
font-family: 'Montserrat', sans-serif;
|
font-family: 'Montserrat', sans-serif;
|
||||||
color: #444;
|
color: #444;
|
||||||
margin:40px;
|
margin: 20px 10px;
|
||||||
background-color: floralwhite;
|
background-color: floralwhite;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,3 +39,15 @@ body {
|
|||||||
font-size: 100px;
|
font-size: 100px;
|
||||||
font-weight: 500;
|
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
|
namespace WeatherDashboard
|
||||||
{
|
{
|
||||||
[JsonConverter(typeof(JsonPathConverter))]
|
[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")]
|
[JsonProperty("condition.text")]
|
||||||
public string ConditionName { get; set; }
|
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; }
|
public Location Location { get; set; }
|
||||||
|
|
||||||
[JsonProperty("current")]
|
[JsonProperty("current")]
|
||||||
public CurrentForecast Current { get; set; }
|
public Forecast Current { get; set; }
|
||||||
|
|
||||||
[JsonProperty("forecast.forecastday")]
|
[JsonProperty("forecast.forecastday")]
|
||||||
public ICollection<Forecast> Forecast { get; set; }
|
public ICollection<DayForecast> 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; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user