Skip to content

Commit

Permalink
Merge pull request #1493 from weather-gov/mgwalker/1445-wind-direction
Browse files Browse the repository at this point in the history
Add wind cardinal direction and update icon
  • Loading branch information
greg-does-weather authored Jul 31, 2024
2 parents 73f632a + 7738020 commit b71b218
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 49 deletions.
2 changes: 1 addition & 1 deletion 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.

21 changes: 3 additions & 18 deletions web/themes/new_weather_theme/assets/images/spritesheet.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

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 @@ -9,10 +9,13 @@
fill: color("primary-dark");
}
}

& table td {
padding-right: 0;
}
}

.wx-current-conditions__temp {
// Custom size not in typecale
font-size: units(5) + units(0.5);
}

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ uswds-init:
minified: true

uswds-customized:
version: 2024-07-02
version: 2024-07-31
css:
theme:
assets/css/styles.css: {}
Expand Down
19 changes: 11 additions & 8 deletions web/themes/new_weather_theme/templates/partials/wind.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
#}
<div class="display-flex flex-row flex-align-center" aria-hidden="true">
<span>{{wind.speed}} {{ "mph" | t }}</span>
{#
The +180 here is to account for the fact that wind direction
is reported as a FROM direction, but our arrow points in the
TO direction. So we just need to spin it 'round.
#}
<svg role="img" aria-hidden="true" data-wind-direction class="width-2 height-2 margin-left-05 padding-2px" style="transform: rotate({{ wind.direction.angle + 180 }}deg);">
<use xlink:href="{{ "/" ~ directory ~ "/assets/images/spritesheet.svg#wind_arrow_s" }}"></use>
</svg>
<span class="padding-x-05">{{ wind.direction.short }}</span>
<span class="display-flex flex-align-center margin-bottom-2px">
{#
The +180 here is to account for the fact that wind direction
is reported as a FROM direction, but our arrow points in the
TO direction. So we just need to spin it 'round.
#}
<svg role="img" aria-hidden="true" data-wind-direction class="width-2 height-2" style="transform: rotate({{ wind.direction.angle + 180 }}deg);">
<use xlink:href="{{ "/" ~ directory ~ "/assets/images/spritesheet.svg#wx_wind_arrow" }}"></use>
</svg>
</span>
</div>
{#
By putting all of the content into a single span, we can get VoiceOver to read
Expand Down

0 comments on commit b71b218

Please sign in to comment.