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

fix: Banner accessibility #10299

Merged
merged 4 commits into from
May 21, 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
12 changes: 8 additions & 4 deletions scss/_off.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1226,10 +1226,14 @@ $font-green: #008c8c;
padding: 1rem;
}
&__close {
position: absolute;
top: .3rem;
right: .3rem;
cursor: pointer;
button {
position: absolute;
top: .3rem;
right: .3rem;
cursor: pointer;
background-color: transparent;
color: inherit;
}
}
&__hand {
position: absolute;
Expand Down
8 changes: 4 additions & 4 deletions templates/web/common/includes/donate_banner.tt.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<span class="donation-banner__hand"></span>
<div class="donation-banner__content">
<p class="donation-banner__main-text">
<span>[% lang("donation_text_2023_main") %]</span>
<span role="heading">[% lang("donation_text_2023_main") %]</span>
</p>
<div class="donation-banner__aside">
<div>
Expand All @@ -17,9 +17,9 @@
<a class="donation-banner__donate" href="[% link %]?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">[% lang("donation_cta") %]</a>
</div>
</div>
<div class="donation-banner__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner__image" role="img" aria-label="Photo of the project team"></div>
<div class="donation-banner__close">
<span id="hide-donate-banner" class="material-icons" onclick="DonationButton();">close</span>
<button id="hide-donate-banner" class="material-icons modest" onclick="DonationButton();" onkeypress="DonationButton();">close</button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the "modest" class?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a sveetoy class to make the button smaller

</div>
</section>

Expand Down Expand Up @@ -81,7 +81,7 @@
<a class="donation-banner-footer__donate" href="[% link %]?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">[% lang("donation_cta") %]</a>
</div>
</div>
<div class="donation-banner-footer__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner-footer__image" role="img" aria-label="Photo of the project team"></div>
</section>

[% END %]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
<span class="donation-banner__hand"></span>
<div class="donation-banner__content">
<p class="donation-banner__main-text">
<span>Help us make food transparency the norm!</span>
<span role="heading">Help us make food transparency the norm!</span>
</p>
<div class="donation-banner__aside">
<div>
Expand All @@ -256,9 +256,9 @@
<a class="donation-banner__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner__image" role="img" aria-label="Photo of the project team"></div>
<div class="donation-banner__close">
<span id="hide-donate-banner" class="material-icons" onclick="DonationButton();">close</span>
<button id="hide-donate-banner" class="material-icons modest" onclick="DonationButton();" onkeypress="DonationButton();">close</button>
</div>
</section>

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="if-empty-dnone">Error</h1>
<a class="donation-banner-footer__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner-footer__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner-footer__image" role="img" aria-label="Photo of the project team"></div>
</section>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"origins_of_ingredients" : {
"aggregated_origins" : [
{
"epi_score" : "0",
"epi_score" : 0,
"origin" : "en:unknown",
"percent" : 100,
"transportation_score" : null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
<span class="donation-banner__hand"></span>
<div class="donation-banner__content">
<p class="donation-banner__main-text">
<span>Aidez-nous à faire de la transparence alimentaire la norme !</span>
<span role="heading">Aidez-nous à faire de la transparence alimentaire la norme !</span>
</p>
<div class="donation-banner__aside">
<div>
Expand All @@ -256,9 +256,9 @@
<a class="donation-banner__donate" href="//fr.openfoodfacts.org/faire-un-don-a-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Faire un don</a>
</div>
</div>
<div class="donation-banner__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner__image" role="img" aria-label="Photo of the project team"></div>
<div class="donation-banner__close">
<span id="hide-donate-banner" class="material-icons" onclick="DonationButton();">close</span>
<button id="hide-donate-banner" class="material-icons modest" onclick="DonationButton();" onkeypress="DonationButton();">close</button>
</div>
</section>

Expand Down Expand Up @@ -367,7 +367,7 @@ <h1 class="if-empty-dnone">Erreur</h1>
<a class="donation-banner-footer__donate" href="//fr.openfoodfacts.org/faire-un-don-a-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Faire un don</a>
</div>
</div>
<div class="donation-banner-footer__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner-footer__image" role="img" aria-label="Photo of the project team"></div>
</section>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"origins_of_ingredients" : {
"aggregated_origins" : [
{
"epi_score" : "0",
"epi_score" : 0,
"origin" : "en:unknown",
"percent" : 100,
"transportation_score" : null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"origins_of_ingredients" : {
"aggregated_origins" : [
{
"epi_score" : "0",
"epi_score" : 0,
"origin" : "en:unknown",
"percent" : 100,
"transportation_score" : null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"origins_of_ingredients" : {
"aggregated_origins" : [
{
"epi_score" : "0",
"epi_score" : 0,
"origin" : "en:unknown",
"percent" : 100,
"transportation_score" : null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@
"origins_of_ingredients" : {
"aggregated_origins" : [
{
"epi_score" : "0",
"epi_score" : 0,
"origin" : "en:unknown",
"percent" : 100,
"transportation_score" : null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
<span class="donation-banner__hand"></span>
<div class="donation-banner__content">
<p class="donation-banner__main-text">
<span>Help us make food transparency the norm!</span>
<span role="heading">Help us make food transparency the norm!</span>
</p>
<div class="donation-banner__aside">
<div>
Expand All @@ -258,9 +258,9 @@
<a class="donation-banner__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner__image" role="img" aria-label="Photo of the project team"></div>
<div class="donation-banner__close">
<span id="hide-donate-banner" class="material-icons" onclick="DonationButton();">close</span>
<button id="hide-donate-banner" class="material-icons modest" onclick="DonationButton();" onkeypress="DonationButton();">close</button>
</div>
</section>

Expand Down Expand Up @@ -529,7 +529,7 @@ <h1 itemprop="name">Hazelnut spreads</h1>
<a class="donation-banner-footer__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner-footer__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner-footer__image" role="img" aria-label="Photo of the project team"></div>
</section>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
<span class="donation-banner__hand"></span>
<div class="donation-banner__content">
<p class="donation-banner__main-text">
<span>Help us make food transparency the norm!</span>
<span role="heading">Help us make food transparency the norm!</span>
</p>
<div class="donation-banner__aside">
<div>
Expand All @@ -269,9 +269,9 @@
<a class="donation-banner__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner__image" role="img" aria-label="Photo of the project team"></div>
<div class="donation-banner__close">
<span id="hide-donate-banner" class="material-icons" onclick="DonationButton();">close</span>
<button id="hide-donate-banner" class="material-icons modest" onclick="DonationButton();" onkeypress="DonationButton();">close</button>
</div>
</section>

Expand Down Expand Up @@ -3548,7 +3548,7 @@ <h2 id="data_sources" class="text-medium">Data sources</h2>
<a class="donation-banner-footer__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner-footer__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner-footer__image" role="img" aria-label="Photo of the project team"></div>
</section>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
<span class="donation-banner__hand"></span>
<div class="donation-banner__content">
<p class="donation-banner__main-text">
<span>Help us make food transparency the norm!</span>
<span role="heading">Help us make food transparency the norm!</span>
</p>
<div class="donation-banner__aside">
<div>
Expand All @@ -258,9 +258,9 @@
<a class="donation-banner__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner__image" role="img" aria-label="Photo of the project team"></div>
<div class="donation-banner__close">
<span id="hide-donate-banner" class="material-icons" onclick="DonationButton();">close</span>
<button id="hide-donate-banner" class="material-icons modest" onclick="DonationButton();" onkeypress="DonationButton();">close</button>
</div>
</section>

Expand Down Expand Up @@ -592,7 +592,7 @@ <h1 itemprop="name">Cakes</h1>
<a class="donation-banner-footer__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner-footer__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner-footer__image" role="img" aria-label="Photo of the project team"></div>
</section>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
<span class="donation-banner__hand"></span>
<div class="donation-banner__content">
<p class="donation-banner__main-text">
<span>Help us make food transparency the norm!</span>
<span role="heading">Help us make food transparency the norm!</span>
</p>
<div class="donation-banner__aside">
<div>
Expand All @@ -258,9 +258,9 @@
<a class="donation-banner__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner__image" role="img" aria-label="Photo of the project team"></div>
<div class="donation-banner__close">
<span id="hide-donate-banner" class="material-icons" onclick="DonationButton();">close</span>
<button id="hide-donate-banner" class="material-icons modest" onclick="DonationButton();" onkeypress="DonationButton();">close</button>
</div>
</section>

Expand Down Expand Up @@ -570,7 +570,7 @@ <h2 id="facet_panels_title"></h2>
<a class="donation-banner-footer__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner-footer__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner-footer__image" role="img" aria-label="Photo of the project team"></div>
</section>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
<span class="donation-banner__hand"></span>
<div class="donation-banner__content">
<p class="donation-banner__main-text">
<span>Help us make food transparency the norm!</span>
<span role="heading">Help us make food transparency the norm!</span>
</p>
<div class="donation-banner__aside">
<div>
Expand All @@ -258,9 +258,9 @@
<a class="donation-banner__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner__image" role="img" aria-label="Photo of the project team"></div>
<div class="donation-banner__close">
<span id="hide-donate-banner" class="material-icons" onclick="DonationButton();">close</span>
<button id="hide-donate-banner" class="material-icons modest" onclick="DonationButton();" onkeypress="DonationButton();">close</button>
</div>
</section>

Expand Down Expand Up @@ -369,7 +369,7 @@ <h1 class="if-empty-dnone">Error</h1>
<a class="donation-banner-footer__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner-footer__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner-footer__image" role="img" aria-label="Photo of the project team"></div>
</section>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
<span class="donation-banner__hand"></span>
<div class="donation-banner__content">
<p class="donation-banner__main-text">
<span>Help us make food transparency the norm!</span>
<span role="heading">Help us make food transparency the norm!</span>
</p>
<div class="donation-banner__aside">
<div>
Expand All @@ -259,9 +259,9 @@
<a class="donation-banner__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner__image" role="img" aria-label="Photo of the project team"></div>
<div class="donation-banner__close">
<span id="hide-donate-banner" class="material-icons" onclick="DonationButton();">close</span>
<button id="hide-donate-banner" class="material-icons modest" onclick="DonationButton();" onkeypress="DonationButton();">close</button>
</div>
</section>

Expand Down Expand Up @@ -412,7 +412,7 @@ <h1 class="if-empty-dnone">List of categories - World</h1>
<a class="donation-banner-footer__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner-footer__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner-footer__image" role="img" aria-label="Photo of the project team"></div>
</section>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
<span class="donation-banner__hand"></span>
<div class="donation-banner__content">
<p class="donation-banner__main-text">
<span>Help us make food transparency the norm!</span>
<span role="heading">Help us make food transparency the norm!</span>
</p>
<div class="donation-banner__aside">
<div>
Expand All @@ -258,9 +258,9 @@
<a class="donation-banner__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner__image" role="img" aria-label="Photo of the project team"></div>
<div class="donation-banner__close">
<span id="hide-donate-banner" class="material-icons" onclick="DonationButton();">close</span>
<button id="hide-donate-banner" class="material-icons modest" onclick="DonationButton();" onkeypress="DonationButton();">close</button>
</div>
</section>

Expand Down Expand Up @@ -565,7 +565,7 @@ <h2 id="facet_panels_title"></h2>
<a class="donation-banner-footer__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner-footer__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner-footer__image" role="img" aria-label="Photo of the project team"></div>
</section>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
<span class="donation-banner__hand"></span>
<div class="donation-banner__content">
<p class="donation-banner__main-text">
<span>Help us make food transparency the norm!</span>
<span role="heading">Help us make food transparency the norm!</span>
</p>
<div class="donation-banner__aside">
<div>
Expand All @@ -269,9 +269,9 @@
<a class="donation-banner__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner__image" role="img" aria-label="Photo of the project team"></div>
<div class="donation-banner__close">
<span id="hide-donate-banner" class="material-icons" onclick="DonationButton();">close</span>
<button id="hide-donate-banner" class="material-icons modest" onclick="DonationButton();" onkeypress="DonationButton();">close</button>
</div>
</section>

Expand Down Expand Up @@ -3548,7 +3548,7 @@ <h2 id="data_sources" class="text-medium">Data sources</h2>
<a class="donation-banner-footer__donate" href="//world.openfoodfacts.org/donate-to-open-food-facts?utm_source=off&utf_medium=web&utm_campaign=donate-2023-a&utm_term=en-text-button">Donate</a>
</div>
</div>
<div class="donation-banner-footer__image" role="img" aria-label="photo of the project team"></div>
<div class="donation-banner-footer__image" role="img" aria-label="Photo of the project team"></div>
</section>


Expand Down
Loading
Loading