Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Improve frontend views for sections side-by-side promos

Matthew Kennedy8620755da868
diff --git a/backend/app/assets/images/backend-fullscreen-exit.svg b/backend/app/assets/images/backend-fullscreen-exit.svg
new file mode 100644
index 0000000000..b9bdb1b166
--- /dev/null
+++ b/backend/app/assets/images/backend-fullscreen-exit.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-fullscreen-exit" viewBox="0 0 16 16">
+ <path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/>
+</svg>
\ No newline at end of file
diff --git a/backend/app/assets/images/backend-fullscreen.svg b/backend/app/assets/images/backend-fullscreen.svg
new file mode 100644
index 0000000000..7789d36bd1
--- /dev/null
+++ b/backend/app/assets/images/backend-fullscreen.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-fullscreen" viewBox="0 0 16 16">
+ <path d="M1.5 1a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4A1.5 1.5 0 0 1 1.5 0h4a.5.5 0 0 1 0 1h-4zM10 .5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 16 1.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zM.5 10a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 0 14.5v-4a.5.5 0 0 1 .5-.5zm15 0a.5.5 0 0 1 .5.5v4a1.5 1.5 0 0 1-1.5 1.5h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5z"/>
+</svg>
\ No newline at end of file
diff --git a/backend/app/views/spree/admin/cms_pages/_form.html.erb b/backend/app/views/spree/admin/cms_pages/_form.html.erb
index e6b42ec478..8094a603d3 100644
--- a/backend/app/views/spree/admin/cms_pages/_form.html.erb
+++ b/backend/app/views/spree/admin/cms_pages/_form.html.erb
@@ -101,14 +101,14 @@
<% unless %w[new create].include? controller.action_name %>
<div class="row pb-0">
<% if @cms_page.type != 'Spree::Cms::Pages::StandardPage' %>
- <div class="col-12 col-md-6">
+ <div class="col-12 col-sm-7">
<%= render partial: 'spree/admin/shared/edit_resource_links' %>
</div>
<% else %>
<div class="col"></div>
<% end %>
- <div class="col-12 col-md text-right pt-3 pt-md-0">
+ <div class="col-12 col-sm text-right pt-3 pt-sm-0">
<button id="toggleMorePageSettingsButton" class="btn btn-outline-secondary" type="button" data-toggle="collapse" data-target="#cmsPageSettings" aria-expanded="false" aria-controls="collapsePageSettings">
<%= raw Spree.t('admin.cms.more_page_settings') %>
</button>
diff --git a/backend/app/views/spree/admin/cms_pages/edit.html.erb b/backend/app/views/spree/admin/cms_pages/edit.html.erb
index 435ea6f5d2..813fc71e40 100644
--- a/backend/app/views/spree/admin/cms_pages/edit.html.erb
+++ b/backend/app/views/spree/admin/cms_pages/edit.html.erb
@@ -39,7 +39,7 @@
</div>
</div>
<div class="row no-gutters">
- <div class="col-12 col-md-3 bg-light border border-right-0">
+ <div class="col-12 col-md-3 bg-light border">
<% if @cms_page.cms_sections.any? %>
<div id="cmsPagesectionsArea" class="card-body row m-0 p-1 no-gutters">
<% @cms_page.cms_sections.each do |section| %>
@@ -58,7 +58,7 @@
<% end %>
</div>
- <div class="d-none d-md-block col bg-secondary border">
+ <div class="d-none d-md-block col bg-secondary border border-left-0">
<div id="liveViewCont" class="desktopLiveView">
<div class="embed-responsive embed-responsive-4by3">
<iframe class="embed-responsive-item"
diff --git a/backend/app/views/spree/admin/cms_sections/_form.html.erb b/backend/app/views/spree/admin/cms_sections/_form.html.erb
index db104b7dd0..f1a7cf4551 100644
--- a/backend/app/views/spree/admin/cms_sections/_form.html.erb
+++ b/backend/app/views/spree/admin/cms_sections/_form.html.erb
@@ -3,7 +3,7 @@
<div class="col-12 col-md-6">
<%= f.field_container :name, class: ['form-group'] do %>
<%= f.label :name, raw(Spree.t(:name) + required_span_tag) %>
- <%= f.text_field :name, class: 'form-control', required: true %>
+ <%= f.text_field :name, class: 'form-control', required: true, autocomplete: false %>
<%= f.error_message_on :name %>
<% end %>
</div>
diff --git a/backend/app/views/spree/admin/cms_sections/edit.html.erb b/backend/app/views/spree/admin/cms_sections/edit.html.erb
index 41fb973e1e..3608a35395 100644
--- a/backend/app/views/spree/admin/cms_sections/edit.html.erb
+++ b/backend/app/views/spree/admin/cms_sections/edit.html.erb
@@ -5,9 +5,9 @@
<% content_for :page_actions do %>
<%= button_link_to(
- Spree.t('admin.cms.exit_to_full_screen_mode'),
+ Spree.t('admin.cms.go_to_fullscreen_section_manager'),
spree.edit_admin_cms_page_path(@cms_page) + '?section_editor_full_screen_mode=true',
- class: 'btn-outline-secondary', icon: 'arrows-fullscreen.svg', id: 'admin_preview_product'
+ class: 'btn-outline-secondary', icon: 'fullscreen.svg', id: 'admin_preview_product'
) %>
<% end %>
diff --git a/backend/app/views/spree/admin/cms_sections/types/_side_by_side_promotion.html.erb b/backend/app/views/spree/admin/cms_sections/types/_side_by_side_promotion.html.erb
index 292d252acd..6620c309aa 100644
--- a/backend/app/views/spree/admin/cms_sections/types/_side_by_side_promotion.html.erb
+++ b/backend/app/views/spree/admin/cms_sections/types/_side_by_side_promotion.html.erb
@@ -96,4 +96,21 @@
<small class="text-muted"><%= Spree.t('admin.cms.three_taxon_block.section_two_info') %></small>
</div>
</div>
+
+<div class="col-12"><hr></div>
+ <div class="col-6">
+ <%= f.field_container :fit, class: ['form-group'] do %>
+ <%= f.label :fit, Spree.t('admin.cms.fit') %>
+ <%= f.select(:fit, @cms_section.boundaries, {include_blank: false}, class: 'select2') %>
+ <%= f.error_message_on :fit %>
+ <% end %>
+ </div>
+
+ <div class="col-6">
+ <%= f.field_container :gutters, class: ['form-group'] do %>
+ <%= f.label :gutters, Spree.t('admin.cms.set_gutters') %>
+ <%= f.select(:gutters, @cms_section.gutters_sizes, {include_blank: false}, class: 'select2') %>
+ <%= f.error_message_on :gutters %>
+ <% end %>
+ </div>
</div>
diff --git a/backend/app/views/spree/admin/cms_sections/types/_three_taxon_categories_block.html.erb b/backend/app/views/spree/admin/cms_sections/types/_three_taxon_categories_block.html.erb
index 850eaf77e7..8aeb167589 100644
--- a/backend/app/views/spree/admin/cms_sections/types/_three_taxon_categories_block.html.erb
+++ b/backend/app/views/spree/admin/cms_sections/types/_three_taxon_categories_block.html.erb
@@ -1,7 +1,7 @@
<div class="row pb-0">
<div class="col-12 col-md-4 mb-3">
<div class="card p-3">
- <h5 class="border-bottom"><%= Spree.t('admin.cms.three_taxon_block.section_one') %></h5>
+ <h5 class="border-bottom"><%= Spree.t('admin.cms.three_taxon_block.top_left_block') %></h5>
<%= f.field_container :image_one, class: ['form-group'] do %>
<% if @cms_section.image_one.attached? && @cms_section.image_one.variable? %>
<figure class="admin-img-holder">
@@ -44,7 +44,7 @@
<div class="col-12 col-md-4 mb-3">
<div class="card p-3">
- <h5 class="border-bottom"><%= Spree.t('admin.cms.three_taxon_block.section_two') %></h5>
+ <h5 class="border-bottom"><%= Spree.t('admin.cms.three_taxon_block.right_tall_block') %></h5>
<%= f.field_container :image_two, class: ['form-group'] do %>
<% if @cms_section.image_two.attached? && @cms_section.image_two.variable? %>
<figure class="admin-img-holder">
@@ -87,7 +87,7 @@
<div class="col-12 col-md-4 mb-3">
<div class="card p-3">
- <h5 class="border-bottom"><%= Spree.t('admin.cms.three_taxon_block.section_three') %></h5>
+ <h5 class="border-bottom"><%= Spree.t('admin.cms.three_taxon_block.bottom_left_block') %></h5>
<%= f.field_container :image_three, class: ['form-group'] do %>
<% if @cms_section.image_three.attached? && @cms_section.image_three.variable? %>
<figure class="admin-img-holder">
@@ -127,4 +127,11 @@
<small class="text-muted"><%= Spree.t('admin.cms.three_taxon_block.section_three_info') %></small>
</div>
</div>
+ <div class="col-12">
+ <%= f.field_container :fit, class: ['form-group'] do %>
+ <%= f.label :fit, Spree.t('admin.cms.fit') %>
+ <%= f.select(:fit, @cms_section.boundaries, {include_blank: false}, class: 'select2') %>
+ <%= f.error_message_on :fit %>
+ <% end %>
+ </div>
</div>
diff --git a/core/app/models/spree/cms/sections/side_by_side_promotion.rb b/core/app/models/spree/cms/sections/side_by_side_promotion.rb
index b5bab17bea..8aa7038499 100644
--- a/core/app/models/spree/cms/sections/side_by_side_promotion.rb
+++ b/core/app/models/spree/cms/sections/side_by_side_promotion.rb
@@ -4,6 +4,15 @@ module Spree::Cms::Sections
store :content, accessors: [:permalink_one, :title_one, :subtitle_one,
:permalink_two, :title_two, :subtitle_two], coder: JSON
+ store :settings, accessors: [:gutters], coder: JSON
+
+ def gutters_sizes
+ ['Use gutters', 'No Gutters']
+ end
+
+ def gutters?
+ gutters == 'Use gutters'
+ end
private
diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml
index e356105c46..43aa2bf2f2 100644
--- a/core/config/locales/en.yml
+++ b/core/config/locales/en.yml
@@ -565,7 +565,7 @@ en:
vist_menu_to_edit: to edit this menu.
full_width_on_small: Full width on small devices
button_text: Button Text
- exit_to_full_screen_mode: Exit To Full Screen
+ go_to_fullscreen_section_manager: Go To Fullscreen Section Manager
page_type: Page Type
you_have_no_pages: You have no Pages, click the <b>+ Add New Page</b> button to get started.
new_page: New Page
@@ -589,12 +589,12 @@ en:
page_sections_info: 'The area below represents your %{page_type} displayed in %{store}, add sections and drag them into position'
visible: Visible
three_taxon_block:
- section_one: Section One
- section_one_info: This section is displayed in the top left of the three image block. Please use an image with an aspect ratio of 5/9.
- section_two: Section Two
- section_two_info: This section is displayed on the right as the tall banner. Please use an image with an aspect ratio of 5/9.
- section_three: Section Three
- section_three_info: This section is displayed on the left below section one. Please use an image with an aspect ratio of 5/9.
+ top_left_block: Top Left Block
+ section_one_info: 'This section is displayed in the top left of the three image block. Please use an image with an aspect ratio of 18:13 (1080px x 780px).'
+ right_tall_block: Right Tall Block
+ section_two_info: 'This section is displayed on the right as the tall banner. Please use an image with an aspect ratio of 27:40 (1080px x 1600px).'
+ bottom_left_block: Bottom Left Block
+ section_three_info: 'This section is displayed on the left below section one. Please use an image with an aspect ratio of 18:13 (1080px x 780px).'
linkable:
seach_for_a_page: Search for a page
tab:
diff --git a/frontend/app/assets/stylesheets/spree/frontend/variables/variables.scss b/frontend/app/assets/stylesheets/spree/frontend/variables/variables.scss
index c8378c677f..63f48c8092 100644
--- a/frontend/app/assets/stylesheets/spree/frontend/variables/variables.scss
+++ b/frontend/app/assets/stylesheets/spree/frontend/variables/variables.scss
@@ -62,7 +62,7 @@ $container-max-widths: (
);
// helper variables
-$container-padding: $grid-gutter-width;
+$container-padding: $grid-gutter-width / 2;
$photo-width-to-height-ratio: 30001/ 37500;
$photo-width-to-height-ratio-zoom: 28015 / 37500;
$thumbnails-carousel-single-height: 100% / $photo-width-to-height-ratio;
diff --git a/frontend/app/assets/stylesheets/spree/frontend/views/spree/home/index.scss b/frontend/app/assets/stylesheets/spree/frontend/views/spree/home/index.scss
index e0a27ed576..85f99aab0f 100644
--- a/frontend/app/assets/stylesheets/spree/frontend/views/spree/home/index.scss
+++ b/frontend/app/assets/stylesheets/spree/frontend/views/spree/home/index.scss
@@ -13,6 +13,11 @@
margin-bottom: #{$grid-gutter-width};
}
+.match-col-gap {
+ padding-left: $container-padding;
+ padding-right: $container-padding;
+}
+
.homepage {
&-hero-image {
display: flex;
@@ -70,17 +75,6 @@
&-taxon-box {
display: block;
- flex-direction: column;
- height: 140px;
- position: relative;
- overflow: hidden;
-
- img {
- display: block;
- object-fit: cover;
- width: 100%;
- height: 100%;
- }
h3 {
margin: 0;
@@ -102,14 +96,6 @@
}
}
- @include media-breakpoint-up(md) {
- height: 324px;
- }
-
- @include media-breakpoint-up(lg) {
- height: 390px;
- }
-
&-text {
width: 100%;
text-transform: uppercase;
diff --git a/frontend/app/views/spree/shared/_header.html.erb b/frontend/app/views/spree/shared/_header.html.erb
index 733b534e15..a6bc6340e9 100644
--- a/frontend/app/views/spree/shared/_header.html.erb
+++ b/frontend/app/views/spree/shared/_header.html.erb
@@ -3,7 +3,7 @@
<div id="spree-header">
<header id="header" class="d-flex align-items-center header-spree border-bottom">
<div class="container-fluid h-100 header-spree-fluid">
- <div class="d-flex flex-nowrap align-items-center h-100">
+ <div class="d-flex flex-nowrap align-items-center h-100 px-2">
<div class="d-xl-none flex-grow-1 header-spree-fluid-mobile-menu-toggler">
<button class="navbar-toggler border-0 px-0 d-flex" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-label="<%= Spree.t('nav_bar.show_menu') %>">
<%= icon(name: 'burger',
diff --git a/frontend/app/views/spree/shared/cms/sections/_side_by_side_promotion.html.erb b/frontend/app/views/spree/shared/cms/sections/_side_by_side_promotion.html.erb
index cceb24c03a..faff0bffe3 100644
--- a/frontend/app/views/spree/shared/cms/sections/_side_by_side_promotion.html.erb
+++ b/frontend/app/views/spree/shared/cms/sections/_side_by_side_promotion.html.erb
@@ -1,4 +1,21 @@
-<div class="col-12 col-lg-6">
+<% if section.gutters? %>
+ <% section_one_padding = 'pr-md-2' %>
+ <% section_two_padding = 'pl-md-2' %>
+ <% if section.fullscreen? %>
+ <% section_one_padding = 'px-3 pr-md-2' %>
+ <% section_two_padding = 'px-3 pl-md-2' %>
+ <% end %>
+<% else %>
+ <% if section.fullscreen? %>
+ <% section_one_padding = 'px-0' %>
+ <% section_two_padding = 'px-0' %>
+ <% else %>
+ <% section_one_padding = 'pr-md-0' %>
+ <% section_two_padding = 'pl-md-0' %>
+ <% end %>
+<% end %>
+
+<div class="col-12 col-md-6 mb-3 mb-md-0 <%= section_one_padding %>">
<%= link_to spree.nested_taxons_path(section.permalink_one) do %>
<div class="d-flex
align-items-end
@@ -47,7 +64,7 @@
<% end %>
</div>
-<div class="col-12 col-lg-6">
+<div class="col-12 col-md-6 <%= section_two_padding %>">
<%= link_to spree.nested_taxons_path(section.permalink_two) do %>
<div class="d-flex
align-items-end
diff --git a/frontend/app/views/spree/shared/cms/sections/_three_taxon_categories_block.html.erb b/frontend/app/views/spree/shared/cms/sections/_three_taxon_categories_block.html.erb
index ed6cbe3a93..ca3f116712 100644
--- a/frontend/app/views/spree/shared/cms/sections/_three_taxon_categories_block.html.erb
+++ b/frontend/app/views/spree/shared/cms/sections/_three_taxon_categories_block.html.erb
@@ -1,106 +1,140 @@
+<!-- Left Block -->
<div class="col-6">
+
+ <!-- Top Left Block SQUARE -->
<% if section.permalink_one.present? %>
- <%= link_to spree.nested_taxons_path(section.permalink_one), class: "homepage-taxon-box mb-3 bg-light" do %>
- <% if section.image_one.attached? && section.image_one.variable? %>
- <!-- XS to MD -->
- <img class="d-md-none lazyload"
- data-src="<%= main_app.url_for(section.image_one.attachment.variant(resize: '387x250>')) %>"
- data-srcset="<%= main_app.url_for(section.image_one.attachment.variant(resize: '387x250>')) %>"
- alt="<%= section&.title_one %>">
- <!-- MD to XL -->
- <img class="d-none d-md-block d-xl-none lazyload"
- data-src="<%= main_app.url_for(section.image_one.attachment.variant(resize: '734x476>')) %>"
- data-srcset="<%= main_app.url_for(section.image_one.attachment.variant(resize: '734x476>')) %>"
- alt="<%= section&.title_one %>">
+ <!-- margin-bottom: 3.7% is important for keeping the bottom of the sections aligned -->
+ <div class="row" style="margin-bottom: 3.7%;">
+ <div class="col-12">
- <!-- XL UP -->
- <img class="d-none d-xl-block lazyload"
- data-src="<%= main_app.url_for(section.image_one.attachment.variant(resize: '1468x952>')) %>"
- data-srcset="<%= main_app.url_for(section.image_one.attachment.variant(resize: '1468x952>')) %>"
- alt="<%= section&.title_one %>">
- <% else %>
- <div style="--aspect-ratio:54/35;">
- <%= icon( name: 'card-image',
- classes: 'homepage-taxon-box text-black-50',
- width: 26,
- height: 26) %>
+ <%= link_to spree.nested_taxons_path(section.permalink_one), class: 'homepage-taxon-box' do %>
+ <% if section.image_one.attached? && section.image_one.variable? %>
+ <!-- XS to MD -->
+ <div class="d-md-none" style="--aspect-ratio:18/13;">
+ <img class="d-md-none lazyload"
+ data-src="<%= main_app.url_for(section.image_one.attachment.variant(resize: '270x195>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_one.attachment.variant(resize: '270x195>')) %>"
+ alt="<%= section&.title_one %>">
+ </div>
+
+ <!-- MD to XL -->
+ <div class="d-none d-md-block d-xl-none" style="--aspect-ratio:18/13;">
+ <img class="lazyload"
+ data-src="<%= main_app.url_for(section.image_one.attachment.variant(resize: '540x390>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_one.attachment.variant(resize: '540x390>')) %>"
+ alt="<%= section&.title_one %>">
+ </div>
+
+ <!-- XL UP -->
+ <div class="d-none d-xl-block" style="--aspect-ratio:18/13;">
+ <img class="lazyload"
+ data-src="<%= main_app.url_for(section.image_one.attachment.variant(resize: '1080x780>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_one.attachment.variant(resize: '1080x780>')) %>"
+ alt="<%= section&.title_one %>">
+ </div>
+ <% else %>
+ <div style="--aspect-ratio:18/13;">
+ <%= icon( name: 'card-image',
+ classes: 'homepage-taxon-box text-black-50',
+ width: 26,
+ height: 26) %>
+ </div>
+ <% end %>
+ <div class="homepage-taxon-box-text" aria-label="<%= section&.title_one %>">
+ <h3 class="homepage-hpb"><%= section&.title_one %></h3>
</div>
- <% end %>
+ <% end %>
- <div class="homepage-taxon-box-text ">
- <h3 class="homepage-hpb"><%= section&.title_one %></h3>
- </div>
- <% end %>
+ </div>
+ </div>
<% end %>
+ <!-- Bottom Left Block SQUARE -->
<% if section.permalink_three.present? %>
- <%= link_to spree.nested_taxons_path(section.permalink_three), class: "homepage-taxon-box bg-light" do %>
- <% if section.image_three.attached? && section.image_three.variable? %>
- <!-- XS to MD -->
- <img class="d-md-none lazyload"
- data-src="<%= main_app.url_for(section.image_three.attachment.variant(resize: '387x250>')) %>"
- data-srcset="<%= main_app.url_for(section.image_three.attachment.variant(resize: '387x250>')) %>"
- alt="<%= section&.title_three %>">
+ <div class="row">
+ <div class="col-12">
- <!-- MD to XL -->
- <img class="d-none d-md-block d-xl-none lazyload"
- data-src="<%= main_app.url_for(section.image_three.attachment.variant(resize: '734x476>')) %>"
- data-srcset="<%= main_app.url_for(section.image_three.attachment.variant(resize: '734x476>')) %>"
- alt="<%= section&.title_three %>">
+ <%= link_to spree.nested_taxons_path(section.permalink_three), class: 'homepage-taxon-box' do %>
+ <% if section.image_three.attached? && section.image_three.variable? %>
+ <!-- XS to MD -->
+ <div class="d-md-none" style="--aspect-ratio:18/13;">
+ <img class="d-md-none lazyload"
+ data-src="<%= main_app.url_for(section.image_three.attachment.variant(resize: '270x195>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_three.attachment.variant(resize: '270x195>')) %>"
+ alt="<%= section&.title_three %>">
+ </div>
- <!-- XL UP -->
- <img class="d-none d-xl-block lazyload"
- data-src="<%= main_app.url_for(section.image_three.attachment.variant(resize: '1468x952>')) %>"
- data-srcset="<%= main_app.url_for(section.image_three.attachment.variant(resize: '1468x952>')) %>"
- alt="<%= section&.title_three %>">
- <% else %>
- <div style="--aspect-ratio:54/35;">
- <%= icon( name: 'card-image',
- classes: 'homepage-taxon-box text-black-50',
- width: 26,
- height: 26) %>
+ <!-- MD to XL -->
+ <div class="d-none d-md-block d-xl-none" style="--aspect-ratio:18/13;">
+ <img class="lazyload"
+ data-src="<%= main_app.url_for(section.image_three.attachment.variant(resize: '540x390>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_three.attachment.variant(resize: '540x390>')) %>"
+ alt="<%= section&.title_three %>">
+ </div>
+
+ <!-- XL UP -->
+ <div class="d-none d-xl-block" style="--aspect-ratio:18/13;">
+ <img class="lazyload"
+ data-src="<%= main_app.url_for(section.image_three.attachment.variant(resize: '1080x780>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_three.attachment.variant(resize: '1080x780>')) %>"
+ alt="<%= section&.title_three %>">
+ </div>
+ <% else %>
+ <div style="--aspect-ratio:18/13;">
+ <%= icon( name: 'card-image',
+ classes: 'homepage-taxon-box text-black-50',
+ width: 26,
+ height: 26) %>
+ </div>
+ <% end %>
+ <div class="homepage-taxon-box-text" aria-label="<%= section&.title_three %>">
+ <h3 class="homepage-hpb"><%= section&.title_three %></h3>
</div>
- <% end %>
+ <% end %>
- <div class="homepage-taxon-box-text" role="img" aria-label="Sportswear">
- <h3 class="homepage-hpb"><%= section&.title_three %></h3>
</div>
- <% end %>
+ </div>
<% end %>
</div>
-<div class="col-6 d-flex flex-column">
+<!-- Right Block TALL -->
+<div class="col-6">
<% if section.permalink_two.present? %>
- <%= link_to spree.nested_taxons_path(section.permalink_two), class: "homepage-taxon-box flex-grow-1 bg-light" do %>
+ <%= link_to spree.nested_taxons_path(section.permalink_two), class: 'homepage-taxon-box' do %>
<% if section.image_two.attached? && section.image_two.variable? %>
<!-- XS to MD -->
- <img class="d-md-none lazyload"
- data-src="<%= main_app.url_for(section.image_two.variant(resize: '387x250>')) %>"
- data-srcset="<%= main_app.url_for(section.image_two.variant(resize: '387x250>')) %>"
+ <div class="d-md-none" style="--aspect-ratio:27/40;">
+ <img class="lazyload"
+ data-src="<%= main_app.url_for(section.image_two.variant(resize: '270x400>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_two.variant(resize: '270x400>')) %>"
alt="<%= section&.title_two %>">
+ </div>
<!-- MD to XL -->
- <img class="d-none d-md-block d-xl-none lazyload"
- data-src="<%= main_app.url_for(section.image_two.variant(resize: '734x476>')) %>"
- data-srcset="<%= main_app.url_for(section.image_two.variant(resize: '734x476>')) %>"
+ <div class="d-none d-md-block d-xl-none " style="--aspect-ratio:27/40;">
+ <img class="lazyload"
+ data-src="<%= main_app.url_for(section.image_two.variant(resize: '540x800>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_two.variant(resize: '540x800>')) %>"
alt="<%= section&.title_two %>">
+ </div>
<!-- XL UP -->
- <img class="d-none d-xl-block lazyload"
- data-src="<%= main_app.url_for(section.image_two.variant(resize: '1468x952>')) %>"
- data-srcset="<%= main_app.url_for(section.image_two.variant(resize: '1468x952>')) %>"
+ <div class="d-none d-xl-block" style="--aspect-ratio:27/40;">
+ <img class="lazyload"
+ data-src="<%= main_app.url_for(section.image_two.variant(resize: '1080x1600>')) %>"
+ data-srcset="<%= main_app.url_for(section.image_two.variant(resize: '1080x1600>')) %>"
alt="<%= section&.title_two %>">
- <% else %>
- <div style="--aspect-ratio:27/40; margin: 50px;">
- <%= icon( name: 'file-image',
- classes: 'homepage-taxon-box text-black-50',
- width: 26,
- height: 26) %>
- </div>
- <% end %>
-
- <div class="homepage-taxon-box-text">
+ </div>
+ <% else %>
+ <div style="--aspect-ratio:27/40; margin: 50px;">
+ <%= icon( name: 'file-image',
+ classes: 'homepage-taxon-box text-black-50',
+ width: 26,
+ height: 26) %>
+ </div>
+ <% end %>
+ <div class="homepage-taxon-box-text" aria-label="<%= section&.title_two %>">
<h3 class="homepage-hpb"><%= section&.title_two %></h3>
</div>
<% end %>