Skip to content

Commit a92029d

Browse files
committed
Fix aspect ratio bug for video animation
1 parent 3209e74 commit a92029d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

blocks/video-animation.liquid

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@
44
No video controls or audio
55
{% endcomment %}
66

7+
{% liquid
8+
assign aspect_ratio = block.settings.aspect_ratio
9+
if aspect_ratio == 'auto' and block.settings.video != blank
10+
assign aspect_ratio = block.settings.video.aspect_ratio
11+
endif
12+
%}
13+
714
<div
815
class="media-container video-animation"
9-
style="--aspect-ratio: {{ block.settings.aspect_ratio }};"
16+
style="--aspect-ratio: {{ aspect_ratio }};"
1017
{{ block.shopify_attributes }}
1118
>
1219
{% if block.settings.video %}
@@ -192,15 +199,15 @@
192199
"label": "t:options.aspect_ratio_auto"
193200
},
194201
{
195-
"value": "16/9",
202+
"value": "56.25%",
196203
"label": "t:options.aspect_ratio_16_9"
197204
},
198205
{
199-
"value": "5/4",
206+
"value": "80%",
200207
"label": "t:options.aspect_ratio_5_4"
201208
},
202209
{
203-
"value": "1/1",
210+
"value": "100%",
204211
"label": "t:options.aspect_ratio_1_1"
205212
}
206213
],

0 commit comments

Comments
 (0)