-
Notifications
You must be signed in to change notification settings - Fork 918
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
Update hero with flag animation (fixes #15515 and #15597) #15525
Update hero with flag animation (fixes #15515 and #15597) #15525
Conversation
0962ab1
to
79af51e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15525 +/- ##
==========================================
- Coverage 79.05% 79.04% -0.01%
==========================================
Files 159 159
Lines 8331 8329 -2
==========================================
- Hits 6586 6584 -2
Misses 1745 1745 ☔ View full report in Codecov by Sentry. |
79af51e
to
a0559d7
Compare
Adding a note here that I had some success fixing the sub-pixel tearing by adding |
Here is my attempt for the evening.
|
Another attempt
https://codepen.io/slightlyoffbeat/pen/XWvvXpg Seems to work the best of what I've tried so far. |
ac0c922
to
a21cf2e
Compare
margin-bottom: $spacer-xl; | ||
} | ||
|
||
.m24-c-flag-cta { | ||
margin-bottom: 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removes default p spacing
media/css/m24/flag.scss
Outdated
background-color: $m24-color-medium-gray; | ||
color: $m24-color-white; | ||
font-family: $primary-font; | ||
font-size: 0.75rem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-variable values used when there's no change in value across viewport widths
border-radius: 50%; | ||
display: block; | ||
margin-bottom: $spacer-md; | ||
margin-inline-start: auto; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logical properties have pretty good support now, so I decided to use them as enhancement here instead of bidi mixin
a21cf2e
to
7b8465f
Compare
8f8d5f5
to
97256ca
Compare
<img src="{{ static('img/home/2024/hero-symbol-white.svg') }}" alt="" width="216" height="243"> | ||
</div> | ||
<section class="m24-c-flag" data-animation-running="false"> | ||
<button class="m24-c-flag-button js-animation-button" aria-live="assertive"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
went for assertive here as the text change might be confusing if not announced immediately after button click
l10n/en/mozorg/home-m24.ftl
Outdated
@@ -13,6 +13,8 @@ m24-home-page-desc = Did you know? { -brand-name-mozilla } — the maker of { -b | |||
|
|||
## Intro | |||
|
|||
m24-home-pause-animation = Pause animation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question for reviewer: should these be in a more generic UI ftl file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. That's a global file so the string would be available everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, will update!
1c3f384
to
3b63895
Compare
Feedback
|
13c7659
to
104c2a2
Compare
85b11ac
to
d81ddf9
Compare
no-js: no animation button, static svg reduced motion pref: animation button available, static by default button click: toggles current animation state and updates text
d81ddf9
to
4e20349
Compare
media/css/m24/flag.scss
Outdated
|
||
.m24-c-flag-button { | ||
$font-size: 0.75; | ||
all: unset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removed the focus ring. Can you add it back please? Ideally with the native focus ring . But if that is finiky any kind of outline would be a good addition.
@@ -20,6 +20,8 @@ ui-show-all = Show All | |||
ui-hide-all = Hide All | |||
ui-learn-more = Learn more | |||
ui-view = View | |||
ui-pause-animation = Pause animation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Praise: Thanks for making these global.
Co-authored-by: Jan Brasna <1784648+janbrasna@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
R+
One-line summary
Add waving,
blinking, bouncingflag animation on homepage hero.Animation play state will respect user's motion preference by default.
There will also be a play/pause button to change the default play state.
Based on this codepen: https://codepen.io/slightlyoffbeat/pen/LYwwpgj
Significant changes and points to review
The animation is hidden behind a switch:
M24_HERO_ANIMATION
When the switch is off, you will get the no js experience
Play/pause button on desktop and mobile Figma [Mozilla only]
Expected behaviour
no js: by default animation does not run
user motion preference:
button click
Issue / Bugzilla link
#15515
#15597
#15640
Testing
M24_WEBSITE_REFRESH
must beon
Use
./manage.py waffle_switch --create M24_HERO_ANIMATION on
to test active switch