@iris.interactive/handcook 7.1.3-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/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/mixins/_mixin-layout.scss +7 -7
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
|
+
}
|
|
@@ -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 {
|