|
21 | 21 |
|
22 | 22 | <link rel="stylesheet" href="{{ 'component-deferred-media.css' | asset_url }}" media="print" onload="this.media='all'"> |
23 | 23 |
|
24 | | -{%- assign product = section.settings.product -%} |
| 24 | +{%- liquid |
| 25 | + assign product = section.settings.product |
| 26 | + |
| 27 | + if section.settings.media_size == 'large' |
| 28 | + assign media_width = 0.65 |
| 29 | + elsif section.settings.media_size == 'medium' |
| 30 | + assign media_width = 0.55 |
| 31 | + elsif section.settings.media_size == 'small' |
| 32 | + assign media_width = 0.45 |
| 33 | + endif |
| 34 | +-%} |
25 | 35 |
|
26 | 36 | {%- assign first_3d_model = product.media | where: 'media_type', 'model' | first -%} |
27 | 37 | {%- if first_3d_model -%} |
|
44 | 54 |
|
45 | 55 | <section class="color-{{ section.settings.color_scheme }} {% if section.settings.secondary_background %}background-secondary{% else %}gradient{% endif %}"> |
46 | 56 | <div class="page-width section-{{ section.id }}-padding{% if section.settings.secondary_background %} isolate{% endif %}"> |
47 | | - <div class="featured-product product grid grid--1-col gradient color-{{ section.settings.color_scheme }} product--{{ section.settings.media_position }}{% if section.settings.secondary_background == false %} isolate{% endif %} {% if product.media.size > 0 %}grid--2-col-tablet{% else %}product--no-media{% endif %}"> |
| 57 | + <div class="featured-product product product--{{ section.settings.media_size }} grid grid--1-col gradient color-{{ section.settings.color_scheme }} product--{{ section.settings.media_position }}{% if section.settings.secondary_background == false %} isolate{% endif %} {% if product.media.size > 0 %}grid--2-col-tablet{% else %}product--no-media{% endif %}"> |
48 | 58 | <div class="grid__item product__media-wrapper{% if section.settings.media_position == 'right' %} medium-hide large-up-hide{% endif %}"> |
49 | 59 | <media-gallery |
50 | 60 | id="MediaGallery-{{ section.id }}" |
|
62 | 72 | loop: section.settings.enable_video_looping, |
63 | 73 | modal_id: section.id, |
64 | 74 | xr_button: false, |
65 | | - media_width: 0.5 |
| 75 | + media_width: media_width, |
| 76 | + media_fit: section.settings.media_fit, |
| 77 | + constrain_to_viewport: section.settings.constrain_to_viewport |
66 | 78 | %} |
67 | 79 | </div> |
68 | 80 | {%- endif -%} |
|
83 | 95 | loop: section.settings.enable_video_looping, |
84 | 96 | modal_id: section.id, |
85 | 97 | xr_button: false, |
86 | | - media_width: 0.5 |
| 98 | + media_width: media_width, |
| 99 | + media_fit: section.settings.media_fit, |
| 100 | + constrain_to_viewport: section.settings.constrain_to_viewport |
87 | 101 | %} |
88 | 102 | </div> |
89 | 103 | {%- endif -%} |
|
572 | 586 | loop: section.settings.enable_video_looping, |
573 | 587 | modal_id: section.id, |
574 | 588 | xr_button: false, |
575 | | - media_width: 0.5 |
| 589 | + media_width: media_width, |
| 590 | + media_fit: section.settings.media_fit, |
| 591 | + constrain_to_viewport: section.settings.constrain_to_viewport |
576 | 592 | %} |
577 | 593 | </div> |
578 | 594 | {%- endif -%} |
|
587 | 603 | loop: section.settings.enable_video_looping, |
588 | 604 | modal_id: section.id, |
589 | 605 | xr_button: false, |
590 | | - media_width: 0.5 |
| 606 | + media_width: media_width, |
| 607 | + media_fit: section.settings.media_fit, |
| 608 | + constrain_to_viewport: section.settings.constrain_to_viewport |
591 | 609 | %} |
592 | 610 | </div> |
593 | 611 | {%- endif -%} |
|
1561 | 1579 | "content": "t:sections.featured-product.settings.header.content", |
1562 | 1580 | "info": "t:sections.featured-product.settings.header.info" |
1563 | 1581 | }, |
| 1582 | + { |
| 1583 | + "type": "select", |
| 1584 | + "id": "media_size", |
| 1585 | + "options": [ |
| 1586 | + { |
| 1587 | + "value": "small", |
| 1588 | + "label": "t:sections.main-product.settings.media_size.options__1.label" |
| 1589 | + }, |
| 1590 | + { |
| 1591 | + "value": "medium", |
| 1592 | + "label": "t:sections.main-product.settings.media_size.options__2.label" |
| 1593 | + }, |
| 1594 | + { |
| 1595 | + "value": "large", |
| 1596 | + "label": "t:sections.main-product.settings.media_size.options__3.label" |
| 1597 | + } |
| 1598 | + ], |
| 1599 | + "default": "medium", |
| 1600 | + "label": "t:sections.main-product.settings.media_size.label", |
| 1601 | + "info": "t:sections.main-product.settings.media_size.info" |
| 1602 | + }, |
| 1603 | + { |
| 1604 | + "type": "checkbox", |
| 1605 | + "id": "constrain_to_viewport", |
| 1606 | + "default": false, |
| 1607 | + "label": "t:sections.main-product.settings.constrain_to_viewport.label" |
| 1608 | + }, |
| 1609 | + { |
| 1610 | + "type": "select", |
| 1611 | + "id": "media_fit", |
| 1612 | + "options": [ |
| 1613 | + { |
| 1614 | + "value": "contain", |
| 1615 | + "label": "t:sections.main-product.settings.media_fit.options__1.label" |
| 1616 | + }, |
| 1617 | + { |
| 1618 | + "value": "cover", |
| 1619 | + "label": "t:sections.main-product.settings.media_fit.options__2.label" |
| 1620 | + } |
| 1621 | + ], |
| 1622 | + "default": "contain", |
| 1623 | + "label": "t:sections.main-product.settings.media_fit.label" |
| 1624 | + }, |
1564 | 1625 | { |
1565 | 1626 | "type": "select", |
1566 | 1627 | "id": "media_position", |
|
0 commit comments