-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Slideshow] Add fixed position background #2346
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2923,6 +2923,18 @@ | |
"change_slides_speed": { | ||
"label": "Change slides every" | ||
}, | ||
"animations": { | ||
"content": "Animations" | ||
}, | ||
"image_behavior": { | ||
"options__1": { | ||
"label": "None" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Localization quality issue found The following issues may affect the quality of localized translations if they are not addressed:
Please look out for other instances of this issue in your PR and fix them as well if possible. Questions about these messages? Hop in the #help-localization Slack channel. |
||
}, | ||
"options__2": { | ||
"label": "Fixed background position" | ||
}, | ||
"label": "Image behavior" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Localization quality issue found The following issues may affect the quality of localized translations if they are not addressed:
Please look out for other instances of this issue in your PR and fix them as well if possible. Questions about these messages? Hop in the #help-localization Slack channel. |
||
}, | ||
"mobile": { | ||
"content": "Mobile layout" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,6 +117,23 @@ | |
#Slide-{{ section.id }}-{{ forloop.index }} .banner__media::after { | ||
opacity: {{ block.settings.image_overlay_opacity | divided_by: 100.0 }}; | ||
} | ||
{%- if section.settings.image_behavior == 'fixed' -%} | ||
#Slide-{{ section.id }}-{{ forloop.index }} .animate--fixed { | ||
background: url("{{ block.settings.image | image_url: width: 3840 }}") center no-repeat; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we sure we always want this size for the image? |
||
background-size: cover; | ||
background-attachment: fixed; | ||
} | ||
#Slide-{{ section.id }}-{{ forloop.index }} .animate--fixed img { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these |
||
clip: rect(1px, 1px, 1px, 1px); | ||
clip-path: inset(50%); | ||
height: 1px; | ||
width: 1px; | ||
margin: -1px; | ||
overflow: hidden; | ||
padding: 0; | ||
position: absolute; | ||
} | ||
{%- endif -%} | ||
</style> | ||
<div | ||
class="slideshow__slide grid__item grid--1-col slider__slide" | ||
|
@@ -127,7 +144,7 @@ | |
aria-label="{{ forloop.index }} {{ 'general.slider.of' | t }} {{ forloop.length }}" | ||
tabindex="-1" | ||
> | ||
<div class="slideshow__media banner__media media{% if block.settings.image == blank %} placeholder{% endif %}"> | ||
<div class="slideshow__media banner__media media{% if block.settings.image == blank %} placeholder{% endif %}{% if section.settings.image_behavior != 'none' %} animate--{{ section.settings.image_behavior }}{% endif %}"> | ||
{%- if block.settings.image -%} | ||
{%- assign height = block.settings.image.width | divided_by: block.settings.image.aspect_ratio | round -%} | ||
{{ | ||
|
@@ -338,6 +355,26 @@ | |
"label": "t:sections.slideshow.settings.change_slides_speed.label", | ||
"default": 5 | ||
}, | ||
{ | ||
"type": "header", | ||
"content": "t:sections.slideshow.settings.animations.content" | ||
}, | ||
{ | ||
"type": "select", | ||
"id": "image_behavior", | ||
"options": [ | ||
{ | ||
"value": "none", | ||
"label": "t:sections.slideshow.settings.image_behavior.options__1.label" | ||
}, | ||
{ | ||
"value": "fixed", | ||
"label": "t:sections.slideshow.settings.image_behavior.options__2.label" | ||
} | ||
], | ||
"default": "none", | ||
"label": "t:sections.slideshow.settings.image_behavior.label" | ||
}, | ||
{ | ||
"type": "header", | ||
"content": "t:sections.slideshow.settings.mobile.content" | ||
|
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.
Localization quality issue found
The following issues may affect the quality of localized translations if they are not addressed:
Animations
for keysections.slideshow.settings.animations.content
is very short. Short strings are more likely to be misunderstood by translators without context. Please provide additional context for the translators if possible.Please look out for other instances of this issue in your PR and fix them as well if possible.
Questions about these messages? Hop in the #help-localization Slack channel.