@materializecss/materialize 1.2.1 → 2.0.0-alpha
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/Gruntfile.js +68 -313
- package/README.md +3 -3
- package/dist/css/materialize.css +1019 -1824
- package/dist/css/materialize.min.css +3 -9
- package/dist/js/materialize.js +8416 -12190
- package/dist/js/materialize.min.js +4 -3
- package/dist/js/materialize.min.js.map +1 -0
- package/package.json +13 -9
- package/sass/components/_badges.scss +12 -2
- package/sass/components/_buttons.scss +16 -11
- package/sass/components/_cards.scss +14 -9
- package/sass/components/_carousel.scss +5 -2
- package/sass/components/_chips.scss +3 -3
- package/sass/components/_collapsible.scss +22 -8
- package/sass/components/_collection.scss +14 -6
- package/sass/components/_datepicker.scss +30 -11
- package/sass/components/_dropdown.scss +6 -4
- package/sass/components/_global.scss +132 -111
- package/sass/components/_grid.scss +119 -98
- package/sass/components/_modal.scss +3 -3
- package/sass/components/_navbar.scss +31 -17
- package/sass/components/_normalize.scss +26 -124
- package/sass/components/_sidenav.scss +21 -20
- package/sass/components/_slider.scss +36 -7
- package/sass/components/_table_of_contents.scss +12 -12
- package/sass/components/_tabs.scss +47 -16
- package/sass/components/_tapTarget.scss +6 -6
- package/sass/components/_timepicker.scss +54 -46
- package/sass/components/_toast.scss +3 -3
- package/sass/components/_tooltip.scss +4 -5
- package/sass/components/_typography.scss +1 -1
- package/sass/components/_variables.scss +185 -120
- package/sass/components/forms/_checkboxes.scss +9 -9
- package/sass/components/forms/_file-input.scss +9 -7
- package/sass/components/forms/_input-fields.scss +173 -234
- package/sass/components/forms/_radio-buttons.scss +1 -1
- package/sass/components/forms/_range.scss +11 -11
- package/sass/components/forms/_select.scss +29 -19
- package/sass/components/forms/_switches.scss +22 -18
- package/sass/materialize.scss +1 -1
- package/src/autocomplete.ts +459 -0
- package/src/bounding.ts +6 -0
- package/{js/buttons.js → src/buttons.ts} +103 -162
- package/src/cards.ts +54 -0
- package/{js/carousel.js → src/carousel.ts} +137 -262
- package/src/characterCounter.ts +88 -0
- package/src/chips.ts +350 -0
- package/src/collapsible.ts +184 -0
- package/{js/component.js → src/component.ts} +6 -19
- package/{js/datepicker.js → src/datepicker.ts} +213 -299
- package/{js/dropdown.js → src/dropdown.ts} +140 -254
- package/src/edges.ts +6 -0
- package/src/forms.ts +120 -0
- package/src/global.ts +385 -0
- package/src/materialbox.ts +348 -0
- package/src/modal.ts +256 -0
- package/{js/parallax.js → src/parallax.ts} +47 -60
- package/{js/pushpin.js → src/pushpin.ts} +19 -47
- package/{js/range.js → src/range.ts} +58 -139
- package/{js/scrollspy.js → src/scrollspy.ts} +81 -153
- package/src/select.ts +448 -0
- package/{js/sidenav.js → src/sidenav.ts} +96 -202
- package/src/slider.ts +415 -0
- package/src/tabs.ts +290 -0
- package/src/tapTarget.ts +240 -0
- package/{js/timepicker.js → src/timepicker.ts} +268 -272
- package/{js/toasts.js → src/toasts.ts} +75 -134
- package/{js/tooltip.js → src/tooltip.ts} +59 -96
- package/src/waves.ts +70 -0
- package/extras/noUiSlider/nouislider.css +0 -404
- package/extras/noUiSlider/nouislider.js +0 -2147
- package/extras/noUiSlider/nouislider.min.js +0 -1
- package/js/anime.min.js +0 -34
- package/js/autocomplete.js +0 -479
- package/js/cards.js +0 -40
- package/js/cash.js +0 -960
- package/js/characterCounter.js +0 -136
- package/js/chips.js +0 -486
- package/js/collapsible.js +0 -275
- package/js/forms.js +0 -285
- package/js/global.js +0 -428
- package/js/materialbox.js +0 -453
- package/js/modal.js +0 -382
- package/js/select.js +0 -391
- package/js/slider.js +0 -359
- package/js/tabs.js +0 -402
- package/js/tapTarget.js +0 -315
- package/js/waves.js +0 -615
- package/sass/_style.scss +0 -929
- package/sass/components/_waves.scss +0 -187
- package/sass/ghpages-materialize.scss +0 -7
package/src/bounding.ts
ADDED
|
@@ -1,57 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Component } from "./component";
|
|
2
|
+
import anim from "animejs";
|
|
3
3
|
|
|
4
4
|
let _defaults = {
|
|
5
5
|
direction: 'top',
|
|
6
6
|
hoverEnabled: true,
|
|
7
7
|
toolbarEnabled: false
|
|
8
8
|
};
|
|
9
|
+
|
|
10
|
+
export class FloatingActionButton extends Component {
|
|
11
|
+
el: HTMLElement;
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
private _anchor: HTMLAnchorElement;
|
|
14
|
+
private _menu: HTMLElement|null;
|
|
15
|
+
private _floatingBtns: HTMLElement[];
|
|
16
|
+
private _floatingBtnsReverse: HTMLElement[];
|
|
17
|
+
offsetY: number;
|
|
18
|
+
offsetX: number;
|
|
19
|
+
private _handleFABClickBound: any;
|
|
20
|
+
private _handleOpenBound: any;
|
|
21
|
+
private _handleCloseBound: any;
|
|
22
|
+
private _handleDocumentClickBound: (this: HTMLElement, ev: MouseEvent) => any;
|
|
23
|
+
btnBottom: number;
|
|
24
|
+
btnLeft: number;
|
|
25
|
+
btnWidth: number;
|
|
9
26
|
|
|
10
|
-
$.fn.reverse = [].reverse;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @class
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
class FloatingActionButton extends Component {
|
|
17
|
-
/**
|
|
18
|
-
* Construct FloatingActionButton instance
|
|
19
|
-
* @constructor
|
|
20
|
-
* @param {Element} el
|
|
21
|
-
* @param {Object} options
|
|
22
|
-
*/
|
|
23
27
|
constructor(el, options) {
|
|
24
28
|
super(FloatingActionButton, el, options);
|
|
25
29
|
|
|
26
|
-
this.el.M_FloatingActionButton = this;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Options for the fab
|
|
30
|
-
* @member FloatingActionButton#options
|
|
31
|
-
* @prop {Boolean} [direction] - Direction fab menu opens
|
|
32
|
-
* @prop {Boolean} [hoverEnabled=true] - Enable hover vs click
|
|
33
|
-
* @prop {Boolean} [toolbarEnabled=false] - Enable toolbar transition
|
|
34
|
-
*/
|
|
35
|
-
this.options = $.extend({}, FloatingActionButton.defaults, options);
|
|
30
|
+
(this.el as any).M_FloatingActionButton = this;
|
|
36
31
|
|
|
32
|
+
this.options = {...FloatingActionButton.defaults, ...options};
|
|
37
33
|
this.isOpen = false;
|
|
38
|
-
this
|
|
39
|
-
this
|
|
40
|
-
this
|
|
41
|
-
this
|
|
34
|
+
this._anchor = this.el.querySelector('a');
|
|
35
|
+
this._menu = this.el.querySelector('ul');
|
|
36
|
+
this._floatingBtns = Array.from(this.el.querySelectorAll('ul .btn-floating'));
|
|
37
|
+
this._floatingBtnsReverse = this._floatingBtns.reverse();
|
|
42
38
|
this.offsetY = 0;
|
|
43
39
|
this.offsetX = 0;
|
|
44
40
|
|
|
45
|
-
this
|
|
46
|
-
if (this.options.direction === 'top')
|
|
41
|
+
this.el.classList.add(`direction-${this.options.direction}`);
|
|
42
|
+
if (this.options.direction === 'top')
|
|
47
43
|
this.offsetY = 40;
|
|
48
|
-
|
|
44
|
+
else if (this.options.direction === 'right')
|
|
49
45
|
this.offsetX = -40;
|
|
50
|
-
|
|
46
|
+
else if (this.options.direction === 'bottom')
|
|
51
47
|
this.offsetY = -40;
|
|
52
|
-
|
|
48
|
+
else
|
|
53
49
|
this.offsetX = 40;
|
|
54
|
-
}
|
|
55
50
|
this._setupEventHandlers();
|
|
56
51
|
}
|
|
57
52
|
|
|
@@ -63,25 +58,16 @@
|
|
|
63
58
|
return super.init(this, els, options);
|
|
64
59
|
}
|
|
65
60
|
|
|
66
|
-
/**
|
|
67
|
-
* Get Instance
|
|
68
|
-
*/
|
|
69
61
|
static getInstance(el) {
|
|
70
62
|
let domElem = !!el.jquery ? el[0] : el;
|
|
71
63
|
return domElem.M_FloatingActionButton;
|
|
72
64
|
}
|
|
73
65
|
|
|
74
|
-
/**
|
|
75
|
-
* Teardown component
|
|
76
|
-
*/
|
|
77
66
|
destroy() {
|
|
78
67
|
this._removeEventHandlers();
|
|
79
|
-
this.el.M_FloatingActionButton = undefined;
|
|
68
|
+
(this.el as any).M_FloatingActionButton = undefined;
|
|
80
69
|
}
|
|
81
70
|
|
|
82
|
-
/**
|
|
83
|
-
* Setup Event Handlers
|
|
84
|
-
*/
|
|
85
71
|
_setupEventHandlers() {
|
|
86
72
|
this._handleFABClickBound = this._handleFABClick.bind(this);
|
|
87
73
|
this._handleOpenBound = this.open.bind(this);
|
|
@@ -95,9 +81,6 @@
|
|
|
95
81
|
}
|
|
96
82
|
}
|
|
97
83
|
|
|
98
|
-
/**
|
|
99
|
-
* Remove Event Handlers
|
|
100
|
-
*/
|
|
101
84
|
_removeEventHandlers() {
|
|
102
85
|
if (this.options.hoverEnabled && !this.options.toolbarEnabled) {
|
|
103
86
|
this.el.removeEventListener('mouseenter', this._handleOpenBound);
|
|
@@ -107,9 +90,6 @@
|
|
|
107
90
|
}
|
|
108
91
|
}
|
|
109
92
|
|
|
110
|
-
/**
|
|
111
|
-
* Handle FAB Click
|
|
112
|
-
*/
|
|
113
93
|
_handleFABClick() {
|
|
114
94
|
if (this.isOpen) {
|
|
115
95
|
this.close();
|
|
@@ -118,58 +98,41 @@
|
|
|
118
98
|
}
|
|
119
99
|
}
|
|
120
100
|
|
|
121
|
-
/**
|
|
122
|
-
* Handle Document Click
|
|
123
|
-
* @param {Event} e
|
|
124
|
-
*/
|
|
125
101
|
_handleDocumentClick(e) {
|
|
126
|
-
|
|
102
|
+
const elem = <HTMLElement>e.target;
|
|
103
|
+
if (elem !== this._menu) this.close;
|
|
104
|
+
/*
|
|
105
|
+
if (!elem.closest(this.$menu)) {
|
|
127
106
|
this.close();
|
|
128
|
-
}
|
|
107
|
+
}*/
|
|
129
108
|
}
|
|
130
109
|
|
|
131
|
-
/**
|
|
132
|
-
* Open FAB
|
|
133
|
-
*/
|
|
134
110
|
open() {
|
|
135
|
-
if (this.isOpen)
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (this.options.toolbarEnabled) {
|
|
111
|
+
if (this.isOpen) return;
|
|
112
|
+
if (this.options.toolbarEnabled)
|
|
140
113
|
this._animateInToolbar();
|
|
141
|
-
|
|
114
|
+
else
|
|
142
115
|
this._animateInFAB();
|
|
143
|
-
}
|
|
144
116
|
this.isOpen = true;
|
|
145
117
|
}
|
|
146
118
|
|
|
147
|
-
/**
|
|
148
|
-
* Close FAB
|
|
149
|
-
*/
|
|
150
119
|
close() {
|
|
151
|
-
if (!this.isOpen)
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
|
|
120
|
+
if (!this.isOpen) return;
|
|
155
121
|
if (this.options.toolbarEnabled) {
|
|
156
122
|
window.removeEventListener('scroll', this._handleCloseBound, true);
|
|
157
123
|
document.body.removeEventListener('click', this._handleDocumentClickBound, true);
|
|
158
124
|
this._animateOutToolbar();
|
|
159
|
-
}
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
160
127
|
this._animateOutFAB();
|
|
161
128
|
}
|
|
162
129
|
this.isOpen = false;
|
|
163
130
|
}
|
|
164
131
|
|
|
165
|
-
/**
|
|
166
|
-
* Classic FAB Menu open
|
|
167
|
-
*/
|
|
168
132
|
_animateInFAB() {
|
|
169
|
-
this
|
|
170
|
-
|
|
133
|
+
this.el.classList.add('active');
|
|
171
134
|
let time = 0;
|
|
172
|
-
this
|
|
135
|
+
this._floatingBtnsReverse.forEach((el) => {
|
|
173
136
|
anim({
|
|
174
137
|
targets: el,
|
|
175
138
|
opacity: 1,
|
|
@@ -184,11 +147,8 @@
|
|
|
184
147
|
});
|
|
185
148
|
}
|
|
186
149
|
|
|
187
|
-
/**
|
|
188
|
-
* Classic FAB Menu close
|
|
189
|
-
*/
|
|
190
150
|
_animateOutFAB() {
|
|
191
|
-
this
|
|
151
|
+
this._floatingBtnsReverse.forEach((el) => {
|
|
192
152
|
anim.remove(el);
|
|
193
153
|
anim({
|
|
194
154
|
targets: el,
|
|
@@ -199,23 +159,24 @@
|
|
|
199
159
|
duration: 175,
|
|
200
160
|
easing: 'easeOutQuad',
|
|
201
161
|
complete: () => {
|
|
202
|
-
this
|
|
162
|
+
this.el.classList.remove('active');
|
|
203
163
|
}
|
|
204
164
|
});
|
|
205
165
|
});
|
|
206
166
|
}
|
|
207
167
|
|
|
208
|
-
/**
|
|
209
|
-
* Toolbar transition Menu open
|
|
210
|
-
*/
|
|
211
168
|
_animateInToolbar() {
|
|
212
169
|
let scaleFactor;
|
|
213
170
|
let windowWidth = window.innerWidth;
|
|
214
171
|
let windowHeight = window.innerHeight;
|
|
215
172
|
let btnRect = this.el.getBoundingClientRect();
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
173
|
+
|
|
174
|
+
const backdrop = document.createElement('div');
|
|
175
|
+
backdrop.classList.add('fab-backdrop'); // $('<div class="fab-backdrop"></div>');
|
|
176
|
+
|
|
177
|
+
const fabColor = getComputedStyle(this._anchor).backgroundColor; // css('background-color');
|
|
178
|
+
|
|
179
|
+
this._anchor.append(backdrop);
|
|
219
180
|
|
|
220
181
|
this.offsetX = btnRect.left - windowWidth / 2 + btnRect.width / 2;
|
|
221
182
|
this.offsetY = windowHeight - btnRect.bottom;
|
|
@@ -225,50 +186,35 @@
|
|
|
225
186
|
this.btnWidth = btnRect.width;
|
|
226
187
|
|
|
227
188
|
// Set initial state
|
|
228
|
-
this
|
|
229
|
-
this
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
this
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
});
|
|
241
|
-
backdrop.css({
|
|
242
|
-
'background-color': fabColor
|
|
243
|
-
});
|
|
189
|
+
this.el.classList.add('active');
|
|
190
|
+
this.el.style.textAlign = 'center';
|
|
191
|
+
this.el.style.width = '100%';
|
|
192
|
+
this.el.style.bottom = '0';
|
|
193
|
+
this.el.style.left = '0';
|
|
194
|
+
this.el.style.transform = 'translateX(' + this.offsetX + 'px)';
|
|
195
|
+
this.el.style.transition = 'none';
|
|
196
|
+
|
|
197
|
+
this._anchor.style.transform = `translateY(${this.offsetY}px`;
|
|
198
|
+
this._anchor.style.transition = 'none';
|
|
199
|
+
|
|
200
|
+
(<HTMLElement>backdrop).style.backgroundColor = fabColor;
|
|
244
201
|
|
|
245
202
|
setTimeout(() => {
|
|
246
|
-
this
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
this
|
|
252
|
-
overflow: 'visible',
|
|
253
|
-
transform: '',
|
|
254
|
-
transition: 'transform .2s'
|
|
255
|
-
});
|
|
203
|
+
this.el.style.transform = '';
|
|
204
|
+
this.el.style.transition = 'transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s';
|
|
205
|
+
|
|
206
|
+
this._anchor.style.overflow = 'visible';
|
|
207
|
+
this._anchor.style.transform = '';
|
|
208
|
+
this._anchor.style.transition = 'transform .2s';
|
|
256
209
|
|
|
257
210
|
setTimeout(() => {
|
|
258
|
-
this
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
backdrop.
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
});
|
|
266
|
-
this.$menu
|
|
267
|
-
.children('li')
|
|
268
|
-
.children('a')
|
|
269
|
-
.css({
|
|
270
|
-
opacity: 1
|
|
271
|
-
});
|
|
211
|
+
this.el.style.overflow = 'hidden';
|
|
212
|
+
this.el.style.backgroundColor = fabColor;
|
|
213
|
+
|
|
214
|
+
backdrop.style.transform = 'scale(' + scaleFactor + ')';
|
|
215
|
+
backdrop.style.transition = 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)';
|
|
216
|
+
|
|
217
|
+
this._menu.querySelectorAll('li > a').forEach((a: HTMLAnchorElement) => a.style.opacity = '1');
|
|
272
218
|
|
|
273
219
|
// Scroll to close.
|
|
274
220
|
this._handleDocumentClickBound = this._handleDocumentClick.bind(this);
|
|
@@ -278,10 +224,12 @@
|
|
|
278
224
|
}, 0);
|
|
279
225
|
}
|
|
280
226
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
284
230
|
_animateOutToolbar() {
|
|
231
|
+
return;
|
|
232
|
+
/*
|
|
285
233
|
let windowWidth = window.innerWidth;
|
|
286
234
|
let windowHeight = window.innerHeight;
|
|
287
235
|
let backdrop = this.$el.find('.fab-backdrop');
|
|
@@ -296,19 +244,20 @@
|
|
|
296
244
|
'background-color': 'transparent',
|
|
297
245
|
transition: 'none'
|
|
298
246
|
});
|
|
299
|
-
this.$anchor.css({
|
|
300
|
-
|
|
301
|
-
});
|
|
247
|
+
// this.$anchor.css({
|
|
248
|
+
// transition: 'none'
|
|
249
|
+
// });
|
|
302
250
|
backdrop.css({
|
|
303
251
|
transform: 'scale(0)',
|
|
304
252
|
'background-color': fabColor
|
|
305
253
|
});
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
254
|
+
|
|
255
|
+
// this.$menu
|
|
256
|
+
// .children('li')
|
|
257
|
+
// .children('a')
|
|
258
|
+
// .css({
|
|
259
|
+
// opacity: ''
|
|
260
|
+
// });
|
|
312
261
|
|
|
313
262
|
setTimeout(() => {
|
|
314
263
|
backdrop.remove();
|
|
@@ -323,32 +272,24 @@
|
|
|
323
272
|
'background-color': '',
|
|
324
273
|
transform: 'translate3d(' + -this.offsetX + 'px,0,0)'
|
|
325
274
|
});
|
|
326
|
-
this.$anchor.css({
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
});
|
|
275
|
+
// this.$anchor.css({
|
|
276
|
+
// overflow: '',
|
|
277
|
+
// transform: 'translate3d(0,' + this.offsetY + 'px,0)'
|
|
278
|
+
// });
|
|
330
279
|
|
|
331
280
|
setTimeout(() => {
|
|
332
281
|
this.$el.css({
|
|
333
282
|
transform: 'translate3d(0,0,0)',
|
|
334
283
|
transition: 'transform .2s'
|
|
335
284
|
});
|
|
336
|
-
this.$anchor.css({
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
});
|
|
285
|
+
// this.$anchor.css({
|
|
286
|
+
// transform: 'translate3d(0,0,0)',
|
|
287
|
+
// transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
|
|
288
|
+
// });
|
|
340
289
|
}, 20);
|
|
341
290
|
}, 200);
|
|
291
|
+
*/
|
|
342
292
|
}
|
|
343
293
|
}
|
|
344
294
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
if (M.jQueryLoaded) {
|
|
348
|
-
M.initializeJqueryWrapper(
|
|
349
|
-
FloatingActionButton,
|
|
350
|
-
'floatingActionButton',
|
|
351
|
-
'M_FloatingActionButton'
|
|
352
|
-
);
|
|
353
|
-
}
|
|
354
|
-
})(cash, M.anime);
|
|
295
|
+
|
package/src/cards.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import anim from "animejs";
|
|
2
|
+
|
|
3
|
+
export class Cards {
|
|
4
|
+
|
|
5
|
+
static Init() {
|
|
6
|
+
|
|
7
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
8
|
+
document.body.addEventListener('click', e => {
|
|
9
|
+
const trigger = <HTMLElement>e.target;
|
|
10
|
+
|
|
11
|
+
const card: HTMLElement = trigger.closest('.card');
|
|
12
|
+
if (!card) return;
|
|
13
|
+
|
|
14
|
+
const cardReveal = <HTMLElement|null>Array.from(card.children).find(elem => elem.classList.contains('card-reveal'));
|
|
15
|
+
if (!cardReveal) return;
|
|
16
|
+
const initialOverflow = getComputedStyle(card).overflow;
|
|
17
|
+
|
|
18
|
+
// Close Card
|
|
19
|
+
const closeArea = cardReveal.querySelector('.card-reveal .card-title');
|
|
20
|
+
if (trigger === closeArea || closeArea.contains(trigger)) {
|
|
21
|
+
anim({
|
|
22
|
+
targets: cardReveal,
|
|
23
|
+
translateY: 0,
|
|
24
|
+
duration: 225,
|
|
25
|
+
easing: 'easeInOutQuad',
|
|
26
|
+
complete: (anim) => {
|
|
27
|
+
cardReveal.style.display = 'none';
|
|
28
|
+
card.style.overflow = initialOverflow;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// Reveal Card
|
|
34
|
+
const activators = card.querySelectorAll('.activator');
|
|
35
|
+
activators.forEach(activator => {
|
|
36
|
+
if (trigger === activator || activator.contains(trigger)) {
|
|
37
|
+
card.style.overflow = 'hidden';
|
|
38
|
+
cardReveal.style.display = 'block';
|
|
39
|
+
anim({
|
|
40
|
+
targets: cardReveal,
|
|
41
|
+
translateY: '-100%',
|
|
42
|
+
duration: 300,
|
|
43
|
+
easing: 'easeInOutQuad'
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|