@shift72/core-template 1.9.20 → 1.9.21

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.
Files changed (47) hide show
  1. package/CHANGELOG.md +25 -1
  2. package/kibble.json +1 -1
  3. package/package.json +1 -1
  4. package/site/ar_LB.all.json +3 -0
  5. package/site/ca_ES.all.json +3 -0
  6. package/site/da_DK.all.json +3 -0
  7. package/site/de_DE.all.json +3 -0
  8. package/site/el_EL.all.json +3 -0
  9. package/site/en_AU.all.json +4 -1
  10. package/site/es_ES.all.json +3 -0
  11. package/site/es_MX.all.json +3 -0
  12. package/site/et_ET.all.json +3 -0
  13. package/site/fi_FI.all.json +3 -0
  14. package/site/fr_FR.all.json +3 -0
  15. package/site/hr_HR.all.json +3 -0
  16. package/site/hu_HU.all.json +3 -0
  17. package/site/it_IT.all.json +3 -0
  18. package/site/ja_JP.all.json +3 -0
  19. package/site/lt_LT.all.json +3 -0
  20. package/site/nl_BE.all.json +3 -0
  21. package/site/no_NO.all.json +3 -0
  22. package/site/pl_PL.all.json +4 -1
  23. package/site/pt_BR.all.json +3 -0
  24. package/site/pt_PT.all.json +3 -0
  25. package/site/ru_RU.all.json +3 -0
  26. package/site/sr_SR.all.json +3 -0
  27. package/site/static/js/carousel-video-mute-button.component.js +38 -0
  28. package/site/static/js/icons/carousel-video-muted-icon.js +7 -0
  29. package/site/static/js/icons/carousel-video-unmuted-icon.js +7 -0
  30. package/site/static/js/main.js +96 -41
  31. package/site/styles/_buttons.scss +2 -1
  32. package/site/styles/_carousel.scss +13 -0
  33. package/site/styles/_collections.scss +9 -4
  34. package/site/styles/_cta-buttons.scss +16 -0
  35. package/site/styles/_library.scss +6 -0
  36. package/site/styles/_variables.scss +2 -2
  37. package/site/styles/_wishlist.scss +4 -0
  38. package/site/templates/application/application.jet +2 -2
  39. package/site/templates/collection/carousel/item/image.jet +10 -2
  40. package/site/templates/collection/carousel/item/video.jet +6 -0
  41. package/site/templates/collection/carousel/item.jet +13 -1
  42. package/site/templates/collection/continue_watching.jet +1 -1
  43. package/site/templates/collection/wishlist.jet +19 -32
  44. package/site/templates/common/cta_buttons.jet +15 -2
  45. package/site/tr_TR.all.json +3 -0
  46. package/site/uk_UA.all.json +3 -0
  47. package/site/zh_TW.all.json +3 -0
package/CHANGELOG.md CHANGED
@@ -1,10 +1,29 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased](https://github.com/shift72/core-template/compare/1.9.20...HEAD)
3
+ ## [Unreleased](https://github.com/shift72/core-template/compare/1.9.21...HEAD)
4
+
5
+ ## [1.9.21](https://github.com/shift72/core-template/compare/1.9.20...1.9.21)
6
+
7
+ ### Added
8
+
9
+ - Purchase gift CTA button
10
+ - Carousel video support
11
+
12
+ ### Fixed
13
+
14
+ - Turn off infinite scroll on the wishlist/continue watching sliders. This
15
+ caused some funkiness if items were removed after scrolling the slider.
16
+ - Fixed alignment on collection rows. The first item had a negative margin hack
17
+ to align with headings, but this didn't affect subsequent rows causing the
18
+ posters to be skewed by 5px. The fix applies the negative margin to the
19
+ entire container.
20
+ - Slightly reduce spacing between poster and the title below. In grid views this
21
+ makes it less ambiguous which poster the text is associated with.
4
22
 
5
23
  ## [1.9.20](https://github.com/shift72/core-template/compare/1.9.19...1.9.20)
6
24
 
7
25
  ### Fixed
26
+
8
27
  - Typo in translation for ad tracking settings
9
28
  - Positioning of plan label
10
29
  - TV seasons not showing season number under posters in sliders / search results etc.
@@ -12,22 +31,27 @@
12
31
  ## [1.9.19](https://github.com/shift72/core-template/compare/1.9.18...1.9.19)
13
32
 
14
33
  ### Added
34
+
15
35
  - Support for Ad consent tracking option on user account settings
16
36
 
17
37
  ### Changed
38
+
18
39
  - Deploy commands, now use npm run deploy to deploy
19
40
 
20
41
  ## [1.9.18](https://github.com/shift72/core-template/compare/1.9.17...1.9.18)
21
42
 
22
43
  ### Changed
44
+
23
45
  - Remove polyfill.io CDN in favour for Cloudflare
24
46
 
25
47
  ## [1.9.17](https://github.com/shift72/core-template/compare/1.9.16...1.9.17)
26
48
 
27
49
  ### Added
50
+
28
51
  - Continue watching slider
29
52
 
30
53
  ### Changed
54
+
31
55
  - Reduced carousel height slightly
32
56
  - css: use `--button-text-color` instead of `--body-bg` for `--tooltip-color`
33
57
 
package/kibble.json CHANGED
@@ -194,5 +194,5 @@
194
194
  "pageSize": 0
195
195
  }
196
196
  ],
197
- "coreTemplateVersion": "1.9.20"
197
+ "coreTemplateVersion": "1.9.21"
198
198
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shift72/core-template",
3
- "version": "1.9.20",
3
+ "version": "1.9.21",
4
4
  "description": "Shift72 core template",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -1803,5 +1803,8 @@
1803
1803
  },
1804
1804
  "account_form_ad_privacy_settings": {
1805
1805
  "other": "إعدادات خصوصية الإعلان"
1806
+ },
1807
+ "gift_purchase_button_label": {
1808
+ "other": "شراء كهدية"
1806
1809
  }
1807
1810
  }
@@ -1739,5 +1739,8 @@
1739
1739
  },
1740
1740
  "account_form_ad_privacy_settings": {
1741
1741
  "other": "Configuració de privadesa dels anuncis"
1742
+ },
1743
+ "gift_purchase_button_label": {
1744
+ "other": "Compra com a regal"
1742
1745
  }
1743
1746
  }
@@ -1739,5 +1739,8 @@
1739
1739
  },
1740
1740
  "account_form_ad_privacy_settings": {
1741
1741
  "other": "Indstillinger for annoncebeskyttelse"
1742
+ },
1743
+ "gift_purchase_button_label": {
1744
+ "other": "Køb som gave"
1742
1745
  }
1743
1746
  }
@@ -1739,5 +1739,8 @@
1739
1739
  },
1740
1740
  "account_form_ad_privacy_settings": {
1741
1741
  "other": "Datenschutzeinstellungen für Anzeigen"
1742
+ },
1743
+ "gift_purchase_button_label": {
1744
+ "other": "Als Geschenk kaufen"
1742
1745
  }
1743
1746
  }
@@ -1739,5 +1739,8 @@
1739
1739
  },
1740
1740
  "account_form_ad_privacy_settings": {
1741
1741
  "other": "Ρυθμίσεις απορρήτου διαφημίσεων"
1742
+ },
1743
+ "gift_purchase_button_label": {
1744
+ "other": "Αγορά ως δώρο"
1742
1745
  }
1743
1746
  }
@@ -1739,5 +1739,8 @@
1739
1739
  },
1740
1740
  "account_form_ad_privacy_settings": {
1741
1741
  "other": "Ad privacy settings"
1742
+ },
1743
+ "gift_purchase_button_label": {
1744
+ "other": "Purchase as gift"
1742
1745
  }
1743
- }
1746
+ }
@@ -1743,5 +1743,8 @@
1743
1743
  },
1744
1744
  "account_form_ad_privacy_settings": {
1745
1745
  "other": "Configuración de privacidad de anuncios"
1746
+ },
1747
+ "gift_purchase_button_label": {
1748
+ "other": "Comprar como regalo"
1746
1749
  }
1747
1750
  }
@@ -1743,5 +1743,8 @@
1743
1743
  },
1744
1744
  "account_form_ad_privacy_settings": {
1745
1745
  "other": "Configuración de privacidad de anuncios"
1746
+ },
1747
+ "gift_purchase_button_label": {
1748
+ "other": "Comprar como regalo"
1746
1749
  }
1747
1750
  }
@@ -1739,5 +1739,8 @@
1739
1739
  },
1740
1740
  "account_form_ad_privacy_settings": {
1741
1741
  "other": "Reklaami privaatsusseaded"
1742
+ },
1743
+ "gift_purchase_button_label": {
1744
+ "other": "Ostke kingituseks"
1742
1745
  }
1743
1746
  }
@@ -1739,5 +1739,8 @@
1739
1739
  },
1740
1740
  "account_form_ad_privacy_settings": {
1741
1741
  "other": "Mainosten tietosuoja-asetukset"
1742
+ },
1743
+ "gift_purchase_button_label": {
1744
+ "other": "Osta lahjaksi"
1742
1745
  }
1743
1746
  }
@@ -1743,5 +1743,8 @@
1743
1743
  },
1744
1744
  "account_form_ad_privacy_settings": {
1745
1745
  "other": "Paramètres de confidentialité des annonces"
1746
+ },
1747
+ "gift_purchase_button_label": {
1748
+ "other": "Acheter en cadeau"
1746
1749
  }
1747
1750
  }
@@ -1741,5 +1741,8 @@
1741
1741
  },
1742
1742
  "account_form_ad_privacy_settings": {
1743
1743
  "other": "Postavke privatnosti oglasa"
1744
+ },
1745
+ "gift_purchase_button_label": {
1746
+ "other": "Kupiti kao poklon"
1744
1747
  }
1745
1748
  }
@@ -1739,5 +1739,8 @@
1739
1739
  },
1740
1740
  "account_form_ad_privacy_settings": {
1741
1741
  "other": "Hirdetések adatvédelmi beállításai"
1742
+ },
1743
+ "gift_purchase_button_label": {
1744
+ "other": "Vásároljon ajándékba"
1742
1745
  }
1743
1746
  }
@@ -1743,5 +1743,8 @@
1743
1743
  },
1744
1744
  "account_form_ad_privacy_settings": {
1745
1745
  "other": "Impostazioni sulla privacy degli annunci"
1746
+ },
1747
+ "gift_purchase_button_label": {
1748
+ "other": "Acquista come regalo"
1746
1749
  }
1747
1750
  }
@@ -1726,5 +1726,8 @@
1726
1726
  },
1727
1727
  "account_form_ad_privacy_settings": {
1728
1728
  "other": "広告のプライバシー設定"
1729
+ },
1730
+ "gift_purchase_button_label": {
1731
+ "other": "ギフトとして購入"
1729
1732
  }
1730
1733
  }
@@ -1771,5 +1771,8 @@
1771
1771
  },
1772
1772
  "account_form_ad_privacy_settings": {
1773
1773
  "other": "Skelbimų privatumo nustatymai"
1774
+ },
1775
+ "gift_purchase_button_label": {
1776
+ "other": "Pirkti kaip dovaną"
1774
1777
  }
1775
1778
  }
@@ -1739,5 +1739,8 @@
1739
1739
  },
1740
1740
  "account_form_ad_privacy_settings": {
1741
1741
  "other": "Privacy-instellingen voor advertenties"
1742
+ },
1743
+ "gift_purchase_button_label": {
1744
+ "other": "Aankoop als geschenk"
1742
1745
  }
1743
1746
  }
@@ -1739,5 +1739,8 @@
1739
1739
  },
1740
1740
  "account_form_ad_privacy_settings": {
1741
1741
  "other": "Personverninnstillinger for annonser"
1742
+ },
1743
+ "gift_purchase_button_label": {
1744
+ "other": "Kjøp som gave"
1742
1745
  }
1743
1746
  }
@@ -1816,5 +1816,8 @@
1816
1816
  },
1817
1817
  "account_form_ad_privacy_settings": {
1818
1818
  "other": "Ustawienia prywatności reklam"
1819
+ },
1820
+ "gift_purchase_button_label": {
1821
+ "other": "Kup na prezent"
1819
1822
  }
1820
- }
1823
+ }
@@ -1743,5 +1743,8 @@
1743
1743
  },
1744
1744
  "account_form_ad_privacy_settings": {
1745
1745
  "other": "Configurações de privacidade de anúncios"
1746
+ },
1747
+ "gift_purchase_button_label": {
1748
+ "other": "Comprar como presente"
1746
1749
  }
1747
1750
  }
@@ -1743,5 +1743,8 @@
1743
1743
  },
1744
1744
  "account_form_ad_privacy_settings": {
1745
1745
  "other": "Configurações de privacidade de anúncios"
1746
+ },
1747
+ "gift_purchase_button_label": {
1748
+ "other": "Comprar como presente"
1746
1749
  }
1747
1750
  }
@@ -1793,5 +1793,8 @@
1793
1793
  },
1794
1794
  "account_form_ad_privacy_settings": {
1795
1795
  "other": "Настройки конфиденциальности рекламы"
1796
+ },
1797
+ "gift_purchase_button_label": {
1798
+ "other": "Покупка в подарок"
1796
1799
  }
1797
1800
  }
@@ -1755,5 +1755,8 @@
1755
1755
  },
1756
1756
  "account_form_ad_privacy_settings": {
1757
1757
  "other": "Подешавања приватности огласа"
1758
+ },
1759
+ "gift_purchase_button_label": {
1760
+ "other": "Купите као поклон"
1758
1761
  }
1759
1762
  }
@@ -0,0 +1,38 @@
1
+ import { AppComponent, bindAllComponents, render, h, attrs, Tooltip } from 's72.ui';
2
+ import CarouselVideoMutedIcon from './icons/carousel-video-muted-icon.js';
3
+ import CarouselVideoUnMutedIcon from './icons/carousel-video-unmuted-icon.js';
4
+
5
+ export default class CarouselVideoMuteButton extends AppComponent {
6
+ constructor(props, context) {
7
+ super(props, context);
8
+ this.state = { muted: true };
9
+ }
10
+
11
+ toggleBackgroundMute(e) {
12
+ e.preventDefault();
13
+
14
+ let video = document.querySelector('.s72-carousel-item.current video');
15
+
16
+ if (video.muted) {
17
+ video.muted = false;
18
+ this.setState({ muted: false });
19
+ } else {
20
+ video.muted = true;
21
+ this.setState({ muted: true });
22
+ }
23
+ }
24
+
25
+ render() {
26
+ return (
27
+ <Tooltip tooltip={this.state.muted ? 'Unmute' : 'Mute'} position="bottom">
28
+ <button id="muteBtn" class="s72-btn mute-btn" onClick={e => this.toggleBackgroundMute(e)}>
29
+ {this.state.muted ? <CarouselVideoMutedIcon /> : <CarouselVideoUnMutedIcon />}
30
+ </button>
31
+ </Tooltip>
32
+ );
33
+ }
34
+ }
35
+
36
+ bindAllComponents('carousel-video-mute-button', elements => {
37
+ return elements.map(e => render(h(CarouselVideoMuteButton, attrs(e)), e));
38
+ });
@@ -0,0 +1,7 @@
1
+ const CarouselVideoMutedIcon = () => (
2
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">
3
+ <path d="M301.1 34.8C312.6 40 320 51.4 320 64l0 384c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352 64 352c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l67.8 0L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3zM425 167l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0z" />
4
+ </svg>
5
+ );
6
+
7
+ export default CarouselVideoMutedIcon;
@@ -0,0 +1,7 @@
1
+ const CarouselVideoUnMutedIcon = () => (
2
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">
3
+ <path d="M533.6 32.5C598.5 85.2 640 165.8 640 256s-41.5 170.7-106.4 223.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C557.5 398.2 592 331.2 592 256s-34.5-142.2-88.7-186.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM473.1 107c43.2 35.2 70.9 88.9 70.9 149s-27.7 113.8-70.9 149c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C475.3 341.3 496 301.1 496 256s-20.7-85.3-53.2-111.8c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zm-60.5 74.5C434.1 199.1 448 225.9 448 256s-13.9 56.9-35.4 74.5c-10.3 8.4-25.4 6.8-33.8-3.5s-6.8-25.4 3.5-33.8C393.1 284.4 400 271 400 256s-6.9-28.4-17.7-37.3c-10.3-8.4-11.8-23.5-3.5-33.8s23.5-11.8 33.8-3.5zM301.1 34.8C312.6 40 320 51.4 320 64l0 384c0 12.6-7.4 24-18.9 29.2s-25 3.1-34.4-5.3L131.8 352 64 352c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l67.8 0L266.7 40.1c9.4-8.4 22.9-10.4 34.4-5.3z" />
4
+ </svg>
5
+ );
6
+
7
+ export default CarouselVideoUnMutedIcon;
@@ -1,6 +1,7 @@
1
1
  import './modernizr-custom.js';
2
2
  import './can-be-watched-button.component.js';
3
3
  import './external-purchase-button.component.js';
4
+ import './carousel-video-mute-button.component.js';
4
5
 
5
6
  /*global Swiper, Modernizr, s72*/
6
7
 
@@ -66,49 +67,49 @@ function initializeSwiper(element, force) {
66
67
 
67
68
  if (layout == 'portrait') {
68
69
  switch (itemsPerRow) {
69
- case '6':
70
- defaultSlidesPerView = 8;
71
- slidesPerView[1600] = 6;
72
- slidesPerView[1440] = 6;
73
- slidesPerView[1200] = 5;
74
- slidesPerView[992] = 4;
75
- slidesPerView[768] = 4;
76
- slidesPerView[667] = 3;
77
- slidesPerView[568] = 3;
78
- break;
79
-
80
- case '4':
81
- defaultSlidesPerView = 6;
82
- slidesPerView[1600] = 5;
83
- slidesPerView[1440] = 5;
84
- slidesPerView[1200] = 4;
85
- slidesPerView[992] = 3;
86
- slidesPerView[768] = 3;
87
- slidesPerView[667] = 3;
88
- slidesPerView[568] = 2;
89
- break;
70
+ case '6':
71
+ defaultSlidesPerView = 8;
72
+ slidesPerView[1600] = 6;
73
+ slidesPerView[1440] = 6;
74
+ slidesPerView[1200] = 5;
75
+ slidesPerView[992] = 4;
76
+ slidesPerView[768] = 4;
77
+ slidesPerView[667] = 3;
78
+ slidesPerView[568] = 3;
79
+ break;
80
+
81
+ case '4':
82
+ defaultSlidesPerView = 6;
83
+ slidesPerView[1600] = 5;
84
+ slidesPerView[1440] = 5;
85
+ slidesPerView[1200] = 4;
86
+ slidesPerView[992] = 3;
87
+ slidesPerView[768] = 3;
88
+ slidesPerView[667] = 3;
89
+ slidesPerView[568] = 2;
90
+ break;
90
91
  }
91
92
  } else if (layout == 'landscape') {
92
93
  switch (itemsPerRow) {
93
- case '4':
94
- defaultSlidesPerView = 5;
95
- slidesPerView[1600] = 4;
96
- slidesPerView[1440] = 4;
97
- slidesPerView[1200] = 3;
98
- slidesPerView[992] = 3;
99
- slidesPerView[768] = 3;
100
- slidesPerView[568] = 2;
101
- break;
102
-
103
- case '3':
104
- defaultSlidesPerView = 4;
105
- slidesPerView[1600] = 3;
106
- slidesPerView[1440] = 3;
107
- slidesPerView[1200] = 3;
108
- slidesPerView[992] = 2;
109
- slidesPerView[768] = 2;
110
- slidesPerView[568] = 2;
111
- break;
94
+ case '4':
95
+ defaultSlidesPerView = 5;
96
+ slidesPerView[1600] = 4;
97
+ slidesPerView[1440] = 4;
98
+ slidesPerView[1200] = 3;
99
+ slidesPerView[992] = 3;
100
+ slidesPerView[768] = 3;
101
+ slidesPerView[568] = 2;
102
+ break;
103
+
104
+ case '3':
105
+ defaultSlidesPerView = 4;
106
+ slidesPerView[1600] = 3;
107
+ slidesPerView[1440] = 3;
108
+ slidesPerView[1200] = 3;
109
+ slidesPerView[992] = 2;
110
+ slidesPerView[768] = 2;
111
+ slidesPerView[568] = 2;
112
+ break;
112
113
  }
113
114
  }
114
115
  }
@@ -462,6 +463,58 @@ function toggleScroll() {
462
463
  }
463
464
  }
464
465
 
466
+ function initCarouselVideo(app) {
467
+ // pause carousel trailer video when trailer is opened in modal
468
+ document.querySelectorAll('s72-modal-player button').forEach(b =>
469
+ b.addEventListener('click', () => {
470
+ let video = document.querySelector('.s72-carousel-item.current video');
471
+ if (video) {
472
+ video.pause();
473
+ }
474
+ })
475
+ );
476
+
477
+ // listen for s72-carousel events
478
+ document.querySelectorAll('s72-carousel').forEach(c => {
479
+ c.addEventListener('s72-carousel:slide-hidden', e => {
480
+ pauseVideoSlide(e.target);
481
+ });
482
+ c.addEventListener('s72-carousel:slide-shown', e => {
483
+ playVideoSlide(e.target);
484
+ });
485
+ });
486
+
487
+ // resume carousel trailer video when trailer modal is closed.
488
+ app.messagebus.subscribe('modal-closed', () => {
489
+ let v = document.querySelector('.s72-carousel-item.current video');
490
+ if (v) {
491
+ v.play();
492
+ }
493
+ });
494
+
495
+ // play first carousel video trailer on load if there
496
+ let s = document.querySelector('.s72-carousel-item.current video source');
497
+ if (s) {
498
+ s.setAttribute('src', s.parentNode.getAttribute('data-src'));
499
+ s.parentNode.load();
500
+ }
501
+ }
502
+
503
+ function playVideoSlide(slide) {
504
+ const video = slide.querySelector('video');
505
+ let s = video.querySelector('source');
506
+ if (s.getAttribute('src')) {
507
+ video.play();
508
+ } else {
509
+ s.setAttribute('src', video.getAttribute('data-src'));
510
+ video.load();
511
+ }
512
+ }
513
+ function pauseVideoSlide(slide) {
514
+ const video = slide.querySelector('video');
515
+ video.pause();
516
+ }
517
+
465
518
  function documentReady(app) {
466
519
  initializeCustomSliders();
467
520
 
@@ -473,7 +526,7 @@ function documentReady(app) {
473
526
  let swipers = document.getElementsByClassName('swiper-container');
474
527
  for (let i = 0; i < swipers.length; i++) {
475
528
  let el = swipers[i];
476
- if (el.getAttribute('is-wishlist') == undefined) {
529
+ if (el.getAttribute('is-dynamic-slider') == undefined) {
477
530
  let swiper = initializeSwiper(el, false);
478
531
  init(swiper);
479
532
 
@@ -496,6 +549,7 @@ function documentReady(app) {
496
549
  initSearch();
497
550
  }
498
551
  initScroll();
552
+ initCarouselVideo(app);
499
553
  }
500
554
 
501
555
  function detectTouchscreen() {
@@ -506,6 +560,7 @@ function detectTouchscreen() {
506
560
  function isTouchscreenEnabled() {
507
561
  return document.querySelector('html').getAttribute('is-touchscreen') === 'true';
508
562
  }
563
+
509
564
  document.addEventListener('s72loaded', event => {
510
565
  let app = event.detail.app;
511
566
  documentReady(app);
@@ -257,7 +257,8 @@ s72-userwishlist-button {
257
257
 
258
258
  .s72-btn-trailer,
259
259
  s72-share-modal .s72-btn,
260
- .s72-btn-wishlist {
260
+ .s72-btn-wishlist,
261
+ .s72-btn-gift {
261
262
  height: 42px;
262
263
  padding: 0;
263
264
  width: 42px;
@@ -99,6 +99,19 @@ s72-carousel {
99
99
  }
100
100
  }
101
101
  }
102
+
103
+ .carousel-item-video {
104
+ height: var(--carousel-height);
105
+ object-fit: cover;
106
+ width: 100vw;
107
+ @include media-breakpoint-up(sm) {
108
+ height: var(--carousel-height-sm);
109
+ }
110
+
111
+ @include media-breakpoint-up(lg) {
112
+ height: var(--carousel-height-lg);
113
+ }
114
+ }
102
115
  }
103
116
 
104
117
  .carousel-item-caption {
@@ -42,9 +42,6 @@
42
42
  @extend .meta-item;
43
43
  float: left;
44
44
  padding: 5px;
45
- &:first-child {
46
- margin-left: -5px;
47
- }
48
45
 
49
46
  h2 {
50
47
  @include subtitle-1-style;
@@ -264,7 +261,7 @@
264
261
  }
265
262
 
266
263
  .caption {
267
- padding: 4px 0;
264
+ padding: 0px 0 8px;
268
265
 
269
266
  .crumb {
270
267
  @extend .d-flex;
@@ -342,3 +339,11 @@
342
339
  .collection-items {
343
340
  margin: 0 auto;
344
341
  }
342
+
343
+ // To cancel out the 5px padding on items, add some negative margin to the containers
344
+ .swiper-wrapper,
345
+ .page-collection-items,
346
+ .s72-userlibrary-items,
347
+ .s72-userwishlist-items {
348
+ margin-left: -5px;
349
+ }
@@ -185,6 +185,22 @@
185
185
  grid-column: auto;
186
186
  grid-row: 1;
187
187
  }
188
+ carousel-video-mute-button {
189
+ margin-left: -6px;
190
+ }
191
+ .mute-btn {
192
+ background: transparent;
193
+ border: 0;
194
+ height: 42px;
195
+ padding: 0;
196
+ width: 42px;
197
+
198
+ svg {
199
+ fill: #fff;
200
+ height: 26px;
201
+ width: 26px;
202
+ }
203
+ }
188
204
  }
189
205
  }
190
206
  /* stylelint-enable selector-max-compound-selectors, max-nesting-depth */
@@ -1,3 +1,9 @@
1
+ .library-page s72-userlibrary {
2
+ // It looks a bit silly if the user library stretches too wide -- the gap
3
+ // between items gets big rather than adding more items!
4
+ max-width: 1920px;
5
+ }
6
+
1
7
  .s72-userlibrary-items {
2
8
  @extend .d-flex;
3
9
 
@@ -111,8 +111,8 @@
111
111
  --signin-sso-btn-background-hover-color: var(--button-background-hover);
112
112
 
113
113
  // Carousel
114
- --carousel-height: 82vh;
115
- --carousel-height-sm: 82vh;
114
+ --carousel-height: 52vh;
115
+ --carousel-height-sm: 68vh;
116
116
  --carousel-height-lg: 82vh;
117
117
  --carousel-bottom-gradient-height: 200px; // Increase this to 300px for light theme.
118
118
  --carousel-bottom-gradient-height-sm: 200px; // Increase this to 300px for light theme.
@@ -53,3 +53,7 @@
53
53
  margin: 0;
54
54
  padding: 0;
55
55
  }
56
+
57
+ .wishlist-page s72-userwishlist {
58
+ max-width: 1920px;
59
+ }
@@ -5,10 +5,10 @@
5
5
  {{import "./pixel.jet"}}
6
6
  {{import "./footer/footer.jet" }}
7
7
 
8
- {{useLocalDevRelish := false}}
8
+ {{useLocalDevRelish := false }}
9
9
  {{useLocalDevCheckout := false}}
10
10
 
11
- {{CDN := useLocalDevRelish ? "//localhost:3000" : "//cdn.shift72.com/1.4"}}
11
+ {{CDN := useLocalDevRelish ? "//localhost:3000" : "//cdn.shift72.com/" + config("s72_web_version", "1.4")}}
12
12
 
13
13
  {{CSSFileURL := site.SiteBrand.GetLink("css", "")}}
14
14
  {*{CSSFileURL := "/styles/local.css"}*}
@@ -1,4 +1,5 @@
1
- {{block carouselItemImage()}}
1
+ {{import "./video.jet"}}
2
+ {{block carouselItemImage(showTrailerBg, trailerURL)}}
2
3
  {{if isset(.Images["Carousel"])}}
3
4
  {* If carousel focus is set for film (film infos metadata) or tv season (tv seasons metadata) or custom fields for Pages / Bundles then it will set a class accordingly to position the carousel image *}
4
5
  {{focusClass = ""}}
@@ -11,6 +12,13 @@
11
12
  {{focusClass = "focus-center"}}
12
13
  {{end}}
13
14
  {{end}}
14
- <s72-image src="{{.Images.Carousel}}" alt="{{.Title}}" class="carousel-item-image {{focusClass}}"></s72-image>
15
+
16
+
17
+ {{if showTrailerBg}}
18
+ {{yield carouselItemVideo() item.InnerItem}}
19
+
20
+ {{else}}
21
+ <s72-image src="{{.Images.Carousel}}" alt="{{.Title}}" class="carousel-item-image {{focusClass}}"></s72-image>
22
+ {{end}}
15
23
  {{end}}
16
24
  {{end}}
@@ -0,0 +1,6 @@
1
+ {{block carouselItemVideo()}}
2
+ <video autoplay muted loop playsInline class="carousel-item-video" data-src="{{trailerURL}}" poster="{{.Images.Carousel}}">
3
+ <s72-image src="{{.Images.Carousel}}" alt="{{.Title}}" class="carousel-item-image {{focusClass}}"></s72-image>
4
+ <source src="" type="video/mp4">
5
+ </video>
6
+ {{end}}
@@ -6,13 +6,22 @@
6
6
  {{import "../../common/sponsor-image.jet"}}
7
7
  {{import "../../common/cta_buttons.jet"}}
8
8
 
9
+
10
+
9
11
  {{block carouselItem(item)}}
12
+
13
+ {{itemType := item.ItemType}}
14
+ {{isFilm := itemType == "film"}}
15
+ {{isSeason := itemType == "tvseason"}}
16
+ {{isBundle := itemType == "bundle"}}
17
+ {{trailerURL := isBundle ? item.InnerItem.PromoURL : (isFilm || isSeason) && len(item.InnerItem.Trailers) > 0 ? item.InnerItem.Trailers[0].URL : ""}}
18
+ {{showTrailerBg := trailerURL ? item.InnerItem.CustomFields.GetBool("use_trailer_as_background_video", false) : "" }}
10
19
  {{showItemContent := !isset(item["PageType"]) || item.PageType != "external"}}
11
20
 
12
21
  <div class="s72-carousel-item" data-slug="{{item.Slug}}">
13
22
  <a href="{{routeToSlug(item.Slug)}}" class="carousel-item-link" aria-label="{{item.Title}}">
14
23
 
15
- {{yield carouselItemImage() item}}
24
+ {{yield carouselItemImage(showTrailerBg=showTrailerBg, trailerURL=trailerURL) item}}
16
25
 
17
26
  {{if showItemContent}}
18
27
  <div class="carousel-item-caption">
@@ -39,9 +48,12 @@
39
48
  <s72-availability-label data-slug="{{item.Slug}}"></s72-availability-label>
40
49
 
41
50
  {{yield ctaButtons(itemType=item.ItemType, context="carousel") item.InnerItem}}
51
+
52
+
42
53
  </div>
43
54
  </div>
44
55
  {{end}}
56
+
45
57
  </a>
46
58
  </div>
47
59
  {{end}}
@@ -16,7 +16,7 @@
16
16
  class="user-continue-watching s72-slider s72-hide">
17
17
  <section class="page-collection" aria-label="{{i18n("wcag_aria_label_continue_watching")}}">
18
18
  <div class="collection-wrapper-container swiper-wrapper-container">
19
- <div class="collection-container swiper-container" data-items-per-row="{{itemsPerRow}}" data-layout="{{layout}}">
19
+ <div class="collection-container swiper-container" is-dynamic-slider disable-infinite-scroll data-items-per-row="{{itemsPerRow}}" data-layout="{{layout}}">
20
20
  {{if i18n("continue_watching_slider_header") != ""}}
21
21
  <div class="swiper-title">
22
22
  <h3>{{i18n("continue_watching_slider_header")}}</h3>
@@ -1,19 +1,10 @@
1
1
  {{import "./page_collection_item.jet"}}
2
2
  {{import "../common/slider.jet"}}
3
3
  {{import "./slider-buttons.jet"}}
4
- {{block wishlistCollection()}}
5
4
 
6
- {{if config("default_image_type") == "portrait"}}
7
- <s72-userwishlist
8
- render-as-slider="false"
9
- hide-if-empty="true"
10
- partials-base-path="/partials"
11
- partials-classes="swiper-slide"
12
- partials-insert-point-selector=".swiper-wrapper"
13
- force-login="false"
14
- data-items-per-page="6" data-item-layout="portrait" class="user-wishlist s72-slider s72-hide">
15
-
16
- {{else}}
5
+ {{block wishlistCollection()}}
6
+ {{layout := config("default_image_type")}}
7
+ {{itemsPerRow := layout == "portrait" ? 6 : 4}}
17
8
  <s72-userwishlist
18
9
  render-as-slider="false"
19
10
  hide-if-empty="true"
@@ -21,27 +12,23 @@
21
12
  partials-classes="swiper-slide"
22
13
  partials-insert-point-selector=".swiper-wrapper"
23
14
  force-login="false"
24
- data-items-per-page="4" data-item-layout="landscape" class="user-wishlist s72-slider s72-hide">
25
-
26
- {{end}}
27
- <section class="page-collection" aria-label="{{i18n("wcag_aria_label_wishlist")}}">
28
- <div class="collection-wrapper-container swiper-wrapper-container">
29
- {{if config("default_image_type") == "portrait"}}
30
- <div class="collection-container swiper-container" is-wishlist="true" data-items-per-row="6" data-layout="portrait">
31
- {{else}}
32
- <div class="collection-container swiper-container" is-wishlist="true" data-items-per-row="4" data-layout="landscape">
33
- {{end}}
34
- {{if i18n("userwishlist_slider_header") != ""}}
15
+ data-item-layout="{{layout}}"
16
+ data-items-per-page="{{itemsPerRow}}"
17
+ class="user-wishlist s72-slider s72-hide">
18
+ <section class="page-collection" aria-label="{{i18n("wcag_aria_label_wishlist")}}">
19
+ <div class="collection-wrapper-container swiper-wrapper-container">
20
+ <div class="collection-container swiper-container" is-dynamic-slider disable-infinite-scroll data-items-per-row="{{itemsPerRow}}" data-layout="{{layout}}">
21
+ {{if i18n("userwishlist_slider_header") != ""}}
35
22
  <div class="swiper-title">
36
- <h3>{{i18n("userwishlist_slider_header")}}</h3>
37
- </div>
38
- {{end}}
39
- <div class="swiper-wrapper">
40
- {{yield content}}
23
+ <h3>{{i18n("userwishlist_slider_header")}}</h3>
41
24
  </div>
25
+ {{end}}
26
+ <div class="swiper-wrapper">
27
+ {{yield content}}
28
+ </div>
42
29
  </div>
43
- {{ yield sliderButtons() }}
44
- </div>
45
- </section>
46
- </s72-userwishlist>
30
+ {{yield sliderButtons()}}
31
+ </div>
32
+ </section>
33
+ </s72-userwishlist>
47
34
  {{end}}
@@ -11,24 +11,29 @@
11
11
  {{trailerURL := isBundle ? .PromoURL : (isFilm || isSeason) && len(.Trailers) > 0 ? .Trailers[0].URL : ""}}
12
12
 
13
13
  {{showPricingButtons := isFilm || isSeason || isBundle}}
14
+
14
15
  {{showPlayButton := isFilm || isSeason || isEpisode}}
15
16
  {{showTrailerButton := trailerURL != ""}}
16
17
  {{showWishlistButton := isFilm || isSeason || isEpisode}}
17
18
  {{showShareButton := isFilm || isSeason || isEpisode || isBundle}}
18
19
  {{autoplay := !isCarousel}}
19
20
 
21
+
22
+ {{supportsGiftPurchase := isEnabled("use_checkout") && config("gift_purchase_enabled", "false") == "true" }}
23
+ {{showGiftButton := supportsGiftPurchase && !isCarousel}}
24
+
20
25
  {* These are limited to films for now, but really it should work for anything that has custom fields *}
21
26
  {{canBeWatchedButtonLink := isFilm ? .CustomFields.GetString("can_be_watched_button_link", "") : ""}}
22
27
  {{canBeWatchedButtonText := isFilm ? .CustomFields.GetString("can_be_watched_button_text", "can_be_watched_button_text") : ""}}
23
28
  {{showCanBeWatchedButton := len(canBeWatchedButtonLink) > 0}}
24
-
29
+
25
30
  {{externalPurchaseButtonLink := isFilm ? .CustomFields.GetString("external_purchase_button_link", "") : ""}}
26
31
  {{externalPurchaseButtonText := isFilm ? .CustomFields.GetString("external_purchase_button_text", "external_purchase_button_text") :"" }}
27
32
  {{showExternalPurchaseButton := len(externalPurchaseButtonLink) > 0}}
28
33
 
29
34
  {{showCtaButtons := showPricingButtons || showPlayButton || showCanBeWatchedButton || showTrailerButton || showWishlistButton || showShareButton || showExternalPurchaseButton}}
30
35
  {{showExtraButtons := showTrailerButton || showWishlistButton || showShareButton}}
31
-
36
+ {{showTrailerBg := trailerURL ? .CustomFields.GetBool("use_trailer_as_background_video", false) : "" }}
32
37
 
33
38
  {{if showCtaButtons}}
34
39
  <div class="cta-buttons">
@@ -54,11 +59,19 @@
54
59
  {{if showExtraButtons}}
55
60
  <div class="extra-buttons">
56
61
 
62
+ {{if showGiftButton}}
63
+ <s72-gift-button data-slug="{{slug}}"></s72-gift-button>
64
+ {{end}}
65
+
57
66
  {{if showTrailerButton}}
58
67
  {{dataLabel := i18n("play_trailer")}}
59
68
  <s72-modal-player src="{{trailerURL}}" class="s72-btn-trailer" data-slug="{{slug}}" data-label="{{dataLabel}}" {{if autoplay}}autoplay="querystring"{{end}} layout="tooltip"></s72-modal-player>
60
69
  {{end}}
61
70
 
71
+ {{if isCarousel && showTrailerBg}}
72
+ <carousel-video-mute-button></carousel-video-mute-button>
73
+ {{end}}
74
+
62
75
  {{if showWishlistButton}}
63
76
  <s72-userwishlist-button data-slug="{{slug}}" class="btn-wishlist" layout="tooltip"></s72-userwishlist-button>
64
77
  {{end}}
@@ -1739,5 +1739,8 @@
1739
1739
  },
1740
1740
  "account_form_ad_privacy_settings": {
1741
1741
  "other": "Reklam gizlilik ayarları"
1742
+ },
1743
+ "gift_purchase_button_label": {
1744
+ "other": "Hediye olarak satın al"
1742
1745
  }
1743
1746
  }
@@ -1799,5 +1799,8 @@
1799
1799
  },
1800
1800
  "account_form_ad_privacy_settings": {
1801
1801
  "other": "Налаштування конфіденційності реклами"
1802
+ },
1803
+ "gift_purchase_button_label": {
1804
+ "other": "Купівля в подарунок"
1802
1805
  }
1803
1806
  }
@@ -1726,5 +1726,8 @@
1726
1726
  },
1727
1727
  "account_form_ad_privacy_settings": {
1728
1728
  "other": "廣告隱私設定"
1729
+ },
1730
+ "gift_purchase_button_label": {
1731
+ "other": "作為禮物購買"
1729
1732
  }
1730
1733
  }