Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hourly forecast design iteration #697

Merged
merged 5 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ final class GetHourlyForecastTest extends Base
"iconBasename" => "nodata",
"probabilityOfPrecipitation" => 11,
"time" => "12 PM",
"timestamp" => "2023-11-16T12:00:00-07:00",
"temperature" => 1,
],
[
Expand All @@ -164,6 +165,7 @@ final class GetHourlyForecastTest extends Base
"iconBasename" => "nodata",
"probabilityOfPrecipitation" => 22,
"time" => "1 PM",
"timestamp" => "2023-11-16T13:00:00-07:00",
"temperature" => 2,
],
];
Expand Down Expand Up @@ -222,6 +224,7 @@ final class GetHourlyForecastTest extends Base
"iconBasename" => "rain",
"probabilityOfPrecipitation" => 22,
"time" => "12 PM",
"timestamp" => "2023-11-16T12:00:00-07:00",
"temperature" => 2,
],
[
Expand All @@ -230,6 +233,7 @@ final class GetHourlyForecastTest extends Base
"iconBasename" => "snow",
"probabilityOfPrecipitation" => 33,
"time" => "1 PM",
"timestamp" => "2023-11-16T13:00:00-07:00",
"temperature" => 3,
],
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ public function getHourlyForecastFromGrid(
"probabilityOfPrecipitation" =>
$period->probabilityOfPrecipitation->value,
"time" => $timestamp,
"timestamp" => $period->startTime,
"temperature" => $period->temperature,
];
}, $forecast);
Expand Down
4 changes: 2 additions & 2 deletions web/themes/new_weather_theme/assets/css/styles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/themes/new_weather_theme/assets/css/styles.css.map

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,17 @@ body {
height: 100%;
}


/* Current Conditions
------------------------------------- */
-------------------------------------
*/
.current-conditions-temp {
font-size: 56px;
}

/* Hourly Forecast Block Overrides
--------------------------------------
*/
.hourly-forecast-block ol > li {
@include u-margin-bottom(3);
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
<div class="tablet:grid-col-12">
<div class="hourly-forecast-block tablet:grid-col-12 desktop:grid-col-6">
<h2>Hourly forecast</h2>
{# Forecast: hour, icon, condition desc (short), change of precip, temp degree, temp scale #}
<ol class="grid-row flex-row minh-card usa-list--unstyled">

<ol class="grid-row flex-column minh-card usa-list--unstyled">
{% for hour in content.hours %}
<li class="tablet:grid-col padding-x-4">
<div class="display-flex tablet:flex-column flex-justify flex-align-center tablet:minh-card">
<time class="display-block text-uppercase text-bold tablet:text-center font-heading-md" datetime="2011-11-18T03:00-05:00">{{ hour.time }}</time>
<div class="icon margin-y-1">
<svg role="img" aria-hidden="true" class="width-6">
<li class="tablet:grid-col margin-bottom-3">
<time class="display-block text-uppercase text-bold font-heading-md margin-bottom-1" datetime="{{hour.timestamp}}">{{ hour.time }}</time>
<div class="display-flex flex-row flex-align-center flex-justify margin-bottom-2">
<div class="width-5 height-5">
<svg role="img" aria-hidden="true" class="height-full width-full">
<use xlink:href="{{ "/" ~ directory ~ "/assets/images/spritesheet.svg#" ~ hour.iconBasename }}"></use>
</svg>
</div>
<div class="text-center">
<p class="margin-0 conditions-narrative short">{{ hour.conditions | lower }}</p>
<span class="font-body-3xs text-gray-50 conditions__chance">{{ hour.probabilityOfPrecipitation }}% chance</span>
</div>
<div class="display-flex flex-row tablet:margin-top-2">
<div class="display-flex flex-row">
<span class="font-body-xl">{{ hour.temperature }}</span>
<span class="font-body-3xs margin-top-05">℉</span>
{# use HTML entity that reads "degree farenheit" to screen readers #}
</div>
</div>
<p class="margin-0 margin-bottom-1 conditions-narrative short">{{ hour.conditions | lower | capitalize }}</p>
<span class="font-body-3xs text-gray-50 conditions__chance">
{{ hour.probabilityOfPrecipitation }}% {{"chance of precipitation" | t}}
</span>
</li>
{% endfor %}
</ol>
Expand Down
Loading