wickes-css2 2.99.0-develop.2 → 2.99.0-develop.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wickes-css2",
3
- "version": "2.99.0-develop.2",
3
+ "version": "2.99.0-develop.3",
4
4
  "description": "CSS and JS and page templates in use by Wickes",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -193,6 +193,36 @@
193
193
  "btnUrl": "#"
194
194
  }
195
195
  ],
196
+ "reward_cards4": [
197
+ {
198
+ "imgSrc": "./img/placeholders/img-placeholder-rewards.png",
199
+ "title": "TradePro Active 15% off",
200
+ "description": "Short description",
201
+ "btnText": "Learn more",
202
+ "btnUrl": "#"
203
+ },
204
+ {
205
+ "imgSrc": "./img/placeholders/img-placeholder-rewards.png",
206
+ "title": "TradePro wit short description and long title that takes more lines",
207
+ "description": "Short description",
208
+ "btnText": "Learn more",
209
+ "btnUrl": "#"
210
+ },
211
+ {
212
+ "imgSrc": "./img/placeholders/img-placeholder-rewards.png",
213
+ "title": "TradePro with short description",
214
+ "description": "Short description that long and takes two lines of content",
215
+ "btnText": "Learn more",
216
+ "btnUrl": "#"
217
+ },
218
+ {
219
+ "imgSrc": "./img/placeholders/img-placeholder-rewards.png",
220
+ "title": "TradePro without short description",
221
+ "description": "",
222
+ "btnText": "Learn more",
223
+ "btnUrl": "#"
224
+ }
225
+ ],
196
226
  "reward_card": [
197
227
  {
198
228
  "imgSrc": "./img/placeholders/img-placeholder-rewards.png",
@@ -1,11 +1,15 @@
1
- function isElementInHorizontalViewport(el) {
2
- if (typeof jQuery === 'function' && el instanceof jQuery) {
3
- el = el[0];
4
- }
5
- var rect = el.getBoundingClientRect();
1
+ function isElementInHorizontalContainer(el, container) {
2
+ if (el instanceof jQuery) el = el[0];
3
+ if (container instanceof jQuery) container = container[0];
4
+
5
+ if (!el || !container) return false;
6
+
7
+ const elRect = el.getBoundingClientRect();
8
+ const containerRect = container.getBoundingClientRect();
9
+
6
10
  return (
7
- rect.left >= 0 &&
8
- rect.right <= (window.innerWidth || document.documentElement.clientWidth)
11
+ elRect.left >= containerRect.left &&
12
+ elRect.right <= containerRect.right
9
13
  );
10
14
  }
11
15
 
@@ -39,9 +43,14 @@ $(document).ready(function () {
39
43
  },
40
44
  });
41
45
 
46
+ function isXLScreen() {
47
+ return 1200 <= (window.innerWidth || document.documentElement.clientWidth);
48
+ }
49
+
42
50
  function isEverySlideVisible() {
51
+ const visibleContainer = isXLScreen() ? $container : $slider.closest('.cards-slider-boundary');
43
52
  var $slides = $slider.find('.cards-swiper-wrapper .swiper-slide');
44
- return $slides.filter((index, slide) => isElementInHorizontalViewport($(slide))).length === $slides.length;
53
+ return $slides.filter((index, slide) => isElementInHorizontalContainer($(slide), visibleContainer)).length === $slides.length;
45
54
  }
46
55
 
47
56
  function updateUI() {
@@ -0,0 +1,46 @@
1
+ {{#extend "my-account-v2"
2
+ pageClass="page_tradePro-rewards"
3
+ title="TradePro Rewards 4 Elements"
4
+ logo-tp=true
5
+ tradepro-nav=true
6
+ pageMyAcc=true
7
+ myAccV2=true
8
+ isLoggedIn=true
9
+ mainClass="pt-0"
10
+ dataBreadcrumbs=my_account.tradeProRewards.breadcrumbsHomePage
11
+ }}
12
+ {{#content "head" mode="append"}}
13
+ <link type="text/css" rel="stylesheet" href="./css/pages/tradePro-rewards.css">
14
+ {{/content}}
15
+ {{#content "main"}}
16
+ <div class="container">
17
+ <div class="row">
18
+ <div class="col-12">
19
+ {{> my-account/mobile-nav
20
+ menu=my_account.tradepro.menu
21
+ active-index=4
22
+ page-name=my_account.tradepro.menu.[4].title
23
+ }}
24
+ </div>
25
+ </div>
26
+ </div>
27
+
28
+ {{#extend "cards-slider"
29
+ title="TradePro Rewards"
30
+ }}
31
+ {{#content "cards"}}
32
+ {{#each page_tradePro_cards.reward_cards4}}
33
+ {{> reward_card
34
+ modificator="swiper-slide"
35
+ imgSrc=imgSrc
36
+ title=title
37
+ description=description
38
+ btnText=btnText
39
+ btnUrl=btnUrl
40
+ }}
41
+ {{/each}}
42
+ {{/content}}
43
+ {{/extend}}
44
+
45
+ {{/content}}
46
+ {{/extend}}
package/src/sitemap.html CHANGED
@@ -689,6 +689,10 @@
689
689
  <span class="page-id">10.12</span>
690
690
  <a href="page_tradePro_rewards_home.html" target="_blank">TradePro Rewards Home</a>
691
691
  </li>
692
+ <li>
693
+ <span class="page-id"></span>
694
+ <a href="page_tradePro_rewards_home_4_el.html" target="_blank">TradePro Rewards Home 4 Elements</a>
695
+ </li>
692
696
  <li>
693
697
  <span class="page-id">10.13</span>
694
698
  <a href="page_tradePro_rewards_home_single.html" target="_blank">TradePro Rewards Home Single Carousel Element</a>