aw-front-helpers 2.5.10 → 2.5.12
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/.prettierrc.json +15 -0
- package/Readme.md +11 -6
- package/bootstraper/Readme.md +22 -8
- package/bootstraper/index.js +2 -2
- package/bootstraper/maps.js +1 -1
- package/bootstraper/youtube.js +1 -1
- package/classes/Readme.md +33 -10
- package/classes/formControl.js +82 -43
- package/classes/globalParallax.js +55 -32
- package/classes/index.js +1 -1
- package/classes/nearby.js +49 -33
- package/classes/sticky.js +44 -25
- package/package.json +2 -2
- package/stylesheets/Readme.md +20 -5
- package/stylesheets/_functions.scss +3 -3
- package/stylesheets/_medias.scss +62 -22
- package/stylesheets/_mixins.scss +41 -49
- package/stylesheets/_reset.scss +114 -22
- package/stylesheets/_sticky.scss +1 -1
- package/stylesheets/_variables.scss +29 -29
- package/utils/Readme.md +8 -3
- package/utils/array/combine.js +2 -2
- package/utils/array/max.js +2 -2
- package/utils/array/merge-deep.js +2 -2
- package/utils/array/min.js +2 -2
- package/utils/array/slice.js +2 -2
- package/utils/array/without.js +2 -2
- package/utils/dom/each.js +4 -5
- package/utils/dom/getClosest.js +2 -2
- package/utils/dom/next.js +1 -1
- package/utils/dom/resize.js +2 -2
- package/utils/dom/retina.js +7 -8
- package/utils/dom/scroll.js +10 -6
- package/utils/func/isTouch.js +1 -1
- package/utils/func/once.js +6 -6
- package/utils/helpers.js +37 -20
- package/utils/image/detectVerticalSquash.js +3 -4
- package/utils/image/drawImage.js +1 -1
- package/utils/image/resize.js +6 -6
- package/utils/image/thumbnail.js +27 -8
- package/utils/math/clamp.js +2 -2
- package/utils/math/hypo.js +2 -2
- package/utils/media/autoplay.js +3 -2
- package/utils/regex/email.js +2 -1
package/classes/nearby.js
CHANGED
|
@@ -12,21 +12,26 @@
|
|
|
12
12
|
/**
|
|
13
13
|
* Distance between two points P1 (x1,y1) and P2 (x2,y2).
|
|
14
14
|
*/
|
|
15
|
-
const distancePoints = (x1, y1, x2, y2) =>
|
|
15
|
+
const distancePoints = (x1, y1, x2, y2) =>
|
|
16
|
+
Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
|
|
16
17
|
|
|
17
18
|
// from http://www.quirksmode.org/js/events_properties.html#position
|
|
18
19
|
const getMousePos = (e) => {
|
|
19
|
-
var posx = 0,
|
|
20
|
+
var posx = 0,
|
|
21
|
+
posy = 0;
|
|
20
22
|
if (!e) var e = window.event;
|
|
21
23
|
if (e.pageX || e.pageY) {
|
|
22
24
|
posx = e.pageX;
|
|
23
25
|
posy = e.pageY;
|
|
26
|
+
} else if (e.clientX || e.clientY) {
|
|
27
|
+
posx =
|
|
28
|
+
e.clientX +
|
|
29
|
+
document.body.scrollLeft +
|
|
30
|
+
document.documentElement.scrollLeft;
|
|
31
|
+
posy =
|
|
32
|
+
e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
|
|
24
33
|
}
|
|
25
|
-
|
|
26
|
-
posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
|
|
27
|
-
posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
|
|
28
|
-
}
|
|
29
|
-
return { x: posx, y: posy }
|
|
34
|
+
return { x: posx, y: posy };
|
|
30
35
|
};
|
|
31
36
|
|
|
32
37
|
export default class Nearby {
|
|
@@ -36,33 +41,44 @@ export default class Nearby {
|
|
|
36
41
|
this.init();
|
|
37
42
|
}
|
|
38
43
|
init() {
|
|
39
|
-
this.mousemoveFn = (ev) =>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
this.mousemoveFn = (ev) =>
|
|
45
|
+
requestAnimationFrame(() => {
|
|
46
|
+
const mousepos = getMousePos(ev);
|
|
47
|
+
const docScrolls = {
|
|
48
|
+
left: document.body.scrollLeft + document.documentElement.scrollLeft,
|
|
49
|
+
top: document.body.scrollTop + document.documentElement.scrollTop,
|
|
50
|
+
};
|
|
51
|
+
const elRect = this.DOM.el.getBoundingClientRect();
|
|
52
|
+
const elCoords = {
|
|
53
|
+
x1: elRect.left + docScrolls.left,
|
|
54
|
+
x2: elRect.width + elRect.left + docScrolls.left,
|
|
55
|
+
y1: elRect.top + docScrolls.top,
|
|
56
|
+
y2: elRect.height + elRect.top + docScrolls.top,
|
|
57
|
+
};
|
|
58
|
+
const closestPoint = { x: mousepos.x, y: mousepos.y };
|
|
48
59
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
if (mousepos.x < elCoords.x1) {
|
|
61
|
+
closestPoint.x = elCoords.x1;
|
|
62
|
+
} else if (mousepos.x > elCoords.x2) {
|
|
63
|
+
closestPoint.x = elCoords.x2;
|
|
64
|
+
}
|
|
65
|
+
if (mousepos.y < elCoords.y1) {
|
|
66
|
+
closestPoint.y = elCoords.y1;
|
|
67
|
+
} else if (mousepos.y > elCoords.y2) {
|
|
68
|
+
closestPoint.y = elCoords.y2;
|
|
69
|
+
}
|
|
70
|
+
if (this.options.onProgress) {
|
|
71
|
+
this.options.onProgress(
|
|
72
|
+
distancePoints(
|
|
73
|
+
mousepos.x,
|
|
74
|
+
mousepos.y,
|
|
75
|
+
closestPoint.x,
|
|
76
|
+
closestPoint.y
|
|
77
|
+
)
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
65
81
|
|
|
66
82
|
window.addEventListener('mousemove', this.mousemoveFn);
|
|
67
83
|
}
|
|
68
|
-
}
|
|
84
|
+
}
|
package/classes/sticky.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import debounce from
|
|
1
|
+
import debounce from 'debounce';
|
|
2
2
|
import EventEmitter from 'events';
|
|
3
3
|
|
|
4
4
|
export default class Sticky extends EventEmitter {
|
|
@@ -10,7 +10,7 @@ export default class Sticky extends EventEmitter {
|
|
|
10
10
|
el: window.document,
|
|
11
11
|
breakpointDisabled: null,
|
|
12
12
|
topHeightAdjustement: 0,
|
|
13
|
-
...options
|
|
13
|
+
...options,
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
this._isDisabled = false;
|
|
@@ -45,9 +45,9 @@ export default class Sticky extends EventEmitter {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
destroy() {
|
|
48
|
-
window.removeEventListener(
|
|
49
|
-
window.removeEventListener(
|
|
50
|
-
this._dom.el.classList.remove(
|
|
48
|
+
window.removeEventListener('scroll', this._onScrollHandler);
|
|
49
|
+
window.removeEventListener('resize', this._onResize);
|
|
50
|
+
this._dom.el.classList.remove('is-sticky', 'is-sticky-end');
|
|
51
51
|
this._dom.el.style.top = null;
|
|
52
52
|
this._dom.el.style.width = null;
|
|
53
53
|
}
|
|
@@ -56,65 +56,80 @@ export default class Sticky extends EventEmitter {
|
|
|
56
56
|
// -
|
|
57
57
|
_onScrollHandler() {
|
|
58
58
|
if (this._isDisabled) return;
|
|
59
|
-
this._vars.scrollY = window.
|
|
60
|
-
requestAnimationFrame(this._onScroll)
|
|
59
|
+
this._vars.scrollY = window.scrollY;
|
|
60
|
+
requestAnimationFrame(this._onScroll);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
_onScroll() {
|
|
64
64
|
if (this._isDisabled) return;
|
|
65
|
-
const positionSticky =
|
|
65
|
+
const positionSticky =
|
|
66
|
+
this._cache.containerTop -
|
|
67
|
+
this._vars.scrollY -
|
|
68
|
+
this._options.topHeightAdjustement;
|
|
66
69
|
const stickyFilter = positionSticky < 0;
|
|
67
70
|
|
|
68
|
-
const stickyBottomWrapperPage =
|
|
69
|
-
|
|
71
|
+
const stickyBottomWrapperPage =
|
|
72
|
+
this._vars.scrollY + this._vars.height >
|
|
73
|
+
this._cache.wrapperTop + this._cache.wrapperHeight;
|
|
74
|
+
const stickyBottomElement =
|
|
75
|
+
this._vars.scrollY +
|
|
76
|
+
this._options.topHeightAdjustement +
|
|
77
|
+
this._cache.containerHeight >
|
|
78
|
+
this._cache.wrapperTop + this._cache.wrapperHeight;
|
|
70
79
|
const stickyEndFilter = stickyBottomWrapperPage && stickyBottomElement;
|
|
71
80
|
if (this._cache.wrapperHeight < this._cache.containerHeight) {
|
|
72
|
-
this._dom.el.classList.remove(
|
|
81
|
+
this._dom.el.classList.remove('is-sticky', 'is-sticky-end');
|
|
73
82
|
return;
|
|
74
83
|
}
|
|
75
84
|
|
|
76
85
|
if (stickyFilter && !this._isSticky) {
|
|
77
86
|
this._isSticky = true;
|
|
78
|
-
this._dom.el.classList.add(
|
|
87
|
+
this._dom.el.classList.add('is-sticky');
|
|
79
88
|
this._dom.el.style.top = `${this._options.topHeightAdjustement}px`;
|
|
80
89
|
this._dom.el.style.width = `${this._cache.containerWidth}px`;
|
|
81
90
|
} else if (!stickyFilter && this._isSticky) {
|
|
82
91
|
this._isSticky = false;
|
|
83
92
|
this._dom.el.style.top = null;
|
|
84
93
|
this._dom.el.style.width = null;
|
|
85
|
-
this._dom.el.classList.remove(
|
|
94
|
+
this._dom.el.classList.remove('is-sticky');
|
|
86
95
|
}
|
|
87
96
|
if (stickyEndFilter && !this._isEndSticky) {
|
|
88
97
|
this._isEndSticky = true;
|
|
89
98
|
this._dom.el.style.top = null;
|
|
90
99
|
this._dom.el.style.width = null;
|
|
91
|
-
this._dom.el.classList.add(
|
|
100
|
+
this._dom.el.classList.add('is-sticky-end');
|
|
92
101
|
} else if (!stickyEndFilter && this._isEndSticky) {
|
|
93
102
|
this._isEndSticky = false;
|
|
94
103
|
this._dom.el.style.top = `${this._options.topHeightAdjustement}px`;
|
|
95
104
|
this._dom.el.style.width = `${this._cache.containerWidth}px`;
|
|
96
|
-
this._dom.el.classList.remove(
|
|
105
|
+
this._dom.el.classList.remove('is-sticky-end');
|
|
97
106
|
}
|
|
98
107
|
}
|
|
99
108
|
|
|
100
109
|
_onResize() {
|
|
101
|
-
if (
|
|
110
|
+
if (
|
|
111
|
+
this._options.breakpointDisabled &&
|
|
112
|
+
window.innerWidth < this._options.breakpointDisabled
|
|
113
|
+
) {
|
|
102
114
|
this._setDisabled();
|
|
103
115
|
return;
|
|
104
116
|
}
|
|
105
117
|
this._isSticky = false;
|
|
106
118
|
this._isEndSticky = false;
|
|
107
|
-
this._dom.el.classList.remove(
|
|
119
|
+
this._dom.el.classList.remove('is-sticky', 'is-sticky-end');
|
|
108
120
|
this._dom.el.style.width = null;
|
|
109
121
|
setTimeout(() => {
|
|
110
122
|
const boudingWrapper = this._dom.wrapper.getBoundingClientRect();
|
|
111
123
|
const boudingContainer = this._dom.el.getBoundingClientRect();
|
|
112
124
|
this._vars = {
|
|
113
|
-
scrollY: window.
|
|
125
|
+
scrollY: window.scrollY || document.documentElement.scrollTop,
|
|
114
126
|
height: window.innerHeight || document.documentElement.clientHeight,
|
|
115
127
|
};
|
|
116
128
|
this._cache = {
|
|
117
|
-
windowHeight:
|
|
129
|
+
windowHeight:
|
|
130
|
+
window.innerHeight ||
|
|
131
|
+
document.documentElement.clientHeight ||
|
|
132
|
+
document.getElementsByTagName('body')[0],
|
|
118
133
|
containerTop: boudingContainer.top + this._vars.scrollY,
|
|
119
134
|
containerHeight: boudingContainer.height,
|
|
120
135
|
containerWidth: boudingContainer.width,
|
|
@@ -135,13 +150,15 @@ export default class Sticky extends EventEmitter {
|
|
|
135
150
|
//________________________________________________________ private
|
|
136
151
|
// -
|
|
137
152
|
_createBound() {
|
|
138
|
-
[
|
|
153
|
+
['_onScroll', '_onScrollHandler', '_onResize'].forEach(
|
|
154
|
+
(fn) => (this[fn] = this[fn].bind(this))
|
|
155
|
+
);
|
|
139
156
|
}
|
|
140
157
|
|
|
141
158
|
_setDisabled() {
|
|
142
159
|
if (this._isDisabled) return;
|
|
143
160
|
this._isDisabled = true;
|
|
144
|
-
this._dom.el.classList.remove(
|
|
161
|
+
this._dom.el.classList.remove('is-sticky', 'is-sticky-end');
|
|
145
162
|
this._dom.el.style.top = null;
|
|
146
163
|
this._dom.el.style.width = null;
|
|
147
164
|
this.emit('disable');
|
|
@@ -149,14 +166,16 @@ export default class Sticky extends EventEmitter {
|
|
|
149
166
|
|
|
150
167
|
_grabDom() {
|
|
151
168
|
this._dom = {};
|
|
152
|
-
this._dom.el = this._options.el.querySelector(
|
|
153
|
-
this._dom.wrapper = this._options.el.querySelector(
|
|
169
|
+
this._dom.el = this._options.el.querySelector('[data-sticker-element]');
|
|
170
|
+
this._dom.wrapper = this._options.el.querySelector(
|
|
171
|
+
'[data-sticker-wrapper]'
|
|
172
|
+
);
|
|
154
173
|
}
|
|
155
174
|
|
|
156
175
|
_addEvents() {
|
|
157
176
|
setTimeout(() => {
|
|
158
|
-
window.addEventListener(
|
|
159
|
-
window.addEventListener(
|
|
177
|
+
window.addEventListener('scroll', this._onScrollHandler);
|
|
178
|
+
window.addEventListener('resize', this._onResize);
|
|
160
179
|
});
|
|
161
180
|
}
|
|
162
181
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aw-front-helpers",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.12",
|
|
4
4
|
"description": "Assets helpers for projects",
|
|
5
5
|
"author": "Yoann Le Poupon",
|
|
6
6
|
"license": "ISC",
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"es6-symbol": "^3.1.3",
|
|
14
14
|
"exif-js": "^2.3.0",
|
|
15
|
-
"gsap": "^3.12.
|
|
15
|
+
"gsap": "^3.12.3"
|
|
16
16
|
}
|
|
17
17
|
}
|
package/stylesheets/Readme.md
CHANGED
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# AW Front Helpers - Stylesheets
|
|
4
|
+
|
|
5
|
+
[](https://gitlab.com/awstudio/aw-front-helpers)
|
|
6
|
+
|
|
7
|
+
</div>
|
|
2
8
|
|
|
3
|
-
# Stylesheets
|
|
4
9
|
## functions.scss
|
|
10
|
+
|
|
5
11
|
**Variables**
|
|
12
|
+
|
|
6
13
|
- px-base
|
|
7
14
|
|
|
8
15
|
**Functions**
|
|
16
|
+
|
|
9
17
|
- rem
|
|
10
18
|
- em
|
|
11
19
|
|
|
12
20
|
## medias.scss
|
|
21
|
+
|
|
13
22
|
**Variables**
|
|
23
|
+
|
|
14
24
|
- $breakpoint-phablet
|
|
15
25
|
- $breakpoint-tablet
|
|
16
26
|
- $breakpoint-desktop
|
|
17
27
|
- $breakpoint-desktop-header
|
|
18
28
|
- $breakpoint-desktop-xl
|
|
29
|
+
- $breakpoint-desktop-xxl
|
|
19
30
|
|
|
20
31
|
**Mixins**
|
|
32
|
+
|
|
21
33
|
- mobile
|
|
22
34
|
- phablet
|
|
23
35
|
- tablet
|
|
@@ -26,9 +38,12 @@
|
|
|
26
38
|
- desktop-header
|
|
27
39
|
- desktop
|
|
28
40
|
- desktop-xl
|
|
41
|
+
- desktop-xxl
|
|
29
42
|
|
|
30
43
|
## mixins.scss
|
|
44
|
+
|
|
31
45
|
**Variables:**
|
|
46
|
+
|
|
32
47
|
- $wrapper-max
|
|
33
48
|
- $wrapper-width-sm
|
|
34
49
|
- $wrapper-width-md
|
|
@@ -38,6 +53,7 @@
|
|
|
38
53
|
- $vertical-spacing-desktop
|
|
39
54
|
|
|
40
55
|
**Mixins**
|
|
56
|
+
|
|
41
57
|
- wrapper
|
|
42
58
|
- vertical-spacing
|
|
43
59
|
- vertical-spacing-top
|
|
@@ -48,11 +64,10 @@
|
|
|
48
64
|
- resetList
|
|
49
65
|
- resetBtn
|
|
50
66
|
- size
|
|
51
|
-
- centerBlock
|
|
52
67
|
- absolute
|
|
53
68
|
- fixed
|
|
54
69
|
- hidden
|
|
55
70
|
- visible
|
|
56
|
-
- unselectable
|
|
57
|
-
- clearfix
|
|
58
71
|
- imageCover
|
|
72
|
+
- loader
|
|
73
|
+
- hideAccess
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
$px-base: 16 !default;
|
|
5
5
|
|
|
6
6
|
@function rem($pxval) {
|
|
7
|
-
@return math.div($pxval, $px-base
|
|
7
|
+
@return math.div($pxval, $px-base) * 1rem;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
@function em($pxval) {
|
|
11
|
-
@return math.div($pxval, $px-base
|
|
12
|
-
}
|
|
11
|
+
@return math.div($pxval, $px-base) * 1em;
|
|
12
|
+
}
|
package/stylesheets/_medias.scss
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// VARIABLES
|
|
2
2
|
$breakpoint-phablet: 480px !default;
|
|
3
|
-
$breakpoint-tablet: 768px
|
|
4
|
-
$breakpoint-desktop: 1024px
|
|
3
|
+
$breakpoint-tablet: 768px !default;
|
|
4
|
+
$breakpoint-desktop: 1024px !default;
|
|
5
5
|
$breakpoint-desktop-xl: 1280px !default;
|
|
6
6
|
$breakpoint-desktop-xxl: 1440px !default;
|
|
7
7
|
$breakpoint-burger: 1100px !default;
|
|
@@ -13,25 +13,65 @@ $breakpoint-burger: 1100px !default;
|
|
|
13
13
|
$media-query: 'only screen and';
|
|
14
14
|
|
|
15
15
|
// Queries string
|
|
16
|
-
$mobile:
|
|
17
|
-
$phablet:
|
|
18
|
-
$tablet:
|
|
19
|
-
$tablet-max
|
|
20
|
-
$tablet-only:
|
|
21
|
-
$desktop:
|
|
22
|
-
$desktop-xl:
|
|
23
|
-
$desktop-xxl:
|
|
24
|
-
$burger-enable:
|
|
25
|
-
$burger-disable:
|
|
16
|
+
$mobile: '#{$media-query} (max-width: #{$breakpoint-tablet - 1})';
|
|
17
|
+
$phablet: '#{$media-query} (min-width: #{$breakpoint-phablet})';
|
|
18
|
+
$tablet: '#{$media-query} (min-width: #{$breakpoint-tablet})';
|
|
19
|
+
$tablet-max: '#{$media-query} (max-width: #{$breakpoint-desktop - 1})';
|
|
20
|
+
$tablet-only: '#{$media-query} (min-width: #{$breakpoint-tablet}) and (max-width: #{$breakpoint-desktop - 1})';
|
|
21
|
+
$desktop: '#{$media-query} (min-width: #{$breakpoint-desktop})';
|
|
22
|
+
$desktop-xl: '#{$media-query} (min-width: #{$breakpoint-desktop-xl})';
|
|
23
|
+
$desktop-xxl: '#{$media-query} (min-width: #{$breakpoint-desktop-xxl})';
|
|
24
|
+
$burger-enable: '#{$media-query} (max-width: #{$breakpoint-burger - 1})';
|
|
25
|
+
$burger-disable: '#{$media-query} (min-width: #{$breakpoint-burger})';
|
|
26
26
|
|
|
27
27
|
// Mixins media queries
|
|
28
|
-
@mixin mobile
|
|
29
|
-
@
|
|
30
|
-
@
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
@mixin
|
|
34
|
-
@
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
@mixin mobile {
|
|
29
|
+
@media #{$mobile} {
|
|
30
|
+
@content;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
@mixin phablet {
|
|
34
|
+
@media #{$phablet} {
|
|
35
|
+
@content;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
@mixin tablet {
|
|
39
|
+
@media #{$tablet} {
|
|
40
|
+
@content;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
@mixin tablet-max {
|
|
44
|
+
@media #{$tablet-max} {
|
|
45
|
+
@content;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
@mixin tablet-only {
|
|
49
|
+
@media #{$tablet-only} {
|
|
50
|
+
@content;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
@mixin desktop {
|
|
54
|
+
@media #{$desktop} {
|
|
55
|
+
@content;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
@mixin desktop-xl {
|
|
59
|
+
@media #{$desktop-xl} {
|
|
60
|
+
@content;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
@mixin desktop-xxl {
|
|
64
|
+
@media #{$desktop-xxl} {
|
|
65
|
+
@content;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
@mixin burger-enable {
|
|
69
|
+
@media #{$burger-enable} {
|
|
70
|
+
@content;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
@mixin burger-disable {
|
|
74
|
+
@media #{$burger-disable} {
|
|
75
|
+
@content;
|
|
76
|
+
}
|
|
77
|
+
}
|
package/stylesheets/_mixins.scss
CHANGED
|
@@ -11,7 +11,6 @@ $vertical-spacing-mobile: 50px !default;
|
|
|
11
11
|
$vertical-spacing-tablet: 60px !default;
|
|
12
12
|
$vertical-spacing-desktop: 80px !default;
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
// ------------------------------------------------------------
|
|
16
15
|
// MIXINS
|
|
17
16
|
// ------------------------------------------------------------
|
|
@@ -41,26 +40,26 @@ $vertical-spacing-desktop: 80px !default;
|
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
@mixin vertical-spacing-top($facteur: 1) {
|
|
44
|
-
margin-top: $vertical-spacing-mobile
|
|
43
|
+
margin-top: $vertical-spacing-mobile * $facteur;
|
|
45
44
|
|
|
46
45
|
@include tablet {
|
|
47
|
-
margin-top: $vertical-spacing-tablet
|
|
46
|
+
margin-top: $vertical-spacing-tablet * $facteur;
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
@include desktop {
|
|
51
|
-
margin-top: $vertical-spacing-desktop
|
|
50
|
+
margin-top: $vertical-spacing-desktop * $facteur;
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
@mixin vertical-spacing-bottom($facteur: 1) {
|
|
56
|
-
margin-bottom: $vertical-spacing-mobile
|
|
55
|
+
margin-bottom: $vertical-spacing-mobile * $facteur;
|
|
57
56
|
|
|
58
57
|
@include tablet {
|
|
59
|
-
margin-bottom: $vertical-spacing-tablet
|
|
58
|
+
margin-bottom: $vertical-spacing-tablet * $facteur;
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
@include desktop {
|
|
63
|
-
margin-bottom: $vertical-spacing-desktop
|
|
62
|
+
margin-bottom: $vertical-spacing-desktop * $facteur;
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
|
|
@@ -70,26 +69,26 @@ $vertical-spacing-desktop: 80px !default;
|
|
|
70
69
|
}
|
|
71
70
|
|
|
72
71
|
@mixin vertical-spacing-inner-top($facteur: 1) {
|
|
73
|
-
padding-top: $vertical-spacing-mobile
|
|
72
|
+
padding-top: $vertical-spacing-mobile * $facteur;
|
|
74
73
|
|
|
75
74
|
@include tablet {
|
|
76
|
-
padding-top: $vertical-spacing-tablet
|
|
75
|
+
padding-top: $vertical-spacing-tablet * $facteur;
|
|
77
76
|
}
|
|
78
77
|
|
|
79
78
|
@include desktop {
|
|
80
|
-
padding-top: $vertical-spacing-desktop
|
|
79
|
+
padding-top: $vertical-spacing-desktop * $facteur;
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
|
|
84
83
|
@mixin vertical-spacing-inner-bottom($facteur: 1) {
|
|
85
|
-
padding-bottom: $vertical-spacing-mobile
|
|
84
|
+
padding-bottom: $vertical-spacing-mobile * $facteur;
|
|
86
85
|
|
|
87
86
|
@include tablet {
|
|
88
|
-
padding-bottom: $vertical-spacing-tablet
|
|
87
|
+
padding-bottom: $vertical-spacing-tablet * $facteur;
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
@include desktop {
|
|
92
|
-
padding-bottom: $vertical-spacing-desktop
|
|
91
|
+
padding-bottom: $vertical-spacing-desktop * $facteur;
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
94
|
|
|
@@ -142,7 +141,7 @@ $vertical-spacing-desktop: 80px !default;
|
|
|
142
141
|
$width: nth($value, 1);
|
|
143
142
|
$height: $width;
|
|
144
143
|
|
|
145
|
-
@if length($value)>1 {
|
|
144
|
+
@if length($value) >1 {
|
|
146
145
|
$height: nth($value, 2);
|
|
147
146
|
}
|
|
148
147
|
|
|
@@ -150,12 +149,6 @@ $vertical-spacing-desktop: 80px !default;
|
|
|
150
149
|
height: $height;
|
|
151
150
|
}
|
|
152
151
|
|
|
153
|
-
@mixin centerBlock {
|
|
154
|
-
display: block;
|
|
155
|
-
margin-left: auto;
|
|
156
|
-
margin-right: auto;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
152
|
@mixin absolute {
|
|
160
153
|
position: absolute;
|
|
161
154
|
top: 0;
|
|
@@ -184,26 +177,21 @@ $vertical-spacing-desktop: 80px !default;
|
|
|
184
177
|
visibility: visible;
|
|
185
178
|
}
|
|
186
179
|
|
|
187
|
-
@mixin
|
|
188
|
-
|
|
189
|
-
|
|
180
|
+
@mixin imageCover {
|
|
181
|
+
@include absolute;
|
|
182
|
+
width: 100%;
|
|
183
|
+
height: 100%;
|
|
184
|
+
object-fit: cover;
|
|
190
185
|
}
|
|
191
186
|
|
|
192
187
|
@mixin clearfix {
|
|
193
188
|
&::after {
|
|
194
189
|
clear: both;
|
|
195
|
-
content:
|
|
190
|
+
content: '';
|
|
196
191
|
display: table;
|
|
197
192
|
}
|
|
198
193
|
}
|
|
199
194
|
|
|
200
|
-
@mixin imageCover {
|
|
201
|
-
@include absolute;
|
|
202
|
-
width: 100%;
|
|
203
|
-
height: 100%;
|
|
204
|
-
object-fit: cover;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
195
|
@mixin loader($color: $color-main, $scale: 1, $position: after) {
|
|
208
196
|
&::#{$position} {
|
|
209
197
|
content: '';
|
|
@@ -211,7 +199,7 @@ $vertical-spacing-desktop: 80px !default;
|
|
|
211
199
|
left: 50%;
|
|
212
200
|
top: 50%;
|
|
213
201
|
transform: translateX(-50%) translateY(-50%);
|
|
214
|
-
border: rem(3 * $scale) solid rgba($color, .1);
|
|
202
|
+
border: rem(3 * $scale) solid rgba($color, 0.1);
|
|
215
203
|
border-top: rem(3 * $scale) solid rgba($color, 1);
|
|
216
204
|
border-radius: 50%;
|
|
217
205
|
width: rem(30 * $scale);
|
|
@@ -221,6 +209,27 @@ $vertical-spacing-desktop: 80px !default;
|
|
|
221
209
|
}
|
|
222
210
|
}
|
|
223
211
|
|
|
212
|
+
@mixin hideAccess {
|
|
213
|
+
border: 0 !important;
|
|
214
|
+
clip: rect(1px, 1px, 1px, 1px) !important;
|
|
215
|
+
clip-path: inset(50%) !important;
|
|
216
|
+
height: 1px !important;
|
|
217
|
+
overflow: hidden !important;
|
|
218
|
+
padding: 0 !important;
|
|
219
|
+
position: absolute !important;
|
|
220
|
+
width: 1px !important;
|
|
221
|
+
white-space: nowrap !important;
|
|
222
|
+
&.sr-focusable:focus {
|
|
223
|
+
clip: auto !important;
|
|
224
|
+
clip-path: none !important;
|
|
225
|
+
height: auto !important;
|
|
226
|
+
margin: auto !important;
|
|
227
|
+
overflow: visible !important;
|
|
228
|
+
width: auto !important;
|
|
229
|
+
white-space: normal !important;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
224
233
|
@keyframes loaderAnimation {
|
|
225
234
|
0% {
|
|
226
235
|
transform: translateX(-50%) translateY(-50%) rotate(0deg);
|
|
@@ -229,20 +238,3 @@ $vertical-spacing-desktop: 80px !default;
|
|
|
229
238
|
transform: translateX(-50%) translateY(-50%) rotate(360deg);
|
|
230
239
|
}
|
|
231
240
|
}
|
|
232
|
-
|
|
233
|
-
@mixin hideAccess {
|
|
234
|
-
position: absolute !important;
|
|
235
|
-
clip: rect(1px, 1px, 1px, 1px);
|
|
236
|
-
overflow: hidden;
|
|
237
|
-
height: rem(1);
|
|
238
|
-
width: rem(1);
|
|
239
|
-
word-wrap: normal;
|
|
240
|
-
|
|
241
|
-
&.focusable:focus {
|
|
242
|
-
position: static !important;
|
|
243
|
-
clip: auto;
|
|
244
|
-
overflow: visible;
|
|
245
|
-
height: auto;
|
|
246
|
-
width: auto;
|
|
247
|
-
}
|
|
248
|
-
}
|