@iris.interactive/handcook 7.1.2-beta → 7.1.4-beta
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/mix-manifest.json +6 -0
- package/package.json +2 -2
- package/public/scripts/components/share/share.component.js +51 -0
- package/public/scripts/components/slider/slider.component.js +42 -12
- package/public/scripts/enumerators/share.enum.js +6 -0
- package/public/scripts/support/cookie.support.js +22 -0
- package/public/scripts/support/hash.support.js +11 -0
- package/public/scripts/support/toggle-html.support.js +5 -0
- package/public/scripts/support/wrap-select.support.js +3 -0
- package/public/styles/scss/_utils.scss +6 -0
- package/public/styles/scss/mixins/_mixin-layout.scss +7 -7
- package/public/styles/style.css +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Welcome to HandCook 👨🍳
|
|
2
|
-

|
|
3
3
|

|
|
4
4
|
[](#)
|
|
5
5
|
[](https://twitter.com/captain\_iris)
|
package/mix-manifest.json
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"/public/scripts/components/scroll-reveal/scroll-reveal.component.js": "/public/scripts/components/scroll-reveal/scroll-reveal.component.js",
|
|
31
31
|
"/public/scripts/components/scroll-reveal/scroll-reveal.component.scss": "/public/scripts/components/scroll-reveal/scroll-reveal.component.scss",
|
|
32
32
|
"/public/scripts/components/scrollspy/scrollspy.component.js": "/public/scripts/components/scrollspy/scrollspy.component.js",
|
|
33
|
+
"/public/scripts/components/share/share.component.js": "/public/scripts/components/share/share.component.js",
|
|
33
34
|
"/public/scripts/components/slider/slider.component.js": "/public/scripts/components/slider/slider.component.js",
|
|
34
35
|
"/public/scripts/components/smooth-scroll/smooth-scroll.component.js": "/public/scripts/components/smooth-scroll/smooth-scroll.component.js",
|
|
35
36
|
"/public/scripts/components/tab/tab.component.js": "/public/scripts/components/tab/tab.component.js",
|
|
@@ -37,10 +38,15 @@
|
|
|
37
38
|
"/public/scripts/components/toggle/toggle.component.js": "/public/scripts/components/toggle/toggle.component.js",
|
|
38
39
|
"/public/scripts/components/tooltip/tooltip.component.js": "/public/scripts/components/tooltip/tooltip.component.js",
|
|
39
40
|
"/public/scripts/enumerators/element.enum.js": "/public/scripts/enumerators/element.enum.js",
|
|
41
|
+
"/public/scripts/enumerators/share.enum.js": "/public/scripts/enumerators/share.enum.js",
|
|
40
42
|
"/public/scripts/enumerators/smooth-scroll.enum.js": "/public/scripts/enumerators/smooth-scroll.enum.js",
|
|
41
43
|
"/public/scripts/enumerators/tooltip.enum.js": "/public/scripts/enumerators/tooltip.enum.js",
|
|
42
44
|
"/public/scripts/handcook.js": "/public/scripts/handcook.js",
|
|
43
45
|
"/public/scripts/index.js.LICENSE.txt": "/public/scripts/index.js.LICENSE.txt",
|
|
46
|
+
"/public/scripts/support/cookie.support.js": "/public/scripts/support/cookie.support.js",
|
|
47
|
+
"/public/scripts/support/hash.support.js": "/public/scripts/support/hash.support.js",
|
|
48
|
+
"/public/scripts/support/toggle-html.support.js": "/public/scripts/support/toggle-html.support.js",
|
|
49
|
+
"/public/scripts/support/wrap-select.support.js": "/public/scripts/support/wrap-select.support.js",
|
|
44
50
|
"/public/styles/scss/_utils.scss": "/public/styles/scss/_utils.scss",
|
|
45
51
|
"/public/styles/scss/_variables.scss": "/public/styles/scss/_variables.scss",
|
|
46
52
|
"/public/styles/scss/handcook.scss": "/public/styles/scss/handcook.scss",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iris.interactive/handcook",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.4-beta",
|
|
4
4
|
"description": "The web cooking by IRIS Interactive",
|
|
5
5
|
"main": "./public/scripts/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"sass-loader": "11.1.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@nats-io/nats-core": "^3.0.0-27",
|
|
36
35
|
"@fancyapps/ui": "^4.0.22",
|
|
36
|
+
"@nats-io/nats-core": "^3.0.0-27",
|
|
37
37
|
"bootstrap": "^5.1.3",
|
|
38
38
|
"swiper": "8.0.6",
|
|
39
39
|
"tippy.js": "^6.3.7",
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import ShareEnum from "../../enumerators/share.enum";
|
|
2
|
+
|
|
3
|
+
export default class ShareComponent {
|
|
4
|
+
|
|
5
|
+
constructor() {
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
static manageDisplayOfShareButtons() {
|
|
9
|
+
|
|
10
|
+
if (navigator.share && window.matchMedia('(max-width: 1024px)').matches) {
|
|
11
|
+
$(ShareEnum.shareMobile).removeClass('hidden');
|
|
12
|
+
$(ShareEnum.shareDesktop).addClass('hidden');
|
|
13
|
+
} else {
|
|
14
|
+
$(ShareEnum.shareMobile).addClass('hidden');
|
|
15
|
+
$(ShareEnum.shareDesktop).removeClass('hidden');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static sharePage() {
|
|
20
|
+
let shareButton = $('[data-share="mobile"]');
|
|
21
|
+
|
|
22
|
+
shareButton.on('click', event => {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
|
|
25
|
+
if (navigator.share) {
|
|
26
|
+
navigator.share({
|
|
27
|
+
title: document.title,
|
|
28
|
+
url: window.location.href
|
|
29
|
+
})
|
|
30
|
+
} else {
|
|
31
|
+
// fallback
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static shareOnWhatsappWeb() {
|
|
37
|
+
|
|
38
|
+
$(ShareEnum.shareWhatsappService).on('click', function (e) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
window.open('https://web.whatsapp.com/send?text='+$(location).attr('href'), '_blank');
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static shareOnMessengerWeb() {
|
|
45
|
+
|
|
46
|
+
$(ShareEnum.shareMessengerService).on('click', function (e) {
|
|
47
|
+
e.preventDefault();
|
|
48
|
+
window.open('http://www.facebook.com/dialog/send?app_id=702473707947207&link='+$(location).attr('href')+'&redirect_uri='+$(location).attr('href'), '_blank');
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -193,21 +193,31 @@ export class HcSlider {
|
|
|
193
193
|
buildDom() {
|
|
194
194
|
// Si le DOM n'est pas créé correctement, on le fait
|
|
195
195
|
if (this.slider.querySelectorAll('.swiper-wrapper').length === 0) {
|
|
196
|
-
// On
|
|
197
|
-
|
|
198
|
-
const items = [].slice.call(this.slider.children);
|
|
199
|
-
items.forEach(item => {
|
|
200
|
-
item.classList.add('swiper-slide');
|
|
201
|
-
item.setAttribute('aria-roledescription', 'slide');
|
|
202
|
-
});
|
|
196
|
+
// On récupère les enfants de slider
|
|
197
|
+
const items = Array.from(this.slider.children);
|
|
203
198
|
|
|
204
|
-
// On
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
199
|
+
// On crée l'élément <ul> qui va contenir les <li>
|
|
200
|
+
const wrapperElement = document.createElement("ul");
|
|
201
|
+
wrapperElement.classList.add("not-list-style", "swiper-wrapper");
|
|
202
|
+
|
|
203
|
+
// On transforme chaque enfant en <li>, en leur appliquant les classes et attributs, puis on les ajoute au <ul>
|
|
208
204
|
items.forEach(item => {
|
|
209
|
-
|
|
205
|
+
// Créer un nouvel élément <li>
|
|
206
|
+
const newItem = document.createElement("li");
|
|
207
|
+
|
|
208
|
+
// Copier les classes et attributs de l'ancien élément
|
|
209
|
+
newItem.classList.add(...item.classList, "swiper-slide");
|
|
210
|
+
newItem.setAttribute("aria-roledescription", "slide");
|
|
211
|
+
|
|
212
|
+
// Copier le contenu de l'ancien élément dans le nouveau
|
|
213
|
+
newItem.innerHTML = item.innerHTML;
|
|
214
|
+
|
|
215
|
+
// Ajouter le nouvel élément <li> au <ul>
|
|
216
|
+
wrapperElement.appendChild(newItem);
|
|
210
217
|
});
|
|
218
|
+
|
|
219
|
+
// On vide le slider et on insère le wrapper <ul> contenant les <li>
|
|
220
|
+
this.slider.innerHTML = "";
|
|
211
221
|
this.slider.appendChild(wrapperElement);
|
|
212
222
|
|
|
213
223
|
// On ajout les différentes div utile en fonction des options passées
|
|
@@ -294,6 +304,17 @@ export class HcSlider {
|
|
|
294
304
|
|
|
295
305
|
this.slider.dispatchEvent(this.initEvent);
|
|
296
306
|
},
|
|
307
|
+
afterInit: (swiper) => {
|
|
308
|
+
|
|
309
|
+
//Remove tabindex
|
|
310
|
+
if (this.slider.hasAttribute('data-hc-slider-disable-arrows-focus')) {
|
|
311
|
+
swiper.$el.find('.hc-slider-buttons > *').removeAttr('tabindex');
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if (this.slider.hasAttribute('data-hc-slider-disable-pagination-focus')) {
|
|
315
|
+
swiper.$el.find('.hc-slider-pagination > *').removeAttr('tabindex');
|
|
316
|
+
}
|
|
317
|
+
},
|
|
297
318
|
slideChangeTransitionEnd: (swiper) => {
|
|
298
319
|
|
|
299
320
|
// slide item
|
|
@@ -304,6 +325,15 @@ export class HcSlider {
|
|
|
304
325
|
swiper.$el.find('.swiper-slide-active').addClass('hc-slider-slide-active');
|
|
305
326
|
swiper.$el.find('.swiper-slide-next').addClass('hc-slider-slide-next');
|
|
306
327
|
swiper.$el.find('.swiper-slide-prev').addClass('hc-slider-slide-prev');
|
|
328
|
+
|
|
329
|
+
//Remove tabindex
|
|
330
|
+
if (this.slider.hasAttribute('data-hc-slider-disable-arrows-focus')) {
|
|
331
|
+
swiper.$el.find('.hc-slider-buttons > *').removeAttr('tabindex');
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (this.slider.hasAttribute('data-hc-slider-disable-pagination-focus')) {
|
|
335
|
+
swiper.$el.find('.hc-slider-pagination > *').removeAttr('tabindex');
|
|
336
|
+
}
|
|
307
337
|
}
|
|
308
338
|
},
|
|
309
339
|
breakpoints: {}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export default class ShareEnum {
|
|
2
|
+
static shareDesktop = '[data-share="desktop"]';
|
|
3
|
+
static shareMobile = '[data-share="mobile"]';
|
|
4
|
+
static shareWhatsappService = '[data-share-service="whatsapp"]';
|
|
5
|
+
static shareMessengerService = '[data-share-service="messenger"]';
|
|
6
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function getCookie(cname) {
|
|
2
|
+
let name = cname + "=";
|
|
3
|
+
let decodedCookie = decodeURIComponent(document.cookie);
|
|
4
|
+
let ca = decodedCookie.split(';');
|
|
5
|
+
for(let i = 0; i <ca.length; i++) {
|
|
6
|
+
let c = ca[i];
|
|
7
|
+
while (c.charAt(0) == ' ') {
|
|
8
|
+
c = c.substring(1);
|
|
9
|
+
}
|
|
10
|
+
if (c.indexOf(name) == 0) {
|
|
11
|
+
return c.substring(name.length, c.length);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return "";
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function setCookie(cname, cvalue, exdays) {
|
|
18
|
+
const d = new Date();
|
|
19
|
+
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
|
20
|
+
let expires = "expires="+ d.toUTCString();
|
|
21
|
+
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
String.prototype.hashCode = function() {
|
|
2
|
+
var hash = 0, i, chr;
|
|
3
|
+
if (this.length === 0) return hash;
|
|
4
|
+
for (i = 0; i < this.length; i++) {
|
|
5
|
+
chr = this.charCodeAt(i);
|
|
6
|
+
hash = ((hash << 5) - hash) + chr;
|
|
7
|
+
hash |= 0; // Convert to 32bit integer
|
|
8
|
+
}
|
|
9
|
+
return hash;
|
|
10
|
+
};
|
|
11
|
+
|
|
@@ -58,15 +58,15 @@
|
|
|
58
58
|
/* Hover
|
|
59
59
|
/* ============================================= */
|
|
60
60
|
@mixin hover {
|
|
61
|
-
|
|
61
|
+
@media (hover: hover) and (pointer: fine) {
|
|
62
62
|
&:hover {
|
|
63
63
|
@content;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
@mixin hover-focus
|
|
69
|
-
|
|
68
|
+
@mixin hover-focus {
|
|
69
|
+
@media (hover: hover) and (pointer: fine) {
|
|
70
70
|
&:hover,
|
|
71
71
|
&:focus {
|
|
72
72
|
@content;
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
@mixin hover-focus-active
|
|
78
|
-
|
|
77
|
+
@mixin hover-focus-active {
|
|
78
|
+
@media (hover: hover) and (pointer: fine) {
|
|
79
79
|
&:hover,
|
|
80
80
|
&:focus,
|
|
81
81
|
&:active {
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
@mixin hover-focus-visited
|
|
88
|
-
|
|
87
|
+
@mixin hover-focus-visited {
|
|
88
|
+
@media (hover: hover) and (pointer: fine) {
|
|
89
89
|
&:hover,
|
|
90
90
|
&:focus,
|
|
91
91
|
&:visited {
|
package/public/styles/style.css
CHANGED
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
* @author Lucas ROCHE
|
|
26
26
|
* @date 28/01/2022 07:41
|
|
27
27
|
* @copyright Copyright (c) 2002-2022 IRIS Interactive, Inc. (http://www.iris-interactive.fr)
|
|
28
|
-
*/.stretched-link:before{background-color:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.list-flex{display:flex;flex-wrap:wrap;margin-bottom:0}.list-flex>*{list-style-type:none;margin:0 5px 10px 0}.list-flex>:last-child{margin-right:0}@keyframes loader{to{transform:rotate(1turn)}}@keyframes fade{0%{opacity:0}to{opacity:1}}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.text-icon{align-items:center;display:inline-flex;gap:5px}.text-icon--start{align-items:flex-start}.hover-item img{transition:.2s ease;will-change:transform}.hover-item:hover img{transform:scale(1.02)}.is-open{color:#009e55}.soon-close{color:#ff890e}.is-close{color:#f33}.fi--color:before,.fi-color:after{color:var(--iris--icon--color)}.font-size-xsmall{font-size:var(--iris--global--font-size-xsmall--rem)}.font-size-small{font-size:var(--iris--global--font-size-small--rem)}.font-size-regular{font-size:var(--iris--global--font-size-regular--rem)}@media screen and (max-width:650px){.font-size-regular{font-size:var(--iris--global--font-size-regular--small--rem)}}.font-size-large{font-size:var(--iris--global--font-size-large--rem)}@media screen and (max-width:650px){.font-size-large{font-size:var(--iris--global--font-size-large--small--rem)}}.font-size-xlarge{font-size:var(--iris--global--font-size-extra-large--rem)}@media screen and (max-width:650px){.font-size-xlarge{font-size:var(--iris--global--font-size-extra-large--small--rem)}}.align-items--bottom,.align-items--end{align-items:flex-end}.align-items--start,.align-items--top{align-items:flex-start}.align-items--center{align-items:center}
|
|
28
|
+
*/.stretched-link:before{background-color:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.list-flex{display:flex;flex-wrap:wrap;margin-bottom:0}.list-flex>*{list-style-type:none;margin:0 5px 10px 0}.list-flex>:last-child{margin-right:0}@keyframes loader{to{transform:rotate(1turn)}}@keyframes fade{0%{opacity:0}to{opacity:1}}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.text-icon{align-items:center;display:inline-flex;gap:5px}.text-icon--start{align-items:flex-start}.hover-item img{transition:.2s ease;will-change:transform}.hover-item:hover img{transform:scale(1.02)}.is-open{color:#009e55}.soon-close{color:#ff890e}.is-close{color:#f33}.fi--color:before,.fi-color:after{color:var(--iris--icon--color)}.font-size-xsmall{font-size:var(--iris--global--font-size-xsmall--rem)}.font-size-small{font-size:var(--iris--global--font-size-small--rem)}.font-size-regular{font-size:var(--iris--global--font-size-regular--rem)}@media screen and (max-width:650px){.font-size-regular{font-size:var(--iris--global--font-size-regular--small--rem)}}.font-size-large{font-size:var(--iris--global--font-size-large--rem)}@media screen and (max-width:650px){.font-size-large{font-size:var(--iris--global--font-size-large--small--rem)}}.font-size-xlarge{font-size:var(--iris--global--font-size-extra-large--rem)}@media screen and (max-width:650px){.font-size-xlarge{font-size:var(--iris--global--font-size-extra-large--small--rem)}}.align-items--bottom,.align-items--end{align-items:flex-end}.align-items--start,.align-items--top{align-items:flex-start}.align-items--center{align-items:center}.not-focus-style:focus{outline:none!important}
|