uikit 3.11.2-dev.72dbb9a19 → 3.11.2-dev.76734f785
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/CHANGELOG.md +39 -19
- package/dist/css/uikit-core-rtl.css +86 -170
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +86 -170
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +88 -176
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +88 -176
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +1 -1
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +1 -1
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +1 -1
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +1 -1
- package/dist/js/components/lightbox.min.js +1 -1
- package/dist/js/components/notification.js +1 -1
- package/dist/js/components/notification.min.js +1 -1
- package/dist/js/components/parallax.js +115 -78
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +115 -78
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +79 -33
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +115 -78
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +45 -3
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +1 -1
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +1 -1
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +1 -1
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +259 -234
- package/dist/js/uikit-core.min.js +1 -1
- package/dist/js/uikit-icons.js +1 -1
- package/dist/js/uikit-icons.min.js +1 -1
- package/dist/js/uikit.js +461 -347
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/components/internal/slider-preload.js +37 -0
- package/src/js/components/slider.js +43 -34
- package/src/js/components/slideshow.js +8 -1
- package/src/js/core/height-viewport.js +3 -0
- package/src/js/core/icon.js +13 -6
- package/src/js/core/img.js +131 -114
- package/src/js/core/sticky.js +51 -57
- package/src/js/core/svg.js +10 -6
- package/src/js/core/toggle.js +2 -1
- package/src/js/mixin/parallax.js +116 -79
- package/src/js/util/ajax.js +6 -2
- package/src/js/util/dimensions.js +4 -4
- package/src/js/util/dom.js +37 -31
- package/src/js/util/lang.js +6 -5
- package/src/js/util/player.js +3 -2
- package/src/js/util/style.js +4 -4
- package/src/less/components/base.less +10 -28
- package/src/less/components/form-range.less +48 -95
- package/src/less/components/form.less +0 -1
- package/src/less/components/height.less +3 -0
- package/src/less/components/lightbox.less +0 -1
- package/src/less/components/modal.less +3 -7
- package/src/less/components/progress.less +14 -36
- package/src/less/components/slider.less +0 -3
- package/src/less/components/slideshow.less +0 -3
- package/src/less/components/text.less +16 -32
- package/src/scss/components/base.scss +10 -28
- package/src/scss/components/form-range.scss +48 -95
- package/src/scss/components/form.scss +0 -1
- package/src/scss/components/height.scss +3 -0
- package/src/scss/components/lightbox.scss +0 -1
- package/src/scss/components/modal.scss +3 -7
- package/src/scss/components/progress.scss +14 -36
- package/src/scss/components/slider.scss +0 -3
- package/src/scss/components/slideshow.scss +0 -3
- package/src/scss/components/text.scss +16 -32
- package/src/scss/mixins-theme.scss +1 -1
- package/src/scss/mixins.scss +1 -1
- package/src/scss/variables-theme.scss +3 -3
- package/src/scss/variables.scss +3 -3
- package/tests/align.html +10 -10
- package/tests/animation.html +2 -2
- package/tests/article.html +2 -2
- package/tests/base.html +3 -3
- package/tests/card.html +10 -10
- package/tests/column.html +3 -3
- package/tests/comment.html +9 -9
- package/tests/dotnav.html +3 -3
- package/tests/image.html +296 -64
- package/tests/images/image-type.avif +0 -0
- package/tests/images/image-type.jpeg +0 -0
- package/tests/images/image-type.webp +0 -0
- package/tests/index.html +8 -8
- package/tests/lightbox.html +10 -10
- package/tests/marker.html +2 -2
- package/tests/modal.html +8 -9
- package/tests/navbar.html +2 -2
- package/tests/overlay.html +7 -7
- package/tests/parallax.html +16 -7
- package/tests/position.html +12 -12
- package/tests/slidenav.html +12 -12
- package/tests/slider.html +20 -20
- package/tests/sortable.html +1 -1
- package/tests/sticky-parallax.html +56 -71
- package/tests/svg.html +6 -6
- package/tests/table.html +11 -11
- package/tests/thumbnav.html +12 -12
- package/tests/transition.html +30 -30
- package/tests/utility.html +33 -33
- package/tests/video.html +1 -1
- package/tests/width.html +1 -1
- package/tests/images/animated.gif +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.76734f785 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */
|
|
2
2
|
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
|
|
@@ -116,50 +116,44 @@
|
|
|
116
116
|
},
|
|
117
117
|
|
|
118
118
|
getCss(percent) {
|
|
119
|
-
|
|
120
|
-
(
|
|
119
|
+
const css = { transform: '', filter: '' };
|
|
120
|
+
for (const prop in this.props) {
|
|
121
121
|
this.props[prop](css, percent);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
{ transform: '', filter: '' });
|
|
125
|
-
|
|
122
|
+
}
|
|
123
|
+
return css;
|
|
126
124
|
} } };
|
|
127
125
|
|
|
128
126
|
|
|
129
127
|
|
|
130
|
-
function transformFn(prop, el,
|
|
131
|
-
const unit = getUnit(
|
|
128
|
+
function transformFn(prop, el, stops) {
|
|
129
|
+
const unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
|
|
130
|
+
let transformFn;
|
|
132
131
|
|
|
133
132
|
if (prop === 'x' || prop === 'y') {
|
|
134
133
|
prop = "translate" + uikitUtil.ucfirst(prop);
|
|
134
|
+
transformFn = (stop) => uikitUtil.toFloat(uikitUtil.toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (steps.length === 1) {
|
|
140
|
-
steps.unshift(prop === 'scale' ? 1 : 0);
|
|
137
|
+
if (stops.length === 1) {
|
|
138
|
+
stops.unshift(prop === 'scale' ? 1 : 0);
|
|
141
139
|
}
|
|
142
140
|
|
|
143
|
-
|
|
144
|
-
let value = getValue(steps, percent);
|
|
141
|
+
stops = parseStops(stops, transformFn);
|
|
145
142
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
css.transform += " " + prop + "(" + value + unit + ")";
|
|
143
|
+
return (css, percent) => {
|
|
144
|
+
css.transform += " " + prop + "(" + getValue(stops, percent) + unit + ")";
|
|
151
145
|
};
|
|
152
146
|
}
|
|
153
147
|
|
|
154
|
-
function colorFn(prop, el,
|
|
155
|
-
if (
|
|
156
|
-
|
|
148
|
+
function colorFn(prop, el, stops) {
|
|
149
|
+
if (stops.length === 1) {
|
|
150
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
157
151
|
}
|
|
158
152
|
|
|
159
|
-
|
|
153
|
+
stops = parseStops(stops, (stop) => parseColor(el, stop));
|
|
160
154
|
|
|
161
155
|
return (css, percent) => {
|
|
162
|
-
const [start, end, p] =
|
|
156
|
+
const [start, end, p] = getStop(stops, percent);
|
|
163
157
|
const value = start.
|
|
164
158
|
map((value, i) => {
|
|
165
159
|
value += p * (end[i] - value);
|
|
@@ -179,85 +173,83 @@
|
|
|
179
173
|
map(uikitUtil.toFloat);
|
|
180
174
|
}
|
|
181
175
|
|
|
182
|
-
function filterFn(prop, el,
|
|
183
|
-
if (
|
|
184
|
-
|
|
176
|
+
function filterFn(prop, el, stops) {
|
|
177
|
+
if (stops.length === 1) {
|
|
178
|
+
stops.unshift(0);
|
|
185
179
|
}
|
|
186
180
|
|
|
187
|
-
const unit = getUnit(
|
|
181
|
+
const unit = getUnit(stops) || { blur: 'px', hue: 'deg' }[prop] || '%';
|
|
188
182
|
prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
|
|
189
|
-
|
|
183
|
+
stops = parseStops(stops);
|
|
190
184
|
|
|
191
185
|
return (css, percent) => {
|
|
192
|
-
const value = getValue(
|
|
186
|
+
const value = getValue(stops, percent);
|
|
193
187
|
css.filter += " " + prop + "(" + (value + unit) + ")";
|
|
194
188
|
};
|
|
195
189
|
}
|
|
196
190
|
|
|
197
|
-
function cssPropFn(prop, el,
|
|
198
|
-
if (
|
|
199
|
-
|
|
191
|
+
function cssPropFn(prop, el, stops) {
|
|
192
|
+
if (stops.length === 1) {
|
|
193
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
200
194
|
}
|
|
201
195
|
|
|
202
|
-
|
|
196
|
+
stops = parseStops(stops);
|
|
203
197
|
|
|
204
198
|
return (css, percent) => {
|
|
205
|
-
css[prop] = getValue(
|
|
199
|
+
css[prop] = getValue(stops, percent);
|
|
206
200
|
};
|
|
207
201
|
}
|
|
208
202
|
|
|
209
|
-
function strokeFn(prop, el,
|
|
210
|
-
if (
|
|
211
|
-
|
|
203
|
+
function strokeFn(prop, el, stops) {
|
|
204
|
+
if (stops.length === 1) {
|
|
205
|
+
stops.unshift(0);
|
|
212
206
|
}
|
|
213
207
|
|
|
214
|
-
const unit = getUnit(
|
|
215
|
-
|
|
208
|
+
const unit = getUnit(stops);
|
|
209
|
+
const length = getMaxPathLength(el);
|
|
210
|
+
stops = parseStops(stops.reverse(), (stop) => {
|
|
211
|
+
stop = uikitUtil.toFloat(stop);
|
|
212
|
+
return unit === '%' ? stop * length / 100 : stop;
|
|
213
|
+
});
|
|
216
214
|
|
|
217
|
-
if (!
|
|
215
|
+
if (!stops.some((_ref) => {let [value] = _ref;return value;})) {
|
|
218
216
|
return uikitUtil.noop;
|
|
219
217
|
}
|
|
220
218
|
|
|
221
|
-
const length = getMaxPathLength(el);
|
|
222
219
|
uikitUtil.css(el, 'strokeDasharray', length);
|
|
223
220
|
|
|
224
|
-
if (unit === '%') {
|
|
225
|
-
steps = steps.map((step) => step * length / 100);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
steps = steps.reverse();
|
|
229
|
-
|
|
230
221
|
return (css, percent) => {
|
|
231
|
-
css.strokeDashoffset = getValue(
|
|
222
|
+
css.strokeDashoffset = getValue(stops, percent);
|
|
232
223
|
};
|
|
233
224
|
}
|
|
234
225
|
|
|
235
|
-
function backgroundFn(prop, el,
|
|
236
|
-
if (
|
|
237
|
-
|
|
226
|
+
function backgroundFn(prop, el, stops) {
|
|
227
|
+
if (stops.length === 1) {
|
|
228
|
+
stops.unshift(0);
|
|
238
229
|
}
|
|
239
230
|
|
|
240
231
|
prop = prop.substr(-1);
|
|
241
232
|
const attr = prop === 'y' ? 'height' : 'width';
|
|
242
|
-
|
|
233
|
+
stops = parseStops(stops, (stop) => uikitUtil.toPx(stop, attr, el));
|
|
243
234
|
|
|
244
235
|
const bgPos = getCssValue(el, "background-position-" + prop, '');
|
|
245
236
|
|
|
246
237
|
return getCssValue(el, 'backgroundSize', '') === 'cover' ?
|
|
247
|
-
backgroundCoverFn(prop, el,
|
|
248
|
-
setBackgroundPosFn(prop,
|
|
238
|
+
backgroundCoverFn(prop, el, stops, bgPos, attr) :
|
|
239
|
+
setBackgroundPosFn(prop, stops, bgPos);
|
|
249
240
|
}
|
|
250
241
|
|
|
251
|
-
function backgroundCoverFn(prop, el,
|
|
242
|
+
function backgroundCoverFn(prop, el, stops, bgPos, attr) {
|
|
252
243
|
const dimImage = getBackgroundImageDimensions(el);
|
|
253
244
|
|
|
254
245
|
if (!dimImage.width) {
|
|
255
246
|
return uikitUtil.noop;
|
|
256
247
|
}
|
|
257
248
|
|
|
258
|
-
const
|
|
259
|
-
const
|
|
260
|
-
const
|
|
249
|
+
const values = stops.map((_ref2) => {let [value] = _ref2;return value;});
|
|
250
|
+
const min = Math.min(...values);
|
|
251
|
+
const max = Math.max(...values);
|
|
252
|
+
const down = values.indexOf(min) < values.indexOf(max);
|
|
261
253
|
|
|
262
254
|
const diff = max - min;
|
|
263
255
|
let pos = (down ? -diff : 0) - (down ? min : max);
|
|
@@ -282,7 +274,7 @@
|
|
|
282
274
|
|
|
283
275
|
const dim = uikitUtil.Dimensions.cover(dimImage, dimEl);
|
|
284
276
|
|
|
285
|
-
const fn = setBackgroundPosFn(prop,
|
|
277
|
+
const fn = setBackgroundPosFn(prop, stops, pos + "px");
|
|
286
278
|
return (css, percent) => {
|
|
287
279
|
fn(css, percent);
|
|
288
280
|
css.backgroundSize = dim.width + "px " + dim.height + "px";
|
|
@@ -290,9 +282,9 @@
|
|
|
290
282
|
};
|
|
291
283
|
}
|
|
292
284
|
|
|
293
|
-
function setBackgroundPosFn(prop,
|
|
285
|
+
function setBackgroundPosFn(prop, stops, pos) {
|
|
294
286
|
return function (css, percent) {
|
|
295
|
-
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(
|
|
287
|
+
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(stops, percent) + "px)";
|
|
296
288
|
};
|
|
297
289
|
}
|
|
298
290
|
|
|
@@ -313,6 +305,7 @@
|
|
|
313
305
|
dimensions[src] = toDimensions(image);
|
|
314
306
|
uikitUtil.trigger(el, 'bgimageload');
|
|
315
307
|
};
|
|
308
|
+
return toDimensions(image);
|
|
316
309
|
}
|
|
317
310
|
}
|
|
318
311
|
|
|
@@ -326,27 +319,71 @@
|
|
|
326
319
|
|
|
327
320
|
}
|
|
328
321
|
|
|
329
|
-
function
|
|
330
|
-
const
|
|
331
|
-
const
|
|
322
|
+
function parseStops(stops, fn) {if (fn === void 0) {fn = uikitUtil.toFloat;}
|
|
323
|
+
const result = [];
|
|
324
|
+
const { length } = stops;
|
|
325
|
+
let nullIndex = 0;
|
|
326
|
+
for (let i = 0; i < length; i++) {
|
|
327
|
+
let [value, percent] = uikitUtil.isString(stops[i]) ? stops[i].trim().split(' ') : [stops[i]];
|
|
328
|
+
value = fn(value);
|
|
329
|
+
percent = percent ? uikitUtil.toFloat(percent) / 100 : null;
|
|
330
|
+
|
|
331
|
+
if (i === 0) {
|
|
332
|
+
if (percent === null) {
|
|
333
|
+
percent = 0;
|
|
334
|
+
} else if (percent) {
|
|
335
|
+
result.push([value, 0]);
|
|
336
|
+
}
|
|
337
|
+
} else if (i === length - 1) {
|
|
338
|
+
if (percent === null) {
|
|
339
|
+
percent = 1;
|
|
340
|
+
} else if (percent !== 1) {
|
|
341
|
+
result.push([value, percent]);
|
|
342
|
+
percent = 1;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
result.push([value, percent]);
|
|
347
|
+
|
|
348
|
+
if (percent === null) {
|
|
349
|
+
nullIndex++;
|
|
350
|
+
} else if (nullIndex) {
|
|
351
|
+
const leftPercent = result[i - nullIndex - 1][1];
|
|
352
|
+
const p = (percent - leftPercent) / (nullIndex + 1);
|
|
353
|
+
for (let j = nullIndex; j > 0; j--) {
|
|
354
|
+
result[i - j][1] = leftPercent + p * (nullIndex - j + 1);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
nullIndex = 0;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
332
360
|
|
|
333
|
-
return
|
|
334
|
-
slice(index, index + 2).
|
|
335
|
-
concat(percent === 1 ? 1 : percent % (1 / count) * count);
|
|
361
|
+
return result;
|
|
336
362
|
}
|
|
337
363
|
|
|
338
|
-
function
|
|
339
|
-
const
|
|
340
|
-
return
|
|
364
|
+
function getStop(stops, percent) {
|
|
365
|
+
const index = uikitUtil.findIndex(stops.slice(1), (_ref3) => {let [, targetPercent] = _ref3;return percent <= targetPercent;}) + 1;
|
|
366
|
+
return [
|
|
367
|
+
stops[index - 1][0],
|
|
368
|
+
stops[index][0],
|
|
369
|
+
(percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])];
|
|
370
|
+
|
|
341
371
|
}
|
|
342
372
|
|
|
343
|
-
function
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
'') ||
|
|
348
|
-
defaultUnit);
|
|
373
|
+
function getValue(stops, percent) {
|
|
374
|
+
const [start, end, p] = getStop(stops, percent);
|
|
375
|
+
return uikitUtil.isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
|
|
376
|
+
}
|
|
349
377
|
|
|
378
|
+
const unitRe = /^-?\d+([^\s]*)/;
|
|
379
|
+
function getUnit(stops, defaultUnit) {
|
|
380
|
+
for (const stop of stops) {
|
|
381
|
+
const match = stop.match == null ? void 0 : stop.match(unitRe);
|
|
382
|
+
if (match) {
|
|
383
|
+
return match[1];
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
return defaultUnit;
|
|
350
387
|
}
|
|
351
388
|
|
|
352
389
|
function getCssValue(el, prop, value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.76734f785 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(o,m){typeof exports=="object"&&typeof module<"u"?module.exports=m(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitparallax",["uikit-util"],m):(o=typeof globalThis<"u"?globalThis:o||self,o.UIkitParallax=m(o.UIkit.util))})(this,function(o){"use strict";var m={props:{media:Boolean},data:{media:!1},computed:{matchMedia(){const e=R(this.media);return!e||window.matchMedia(e).matches}}};function R(e){if(o.isString(e)){if(e[0]==="@"){const t="breakpoint-"+e.substr(1);e=o.toFloat(o.getCssVar(t))}else if(isNaN(e))return e}return e&&!isNaN(e)?"(min-width: "+e+"px)":!1}o.memoize(async e=>e?o.startsWith(e,"data:")?decodeURIComponent(e.split(",")[1]):(await fetch(e)).text():Promise.reject());function V(e){return Math.ceil(Math.max(0,...o.$$("[stroke]",e).map(t=>{try{return t.getTotalLength()}catch{return 0}})))}const y={x:F,y:F,rotate:F,scale:F,color:I,backgroundColor:I,borderColor:I,blur:g,hue:g,fopacity:g,grayscale:g,invert:g,saturate:g,sepia:g,opacity:L,stroke:_,bgx:N,bgy:N},{keys:P}=Object;var q={mixins:[m],props:$(P(y),"list"),data:$(P(y),void 0),computed:{props(e,t){return P(y).reduce((n,r)=>(o.isUndefined(e[r])||(n[r]=y[r](r,t,e[r].slice())),n),{})}},events:{bgimageload(){this.$emit()}},methods:{reset(){o.each(this.getCss(0),(e,t)=>o.css(this.$el,t,""))},getCss(e){const t={transform:"",filter:""};for(const n in this.props)this.props[n](t,e);return t}}};function F(e,t,n){const r=S(n)||{x:"px",y:"px",rotate:"deg"}[e]||"";let a;return(e==="x"||e==="y")&&(e="translate"+o.ucfirst(e),a=c=>o.toFloat(o.toFloat(c).toFixed(r==="px"?0:6))),n.length===1&&n.unshift(e==="scale"?1:0),n=l(n,a),(c,s)=>{c.transform+=" "+e+"("+x(n,s)+r+")"}}function I(e,t,n){return n.length===1&&n.unshift(b(t,e,"")),n=l(n,r=>H(t,r)),(r,a)=>{const[c,s,i]=O(n,a),d=c.map((u,f)=>(u+=i*(s[f]-u),f===3?o.toFloat(u):parseInt(u,10))).join(",");r[e]="rgba("+d+")"}}function H(e,t){return b(e,"color",t).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(o.toFloat)}function g(e,t,n){n.length===1&&n.unshift(0);const r=S(n)||{blur:"px",hue:"deg"}[e]||"%";return e={fopacity:"opacity",hue:"hue-rotate"}[e]||e,n=l(n),(a,c)=>{const s=x(n,c);a.filter+=" "+e+"("+(s+r)+")"}}function L(e,t,n){return n.length===1&&n.unshift(b(t,e,"")),n=l(n),(r,a)=>{r[e]=x(n,a)}}function _(e,t,n){n.length===1&&n.unshift(0);const r=S(n),a=V(t);return n=l(n.reverse(),c=>(c=o.toFloat(c),r==="%"?c*a/100:c)),n.some(c=>{let[s]=c;return s})?(o.css(t,"strokeDasharray",a),(c,s)=>{c.strokeDashoffset=x(n,s)}):o.noop}function N(e,t,n){n.length===1&&n.unshift(0),e=e.substr(-1);const r=e==="y"?"height":"width";n=l(n,c=>o.toPx(c,r,t));const a=b(t,"background-position-"+e,"");return b(t,"backgroundSize","")==="cover"?A(e,t,n,a,r):j(e,n,a)}function A(e,t,n,r,a){const c=G(t);if(!c.width)return o.noop;const s=n.map(h=>{let[D]=h;return D}),i=Math.min(...s),d=Math.max(...s),u=s.indexOf(i)<s.indexOf(d),f=d-i;let W=(u?-f:0)-(u?i:d);const w={width:t.offsetWidth,height:t.offsetHeight},B=o.Dimensions.cover(c,w),M=B[a]-w[a];if(M<f)w[a]=B[a]+f-M;else if(M>f){const h=w[a]/o.toPx(r,a,t,!0);h&&(W-=(M-f)/h)}const E=o.Dimensions.cover(c,w),Q=j(e,n,W+"px");return(h,D)=>{Q(h,D),h.backgroundSize=E.width+"px "+E.height+"px",h.backgroundRepeat="no-repeat"}}function j(e,t,n){return function(r,a){r["background-position-"+e]="calc("+n+" + "+x(t,a)+"px)"}}const v={};function G(e){const t=o.css(e,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(v[t])return v[t];const n=new Image;return t&&(n.src=t,!n.naturalWidth)?(n.onload=()=>{v[t]=C(n),o.trigger(e,"bgimageload")},C(n)):v[t]=C(n)}function C(e){return{width:e.naturalWidth,height:e.naturalHeight}}function l(e,t){t===void 0&&(t=o.toFloat);const n=[],{length:r}=e;let a=0;for(let c=0;c<r;c++){let[s,i]=o.isString(e[c])?e[c].trim().split(" "):[e[c]];if(s=t(s),i=i?o.toFloat(i)/100:null,c===0?i===null?i=0:i&&n.push([s,0]):c===r-1&&(i===null?i=1:i!==1&&(n.push([s,i]),i=1)),n.push([s,i]),i===null)a++;else if(a){const d=n[c-a-1][1],u=(i-d)/(a+1);for(let f=a;f>0;f--)n[c-f][1]=d+u*(a-f+1);a=0}}return n}function O(e,t){const n=o.findIndex(e.slice(1),r=>{let[,a]=r;return t<=a})+1;return[e[n-1][0],e[n][0],(t-e[n-1][1])/(e[n][1]-e[n-1][1])]}function x(e,t){const[n,r,a]=O(e,t);return o.isNumber(n)?n+Math.abs(n-r)*a*(n<r?1:-1):+r}const J=/^-?\d+([^\s]*)/;function S(e,t){for(const n of e){const r=n.match==null?void 0:n.match(J);if(r)return r[1]}return t}function b(e,t,n){const r=e.style[t],a=o.css(o.css(e,t,n),t);return e.style[t]=r,a}function $(e,t){return e.reduce((n,r)=>(n[r]=t,n),{})}var z={mixins:[q],props:{target:String,viewport:Number,easing:Number,start:String,end:String},data:{target:!1,viewport:1,easing:1,start:0,end:0},computed:{target(e,t){let{target:n}=e;return T(n&&o.query(n,t)||t)},start(e){let{start:t}=e;return o.toPx(t,"height",this.target,!0)},end(e){let{end:t,viewport:n}=e;return o.toPx(t||(n=(1-n)*100)&&n+"vh+"+n+"%","height",this.target,!0)}},update:{read(e,t){let{percent:n}=e;if(t.has("scroll")||(n=!1),!this.matchMedia)return;const r=n;return n=K(o.scrolledOver(this.target,this.start,this.end),this.easing),{percent:n,style:r===n?!1:this.getCss(n)}},write(e){let{style:t}=e;if(!this.matchMedia){this.reset();return}t&&o.css(this.$el,t)},events:["scroll","resize"]}};function K(e,t){return t>=0?Math.pow(e,t+1):1-Math.pow(1-e,-t+1)}function T(e){return e?"offsetTop"in e?e:T(o.parent(e)):document.documentElement}return typeof window<"u"&&window.UIkit&&window.UIkit.component("parallax",z),z});
|