wickes-css2 2.103.0-0.5.0-icons.4 → 2.103.0-0.5.0-icons.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +1 -1
- package/build/css/components/card-product-banner.css +1 -1
- package/build/css/main.css +1 -1
- package/build/css/pages/page_products-list-combined.css +1 -1
- package/build/css/pages/page_products-list.css +1 -1
- package/build/css/plp-main.css +1 -1
- package/build/js/basket.min.js +1 -1
- package/build/js/bundle.min.js +1 -1
- package/build/js/checkout.min.js +1 -1
- package/build/js/emulation.min.js +54 -0
- package/build/js/merged-checkout.min.js +1 -1
- package/build/js/page/plp-cards-v2.js +15 -6
- package/build/js/page/plp-load-more.js +1 -1
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/project-list.min.js +1 -1
- package/package.json +1 -1
- package/src/components/card_product_v2.hbs +10 -5
- package/src/components/card_sponsor_banner.hbs +8 -0
- package/src/components/card_sponsor_product.hbs +6 -0
- package/src/components/injected-content.hbs +1 -1
- package/src/data/data_search-results_v2.json +56 -141
- package/src/js/components/banner-placement-manager.js +267 -0
- package/src/js/emulation/banner-placement-manager.js +53 -0
- package/src/js/page/plp-cards-v2.js +15 -6
- package/src/js/page/plp-load-more.js +1 -1
- package/src/page_plp_v2.html +16 -6
- package/src/page_search-results.html +12 -2
- package/src/scss/components/card-product-banner.scss +91 -3
- package/src/scss/emulation.scss +3 -3
- package/src/scss/pages/page_products-list-combined.scss +11 -0
- package/src/scss/pages/page_products-list.scss +8 -0
- package/src/js/components/product-banner.js +0 -148
package/src/page_plp_v2.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{{#extend "base" hybrisClass="hybris-class" pageClass="products-list-page category-seo-config" title="Products list" globalSearchV2="true" pagePlp=true}}
|
|
1
|
+
{{#extend "base" hybrisClass="hybris-class" pageClass="products-list-page retail-media category-seo-config" title="Products list" globalSearchV2="true" pagePlp=true}}
|
|
2
2
|
{{#content "head" mode="append" pagePlp=true}}
|
|
3
3
|
<link type="text/css" rel="stylesheet" href="./css/components/global-search.css">
|
|
4
4
|
{{/content}}
|
|
@@ -33,13 +33,23 @@
|
|
|
33
33
|
</div>
|
|
34
34
|
|
|
35
35
|
<div class="products-list products-list-v2">
|
|
36
|
-
{{#each
|
|
37
|
-
|
|
36
|
+
{{#each search-result_v2.products}}
|
|
37
|
+
{{>card_product_v2}}
|
|
38
38
|
{{/each}}
|
|
39
39
|
{{#if search-result_v2.product-banner}}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
{{#each search-result_v2.product-banner}}
|
|
41
|
+
{{>card_product_banner_v2}}
|
|
42
|
+
{{/each}}
|
|
43
|
+
{{/if}}
|
|
44
|
+
{{#if search-result_v2.sponsor-banner}}
|
|
45
|
+
{{#each search-result_v2.sponsor-banner}}
|
|
46
|
+
{{>card_sponsor_banner}}
|
|
47
|
+
{{/each}}
|
|
48
|
+
{{/if}}
|
|
49
|
+
{{#if search-result_v2.sponsor-product}}
|
|
50
|
+
{{#each search-result_v2.sponsor-product}}
|
|
51
|
+
{{>card_sponsor_product}}
|
|
52
|
+
{{/each}}
|
|
43
53
|
{{/if}}
|
|
44
54
|
</div>
|
|
45
55
|
<div class="load-more-wrap">
|
|
@@ -42,9 +42,19 @@
|
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
44
|
<div class="products-list products-list-v2">
|
|
45
|
-
{{#each
|
|
46
|
-
{{>
|
|
45
|
+
{{#each search-result_v2.products}}
|
|
46
|
+
{{>card_product_v2}}
|
|
47
47
|
{{/each}}
|
|
48
|
+
{{#if search-result_v2.sponsor-banner}}
|
|
49
|
+
{{#each search-result_v2.sponsor-banner}}
|
|
50
|
+
{{>card_sponsor_banner}}
|
|
51
|
+
{{/each}}
|
|
52
|
+
{{/if}}
|
|
53
|
+
{{#if search-result_v2.sponsor-product}}
|
|
54
|
+
{{#each search-result_v2.sponsor-product}}
|
|
55
|
+
{{>card_sponsor_product}}
|
|
56
|
+
{{/each}}
|
|
57
|
+
{{/if}}
|
|
48
58
|
</div>
|
|
49
59
|
|
|
50
60
|
<div class="sort-products-list">
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
@include make-col(4);
|
|
5
5
|
margin-bottom: 30px;
|
|
6
6
|
|
|
7
|
-
@include media-breakpoint-down(md) {
|
|
7
|
+
@include media-breakpoint-down(md) {
|
|
8
8
|
@include make-col(6);
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
padding: 0 15px;
|
|
40
40
|
|
|
41
41
|
@include media-breakpoint-down(sm) {
|
|
42
|
-
display: inline-block;
|
|
42
|
+
display: inline-block;
|
|
43
43
|
padding: 0;
|
|
44
44
|
width: 100%;
|
|
45
45
|
}
|
|
@@ -49,4 +49,92 @@
|
|
|
49
49
|
display: inline-block;
|
|
50
50
|
width: 100%;
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.products-list {
|
|
55
|
+
.card-sponsor-product,
|
|
56
|
+
.card-sponsor-banner {
|
|
57
|
+
@include make-col(4);
|
|
58
|
+
margin-bottom: 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.card-sponsor-banner {
|
|
62
|
+
&__link {
|
|
63
|
+
display: inline-block;
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: 100%;
|
|
66
|
+
padding: 0 15px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&__image {
|
|
70
|
+
display: inline-block;
|
|
71
|
+
width: 100%;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.card-sponsor-product {
|
|
76
|
+
.product-card {
|
|
77
|
+
max-width: 100%;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.product-card__sponsored {
|
|
82
|
+
@include font-size(12);
|
|
83
|
+
@include line-height(16);
|
|
84
|
+
color: $squant;
|
|
85
|
+
font-weight: 400;
|
|
86
|
+
margin-top: -3px;
|
|
87
|
+
margin-bottom: 15px;
|
|
88
|
+
padding: 2px 4px;
|
|
89
|
+
|
|
90
|
+
&:not(.product-card__sponsored--empty) {
|
|
91
|
+
width: max-content;
|
|
92
|
+
background: $gray-light;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@include media-breakpoint-down(md) {
|
|
98
|
+
.products-list {
|
|
99
|
+
.card-sponsor-product,
|
|
100
|
+
.card-sponsor-banner {
|
|
101
|
+
@include make-col(6);
|
|
102
|
+
|
|
103
|
+
.card {
|
|
104
|
+
max-width: 100%;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.products-list-v2 {
|
|
110
|
+
.card-sponsor-product:nth-of-type(n+3) {
|
|
111
|
+
.card {
|
|
112
|
+
&:before {
|
|
113
|
+
content: none;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@include media-breakpoint-down(sm) {
|
|
121
|
+
.products-list {
|
|
122
|
+
.product-card__sponsored {
|
|
123
|
+
margin-right: auto;
|
|
124
|
+
margin-left: auto;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.card-sponsor-banner {
|
|
128
|
+
position: relative;
|
|
129
|
+
|
|
130
|
+
&::after {
|
|
131
|
+
content: '';
|
|
132
|
+
position: absolute;
|
|
133
|
+
bottom: 20px;
|
|
134
|
+
left: 5px;
|
|
135
|
+
width: calc(100% - 10px);
|
|
136
|
+
border-bottom: 1px solid $gray;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
package/src/scss/emulation.scss
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
&__address {
|
|
31
31
|
.fa-map-marker-alt {
|
|
32
|
-
max-width: .75rem;
|
|
32
|
+
max-width: 0.75rem;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.offer-banner__link-arrow {
|
|
57
|
-
max-width: .625rem;
|
|
57
|
+
max-width: 0.625rem;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
@include media-breakpoint-down(sm) {
|
|
61
|
-
.cards-store-list:not(:nth-child(-n+4)) {
|
|
61
|
+
.cards-store-list:not(:nth-child(-n + 4)) {
|
|
62
62
|
display: none;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -47,6 +47,17 @@ $color-bar-radius: 3px;
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
.sponsor-top-banner {
|
|
51
|
+
margin-bottom: 20px;
|
|
52
|
+
margin-top: 10px;
|
|
53
|
+
|
|
54
|
+
&__image {
|
|
55
|
+
display: block;
|
|
56
|
+
max-width: 100%;
|
|
57
|
+
margin-bottom: 20px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
50
61
|
.color-pick {
|
|
51
62
|
&__wrap {
|
|
52
63
|
display: none;
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
var Wick = Wick || {};
|
|
2
|
-
Wick.ProductBanner = {
|
|
3
|
-
el: {
|
|
4
|
-
banners: '.card-product-banner',
|
|
5
|
-
bannerInactiveClass: 'card-product-banner--inactive',
|
|
6
|
-
productsWrap: '.products-list-v2',
|
|
7
|
-
$products: $('.product-card'),
|
|
8
|
-
attrPositionDesktop: 'data-desktop-position',
|
|
9
|
-
attrPositionMobile: 'data-mobile-position',
|
|
10
|
-
attrRequiredAmountDesktop: 'data-required-amount-desktop',
|
|
11
|
-
attrRequiredAmountMobile: 'data-required-amount-mobile',
|
|
12
|
-
hide: 'd-none'
|
|
13
|
-
},
|
|
14
|
-
currentBreakpoint: null,
|
|
15
|
-
checkProductsInColumn() {
|
|
16
|
-
Wick.ProductBanner.addInactiveClasses();
|
|
17
|
-
Wick.ProductBanner.arrangeBannersInRightOrder();
|
|
18
|
-
$(Wick.ProductBanner.el.banners).each((index, banner) => {
|
|
19
|
-
Wick.ProductBanner.hideBannerDueLimit(banner, index);
|
|
20
|
-
Wick.ProductBanner.moveBannerToSpecifiedPosition(banner);
|
|
21
|
-
});
|
|
22
|
-
},
|
|
23
|
-
moveBannerToSpecifiedPosition(banner) {
|
|
24
|
-
const $listSlots = Wick.ProductBanner.getListSlots();
|
|
25
|
-
const bannerPosition = Wick.ProductBanner.getBannerPosition(banner) - 2;
|
|
26
|
-
const listSlotsLength = $listSlots.length;
|
|
27
|
-
|
|
28
|
-
if(Wick.ProductBanner.isBannerVisible(banner)) {
|
|
29
|
-
if (bannerPosition <= listSlotsLength) {
|
|
30
|
-
if ($listSlots[bannerPosition]) {
|
|
31
|
-
Wick.ProductBanner.showBanner(banner);
|
|
32
|
-
Wick.ProductBanner.removeInactiveClass(banner);
|
|
33
|
-
Wick.ProductBanner.moveBanner(banner, $listSlots[bannerPosition]);
|
|
34
|
-
} else {
|
|
35
|
-
Wick.ProductBanner.hideBanner(banner);
|
|
36
|
-
Wick.ProductBanner.coverEdgeCases(banner);
|
|
37
|
-
}
|
|
38
|
-
} else {
|
|
39
|
-
Wick.ProductBanner.hideBanner(banner);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
moveBanner(banner, targetElement) {
|
|
44
|
-
$(banner).remove();
|
|
45
|
-
$(targetElement).after(banner);
|
|
46
|
-
},
|
|
47
|
-
hideBanner(banner) {
|
|
48
|
-
$(banner).addClass(Wick.ProductBanner.el.hide);
|
|
49
|
-
},
|
|
50
|
-
showBanner(banner) {
|
|
51
|
-
$(banner).removeClass(Wick.ProductBanner.el.hide);
|
|
52
|
-
},
|
|
53
|
-
isBannerVisible(banner) {
|
|
54
|
-
return !$(banner).hasClass(Wick.ProductBanner.el.hide);
|
|
55
|
-
},
|
|
56
|
-
hideBannerDueLimit(banner) {
|
|
57
|
-
const bannerMinLimit = Wick.ProductBanner.getBannerLimit(banner) - 1;
|
|
58
|
-
const $listSlots = Wick.ProductBanner.getListSlots();
|
|
59
|
-
const listProductsLength = $listSlots.length;
|
|
60
|
-
Wick.ProductBanner.showBanner(banner);
|
|
61
|
-
|
|
62
|
-
if (bannerMinLimit > listProductsLength) {
|
|
63
|
-
Wick.ProductBanner.hideBanner(banner);
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
getBannerPosition(banner) {
|
|
67
|
-
const isMobile = Wick.ProductBanner.isMobileResolution();
|
|
68
|
-
const positionAttribute = isMobile
|
|
69
|
-
? Wick.ProductBanner.el.attrPositionMobile
|
|
70
|
-
: Wick.ProductBanner.el.attrPositionDesktop
|
|
71
|
-
|
|
72
|
-
return banner.hasAttribute(positionAttribute)
|
|
73
|
-
? Number(banner.getAttribute(positionAttribute))
|
|
74
|
-
: Number(Wick.ProductBanner.getListLength() + Wick.ProductBanner.getBannersAmount());
|
|
75
|
-
},
|
|
76
|
-
getBannerLimit(banner) {
|
|
77
|
-
const isMobile = Wick.ProductBanner.isMobileResolution();
|
|
78
|
-
|
|
79
|
-
const limitAttribute = isMobile
|
|
80
|
-
? Wick.ProductBanner.el.attrRequiredAmountMobile
|
|
81
|
-
: Wick.ProductBanner.el.attrRequiredAmountDesktop;
|
|
82
|
-
|
|
83
|
-
return banner.hasAttribute(limitAttribute)
|
|
84
|
-
? Number(banner.getAttribute(limitAttribute))
|
|
85
|
-
: 0;
|
|
86
|
-
},
|
|
87
|
-
isMobileResolution() {
|
|
88
|
-
return Wick.Responsive.getCurrentBreakpoint() !== 'up-lg';
|
|
89
|
-
},
|
|
90
|
-
getListLength() {
|
|
91
|
-
const $listItems = $(Wick.ProductBanner.el.productsWrap).find('.product-card');
|
|
92
|
-
return $listItems.length;
|
|
93
|
-
},
|
|
94
|
-
getBannersAmount() {
|
|
95
|
-
return $(Wick.ProductBanner.el.banners).length;
|
|
96
|
-
},
|
|
97
|
-
getProductsAmount() {
|
|
98
|
-
return Wick.ProductBanner.el.$products.length;
|
|
99
|
-
},
|
|
100
|
-
arrangeBannersInRightOrder() {
|
|
101
|
-
$(Wick.ProductBanner.el.banners).sort((a, b) => {
|
|
102
|
-
let bannerPositionA = Wick.ProductBanner.getBannerPosition(a);
|
|
103
|
-
let bannerPositionB = Wick.ProductBanner.getBannerPosition(b);
|
|
104
|
-
|
|
105
|
-
return bannerPositionA - bannerPositionB
|
|
106
|
-
}).appendTo(Wick.ProductBanner.el.productsWrap);
|
|
107
|
-
},
|
|
108
|
-
addInactiveClasses() {
|
|
109
|
-
$(Wick.ProductBanner.el.banners).addClass(Wick.ProductBanner.el.bannerInactiveClass);
|
|
110
|
-
},
|
|
111
|
-
removeInactiveClass(banner) {
|
|
112
|
-
$(banner).removeClass(Wick.ProductBanner.el.bannerInactiveClass)
|
|
113
|
-
},
|
|
114
|
-
insertFirstBanner(banner) {
|
|
115
|
-
const bannerPosition = Wick.ProductBanner.getBannerPosition(banner);
|
|
116
|
-
|
|
117
|
-
if (bannerPosition === 1) {
|
|
118
|
-
Wick.ProductBanner.showBanner(banner);
|
|
119
|
-
Wick.ProductBanner.removeInactiveClass(banner);
|
|
120
|
-
$(banner).remove();
|
|
121
|
-
$(Wick.ProductBanner.el.productsWrap).prepend(banner);
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
coverEdgeCases(banner) {
|
|
125
|
-
Wick.ProductBanner.insertFirstBanner(banner);
|
|
126
|
-
},
|
|
127
|
-
getListSlots() {
|
|
128
|
-
return $(Wick.ProductBanner.el.productsWrap)
|
|
129
|
-
.find('.product-card, .card-product-banner:not(.card-product-banner--inactive)');
|
|
130
|
-
},
|
|
131
|
-
init() {
|
|
132
|
-
Wick.Responsive.onResize(function () {
|
|
133
|
-
if(Wick.ProductBanner.currentBreakpoint !== Wick.Responsive.getCurrentBreakpoint()) {
|
|
134
|
-
Wick.ProductBanner.currentBreakpoint = Wick.Responsive.getCurrentBreakpoint()
|
|
135
|
-
Wick.ProductBanner.checkProductsInColumn();
|
|
136
|
-
$(window).trigger('productBannerPositionChanged');
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
$(document).ready(function () {
|
|
143
|
-
if (!Wick.ProductBanner.getBannersAmount() || !Wick.ProductBanner.getProductsAmount()) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
Wick.ProductBanner.init();
|
|
148
|
-
})
|