uikit 3.13.11-dev.eb080f280 → 3.14.1-dev.dadc910c0
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 +20 -1
- package/dist/css/uikit-core-rtl.css +4 -1
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +4 -1
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +4 -1
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +4 -1
- 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 +19 -5
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +19 -5
- 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 +62 -60
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +62 -60
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +2 -2
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +62 -60
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +1 -1
- 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 +19 -5
- 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 +126 -68
- 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 +188 -128
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/components/slider.js +1 -1
- package/src/js/core/accordion.js +21 -5
- package/src/js/core/cover.js +27 -14
- package/src/js/core/drop.js +22 -2
- package/src/js/core/height-match.js +1 -1
- package/src/js/core/margin.js +9 -2
- package/src/js/core/scrollspy-nav.js +2 -2
- package/src/js/mixin/parallax.js +61 -60
- package/src/js/mixin/togglable.js +16 -2
- package/src/js/util/lang.js +34 -38
- package/src/js/util/position.js +9 -9
- package/src/less/components/nav.less +1 -0
- package/src/less/components/utility.less +1 -0
- package/src/scss/components/nav.scss +1 -0
- package/src/scss/components/utility.scss +1 -0
- package/tests/alert.html +1 -1
- package/tests/drop.html +154 -80
- package/tests/navbar.html +1 -1
- package/tests/parallax.html +8 -8
- package/tests/sticky-parallax.html +8 -8
- package/tests/sticky.html +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.
|
|
1
|
+
/*! UIkit 3.14.1-dev.dadc910c0 | 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')) :
|
|
@@ -166,7 +166,9 @@
|
|
|
166
166
|
|
|
167
167
|
methods: {
|
|
168
168
|
reset() {
|
|
169
|
-
|
|
169
|
+
for (const prop in this.getCss(0)) {
|
|
170
|
+
uikitUtil.css(this.$el, prop, '');
|
|
171
|
+
}
|
|
170
172
|
},
|
|
171
173
|
|
|
172
174
|
getCss(percent) {
|
|
@@ -179,39 +181,39 @@
|
|
|
179
181
|
|
|
180
182
|
|
|
181
183
|
|
|
182
|
-
function transformFn(prop, el,
|
|
183
|
-
let unit = getUnit(
|
|
184
|
+
function transformFn(prop, el, steps) {
|
|
185
|
+
let unit = getUnit(steps) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
|
|
184
186
|
let transformFn;
|
|
185
187
|
|
|
186
188
|
if (prop === 'x' || prop === 'y') {
|
|
187
189
|
prop = "translate" + uikitUtil.ucfirst(prop);
|
|
188
|
-
transformFn = (
|
|
190
|
+
transformFn = (step) => uikitUtil.toFloat(uikitUtil.toFloat(step).toFixed(unit === 'px' ? 0 : 6));
|
|
189
191
|
} else if (prop === 'scale') {
|
|
190
192
|
unit = '';
|
|
191
|
-
transformFn = (
|
|
192
|
-
getUnit([
|
|
193
|
+
transformFn = (step) =>
|
|
194
|
+
getUnit([step]) ? uikitUtil.toPx(step, 'width', el, true) / el.offsetWidth : step;
|
|
193
195
|
}
|
|
194
196
|
|
|
195
|
-
if (
|
|
196
|
-
|
|
197
|
+
if (steps.length === 1) {
|
|
198
|
+
steps.unshift(prop === 'scale' ? 1 : 0);
|
|
197
199
|
}
|
|
198
200
|
|
|
199
|
-
|
|
201
|
+
steps = parseSteps(steps, transformFn);
|
|
200
202
|
|
|
201
203
|
return (css, percent) => {
|
|
202
|
-
css.transform += " " + prop + "(" + getValue(
|
|
204
|
+
css.transform += " " + prop + "(" + getValue(steps, percent) + unit + ")";
|
|
203
205
|
};
|
|
204
206
|
}
|
|
205
207
|
|
|
206
|
-
function colorFn(prop, el,
|
|
207
|
-
if (
|
|
208
|
-
|
|
208
|
+
function colorFn(prop, el, steps) {
|
|
209
|
+
if (steps.length === 1) {
|
|
210
|
+
steps.unshift(getCssValue(el, prop, ''));
|
|
209
211
|
}
|
|
210
212
|
|
|
211
|
-
|
|
213
|
+
steps = parseSteps(steps, (step) => parseColor(el, step));
|
|
212
214
|
|
|
213
215
|
return (css, percent) => {
|
|
214
|
-
const [start, end, p] =
|
|
216
|
+
const [start, end, p] = getStep(steps, percent);
|
|
215
217
|
const value = start.
|
|
216
218
|
map((value, i) => {
|
|
217
219
|
value += p * (end[i] - value);
|
|
@@ -231,80 +233,80 @@
|
|
|
231
233
|
map(uikitUtil.toFloat);
|
|
232
234
|
}
|
|
233
235
|
|
|
234
|
-
function filterFn(prop, el,
|
|
235
|
-
if (
|
|
236
|
-
|
|
236
|
+
function filterFn(prop, el, steps) {
|
|
237
|
+
if (steps.length === 1) {
|
|
238
|
+
steps.unshift(0);
|
|
237
239
|
}
|
|
238
240
|
|
|
239
|
-
const unit = getUnit(
|
|
241
|
+
const unit = getUnit(steps) || { blur: 'px', hue: 'deg' }[prop] || '%';
|
|
240
242
|
prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
|
|
241
|
-
|
|
243
|
+
steps = parseSteps(steps);
|
|
242
244
|
|
|
243
245
|
return (css, percent) => {
|
|
244
|
-
const value = getValue(
|
|
246
|
+
const value = getValue(steps, percent);
|
|
245
247
|
css.filter += " " + prop + "(" + (value + unit) + ")";
|
|
246
248
|
};
|
|
247
249
|
}
|
|
248
250
|
|
|
249
|
-
function cssPropFn(prop, el,
|
|
250
|
-
if (
|
|
251
|
-
|
|
251
|
+
function cssPropFn(prop, el, steps) {
|
|
252
|
+
if (steps.length === 1) {
|
|
253
|
+
steps.unshift(getCssValue(el, prop, ''));
|
|
252
254
|
}
|
|
253
255
|
|
|
254
|
-
|
|
256
|
+
steps = parseSteps(steps);
|
|
255
257
|
|
|
256
258
|
return (css, percent) => {
|
|
257
|
-
css[prop] = getValue(
|
|
259
|
+
css[prop] = getValue(steps, percent);
|
|
258
260
|
};
|
|
259
261
|
}
|
|
260
262
|
|
|
261
|
-
function strokeFn(prop, el,
|
|
262
|
-
if (
|
|
263
|
-
|
|
263
|
+
function strokeFn(prop, el, steps) {
|
|
264
|
+
if (steps.length === 1) {
|
|
265
|
+
steps.unshift(0);
|
|
264
266
|
}
|
|
265
267
|
|
|
266
|
-
const unit = getUnit(
|
|
268
|
+
const unit = getUnit(steps);
|
|
267
269
|
const length = getMaxPathLength(el);
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
return unit === '%' ?
|
|
270
|
+
steps = parseSteps(steps.reverse(), (step) => {
|
|
271
|
+
step = uikitUtil.toFloat(step);
|
|
272
|
+
return unit === '%' ? step * length / 100 : step;
|
|
271
273
|
});
|
|
272
274
|
|
|
273
|
-
if (!
|
|
275
|
+
if (!steps.some((_ref) => {let [value] = _ref;return value;})) {
|
|
274
276
|
return uikitUtil.noop;
|
|
275
277
|
}
|
|
276
278
|
|
|
277
279
|
uikitUtil.css(el, 'strokeDasharray', length);
|
|
278
280
|
|
|
279
281
|
return (css, percent) => {
|
|
280
|
-
css.strokeDashoffset = getValue(
|
|
282
|
+
css.strokeDashoffset = getValue(steps, percent);
|
|
281
283
|
};
|
|
282
284
|
}
|
|
283
285
|
|
|
284
|
-
function backgroundFn(prop, el,
|
|
285
|
-
if (
|
|
286
|
-
|
|
286
|
+
function backgroundFn(prop, el, steps) {
|
|
287
|
+
if (steps.length === 1) {
|
|
288
|
+
steps.unshift(0);
|
|
287
289
|
}
|
|
288
290
|
|
|
289
291
|
prop = prop.substr(-1);
|
|
290
292
|
const attr = prop === 'y' ? 'height' : 'width';
|
|
291
|
-
|
|
293
|
+
steps = parseSteps(steps, (step) => uikitUtil.toPx(step, attr, el));
|
|
292
294
|
|
|
293
295
|
const bgPos = getCssValue(el, "background-position-" + prop, '');
|
|
294
296
|
|
|
295
297
|
return getCssValue(el, 'backgroundSize', '') === 'cover' ?
|
|
296
|
-
backgroundCoverFn(prop, el,
|
|
297
|
-
setBackgroundPosFn(prop,
|
|
298
|
+
backgroundCoverFn(prop, el, steps, bgPos, attr) :
|
|
299
|
+
setBackgroundPosFn(prop, steps, bgPos);
|
|
298
300
|
}
|
|
299
301
|
|
|
300
|
-
function backgroundCoverFn(prop, el,
|
|
302
|
+
function backgroundCoverFn(prop, el, steps, bgPos, attr) {
|
|
301
303
|
const dimImage = getBackgroundImageDimensions(el);
|
|
302
304
|
|
|
303
305
|
if (!dimImage.width) {
|
|
304
306
|
return uikitUtil.noop;
|
|
305
307
|
}
|
|
306
308
|
|
|
307
|
-
const values =
|
|
309
|
+
const values = steps.map((_ref2) => {let [value] = _ref2;return value;});
|
|
308
310
|
const min = Math.min(...values);
|
|
309
311
|
const max = Math.max(...values);
|
|
310
312
|
const down = values.indexOf(min) < values.indexOf(max);
|
|
@@ -332,7 +334,7 @@
|
|
|
332
334
|
|
|
333
335
|
const dim = uikitUtil.Dimensions.cover(dimImage, dimEl);
|
|
334
336
|
|
|
335
|
-
const fn = setBackgroundPosFn(prop,
|
|
337
|
+
const fn = setBackgroundPosFn(prop, steps, pos + "px");
|
|
336
338
|
return (css, percent) => {
|
|
337
339
|
fn(css, percent);
|
|
338
340
|
css.backgroundSize = dim.width + "px " + dim.height + "px";
|
|
@@ -340,9 +342,9 @@
|
|
|
340
342
|
};
|
|
341
343
|
}
|
|
342
344
|
|
|
343
|
-
function setBackgroundPosFn(prop,
|
|
345
|
+
function setBackgroundPosFn(prop, steps, pos) {
|
|
344
346
|
return function (css, percent) {
|
|
345
|
-
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(
|
|
347
|
+
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(steps, percent) + "px)";
|
|
346
348
|
};
|
|
347
349
|
}
|
|
348
350
|
|
|
@@ -377,12 +379,12 @@
|
|
|
377
379
|
|
|
378
380
|
}
|
|
379
381
|
|
|
380
|
-
function
|
|
382
|
+
function parseSteps(steps, fn) {if (fn === void 0) {fn = uikitUtil.toFloat;}
|
|
381
383
|
const result = [];
|
|
382
|
-
const { length } =
|
|
384
|
+
const { length } = steps;
|
|
383
385
|
let nullIndex = 0;
|
|
384
386
|
for (let i = 0; i < length; i++) {
|
|
385
|
-
let [value, percent] = uikitUtil.isString(
|
|
387
|
+
let [value, percent] = uikitUtil.isString(steps[i]) ? steps[i].trim().split(' ') : [steps[i]];
|
|
386
388
|
value = fn(value);
|
|
387
389
|
percent = percent ? uikitUtil.toFloat(percent) / 100 : null;
|
|
388
390
|
|
|
@@ -419,24 +421,24 @@
|
|
|
419
421
|
return result;
|
|
420
422
|
}
|
|
421
423
|
|
|
422
|
-
function
|
|
423
|
-
const index = uikitUtil.findIndex(
|
|
424
|
+
function getStep(steps, percent) {
|
|
425
|
+
const index = uikitUtil.findIndex(steps.slice(1), (_ref3) => {let [, targetPercent] = _ref3;return percent <= targetPercent;}) + 1;
|
|
424
426
|
return [
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
(percent -
|
|
427
|
+
steps[index - 1][0],
|
|
428
|
+
steps[index][0],
|
|
429
|
+
(percent - steps[index - 1][1]) / (steps[index][1] - steps[index - 1][1])];
|
|
428
430
|
|
|
429
431
|
}
|
|
430
432
|
|
|
431
|
-
function getValue(
|
|
432
|
-
const [start, end, p] =
|
|
433
|
+
function getValue(steps, percent) {
|
|
434
|
+
const [start, end, p] = getStep(steps, percent);
|
|
433
435
|
return uikitUtil.isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
|
|
434
436
|
}
|
|
435
437
|
|
|
436
438
|
const unitRe = /^-?\d+([^\s]*)/;
|
|
437
|
-
function getUnit(
|
|
438
|
-
for (const
|
|
439
|
-
const match =
|
|
439
|
+
function getUnit(steps, defaultUnit) {
|
|
440
|
+
for (const step of steps) {
|
|
441
|
+
const match = step.match == null ? void 0 : step.match(unitRe);
|
|
440
442
|
if (match) {
|
|
441
443
|
return match[1];
|
|
442
444
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.
|
|
1
|
+
/*! UIkit 3.14.1-dev.dadc910c0 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(r,m){typeof exports=="object"&&typeof module<"u"?module.exports=m(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitparallax",["uikit-util"],m):(r=typeof globalThis<"u"?globalThis:r||self,r.UIkitParallax=m(r.UIkit.util))})(this,function(r){"use strict";var m={connected(){var e;this.registerObserver(r.observeResize(((e=this.$options.resizeTargets)==null?void 0:e.call(this))||this.$el,()=>this.$emit("resize")))}},B={connected(){V(this._uid,()=>this.$emit("scroll"))},disconnected(){q(this._uid)}};const y=new Map;let x;function V(e,t){x=x||r.on(window,"scroll",()=>y.forEach(n=>n()),{passive:!0,capture:!0}),y.set(e,t)}function q(e){y.delete(e),x&&!y.size&&(x(),x=null)}var H={props:{media:Boolean},data:{media:!1},connected(){const e=A(this.media);if(this.matchMedia=!0,e){this.mediaObj=window.matchMedia(e);const t=()=>{this.matchMedia=this.mediaObj.matches,r.trigger(this.$el,r.createEvent("mediachange",!1,!0,[this.mediaObj]))};this.offMediaObj=r.on(this.mediaObj,"change",()=>{t(),this.$emit("resize")}),t()}},disconnected(){var e;(e=this.offMediaObj)==null||e.call(this)}};function A(e){if(r.isString(e)){if(r.startsWith(e,"@")){const t="breakpoint-"+e.substr(1);e=r.toFloat(r.getCssVar(t))}else if(isNaN(e))return e}return e&&r.isNumeric(e)?"(min-width: "+e+"px)":""}r.memoize(async e=>e?r.startsWith(e,"data:")?decodeURIComponent(e.split(",")[1]):(await fetch(e)).text():Promise.reject());function G(e){return Math.ceil(Math.max(0,...r.$$("[stroke]",e).map(t=>{try{return t.getTotalLength()}catch{return 0}})))}const M={x:F,y:F,rotate:F,scale:F,color:S,backgroundColor:S,borderColor:S,blur:l,hue:l,fopacity:l,grayscale:l,invert:l,saturate:l,sepia:l,opacity:Q,stroke:X,bgx:C,bgy:C},{keys:j}=Object;var J={mixins:[H],props:L(j(M),"list"),data:L(j(M),void 0),computed:{props(e,t){return j(M).reduce((n,o)=>(r.isUndefined(e[o])||(n[o]=M[o](o,t,e[o].slice())),n),{})}},events:{load(){this.$emit()}},methods:{reset(){for(const e in this.getCss(0))r.css(this.$el,e,"")},getCss(e){const t={transform:"",filter:""};for(const n in this.props)this.props[n](t,e);return t}}};function F(e,t,n){let o=P(n)||{x:"px",y:"px",rotate:"deg"}[e]||"",s;return e==="x"||e==="y"?(e="translate"+r.ucfirst(e),s=a=>r.toFloat(r.toFloat(a).toFixed(o==="px"?0:6))):e==="scale"&&(o="",s=a=>P([a])?r.toPx(a,"width",t,!0)/t.offsetWidth:a),n.length===1&&n.unshift(e==="scale"?1:0),n=g(n,s),(a,c)=>{a.transform+=" "+e+"("+b(n,c)+o+")"}}function S(e,t,n){return n.length===1&&n.unshift(v(t,e,"")),n=g(n,o=>K(t,o)),(o,s)=>{const[a,c,i]=E(n,s),h=a.map((d,f)=>(d+=i*(c[f]-d),f===3?r.toFloat(d):parseInt(d,10))).join(",");o[e]="rgba("+h+")"}}function K(e,t){return v(e,"color",t).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(r.toFloat)}function l(e,t,n){n.length===1&&n.unshift(0);const o=P(n)||{blur:"px",hue:"deg"}[e]||"%";return e={fopacity:"opacity",hue:"hue-rotate"}[e]||e,n=g(n),(s,a)=>{const c=b(n,a);s.filter+=" "+e+"("+(c+o)+")"}}function Q(e,t,n){return n.length===1&&n.unshift(v(t,e,"")),n=g(n),(o,s)=>{o[e]=b(n,s)}}function X(e,t,n){n.length===1&&n.unshift(0);const o=P(n),s=G(t);return n=g(n.reverse(),a=>(a=r.toFloat(a),o==="%"?a*s/100:a)),n.some(a=>{let[c]=a;return c})?(r.css(t,"strokeDasharray",s),(a,c)=>{a.strokeDashoffset=b(n,c)}):r.noop}function C(e,t,n){n.length===1&&n.unshift(0),e=e.substr(-1);const o=e==="y"?"height":"width";n=g(n,a=>r.toPx(a,o,t));const s=v(t,"background-position-"+e,"");return v(t,"backgroundSize","")==="cover"?Y(e,t,n,s,o):D(e,n,s)}function Y(e,t,n,o,s){const a=Z(t);if(!a.width)return r.noop;const c=n.map(u=>{let[z]=u;return z}),i=Math.min(...c),h=Math.max(...c),d=c.indexOf(i)<c.indexOf(h),f=h-i;let R=(d?-f:0)-(d?i:h);const w={width:t.offsetWidth,height:t.offsetHeight},T=r.Dimensions.cover(a,w),O=T[s]-w[s];if(O<f)w[s]=T[s]+f-O;else if(O>f){const u=w[s]/r.toPx(o,s,t,!0);u&&(R-=(O-f)/u)}const _=r.Dimensions.cover(a,w),U=D(e,n,R+"px");return(u,z)=>{U(u,z),u.backgroundSize=_.width+"px "+_.height+"px",u.backgroundRepeat="no-repeat"}}function D(e,t,n){return function(o,s){o["background-position-"+e]="calc("+n+" + "+b(t,s)+"px)"}}const $={};function Z(e){const t=r.css(e,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if($[t])return $[t];const n=new Image;return t&&(n.src=t,!n.naturalWidth)?(n.onload=()=>{$[t]=I(n),r.trigger(e,r.createEvent("load",!1))},I(n)):$[t]=I(n)}function I(e){return{width:e.naturalWidth,height:e.naturalHeight}}function g(e,t){t===void 0&&(t=r.toFloat);const n=[],{length:o}=e;let s=0;for(let a=0;a<o;a++){let[c,i]=r.isString(e[a])?e[a].trim().split(" "):[e[a]];if(c=t(c),i=i?r.toFloat(i)/100:null,a===0?i===null?i=0:i&&n.push([c,0]):a===o-1&&(i===null?i=1:i!==1&&(n.push([c,i]),i=1)),n.push([c,i]),i===null)s++;else if(s){const h=n[a-s-1][1],d=(i-h)/(s+1);for(let f=s;f>0;f--)n[a-f][1]=h+d*(s-f+1);s=0}}return n}function E(e,t){const n=r.findIndex(e.slice(1),o=>{let[,s]=o;return t<=s})+1;return[e[n-1][0],e[n][0],(t-e[n-1][1])/(e[n][1]-e[n-1][1])]}function b(e,t){const[n,o,s]=E(e,t);return r.isNumber(n)?n+Math.abs(n-o)*s*(n<o?1:-1):+o}const p=/^-?\d+([^\s]*)/;function P(e,t){for(const n of e){const o=n.match==null?void 0:n.match(p);if(o)return o[1]}return t}function v(e,t,n){const o=e.style[t],s=r.css(r.css(e,t,n),t);return e.style[t]=o,s}function L(e,t){return e.reduce((n,o)=>(n[o]=t,n),{})}var N={mixins:[J,m,B],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 W(n&&r.query(n,t)||t)},start(e){let{start:t}=e;return r.toPx(t,"height",this.target,!0)},end(e){let{end:t,viewport:n}=e;return r.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 o=n;return n=k(r.scrolledOver(this.target,this.start,this.end),this.easing),{percent:n,style:o===n?!1:this.getCss(n)}},write(e){let{style:t}=e;if(!this.matchMedia){this.reset();return}t&&r.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 W(e){return e?"offsetTop"in e?e:W(r.parent(e)):document.documentElement}return typeof window<"u"&&window.UIkit&&window.UIkit.component("parallax",N),N});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.
|
|
1
|
+
/*! UIkit 3.14.1-dev.dadc910c0 | 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')) :
|
|
@@ -126,7 +126,9 @@
|
|
|
126
126
|
|
|
127
127
|
methods: {
|
|
128
128
|
reset() {
|
|
129
|
-
|
|
129
|
+
for (const prop in this.getCss(0)) {
|
|
130
|
+
uikitUtil.css(this.$el, prop, '');
|
|
131
|
+
}
|
|
130
132
|
},
|
|
131
133
|
|
|
132
134
|
getCss(percent) {
|
|
@@ -139,39 +141,39 @@
|
|
|
139
141
|
|
|
140
142
|
|
|
141
143
|
|
|
142
|
-
function transformFn(prop, el,
|
|
143
|
-
let unit = getUnit(
|
|
144
|
+
function transformFn(prop, el, steps) {
|
|
145
|
+
let unit = getUnit(steps) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
|
|
144
146
|
let transformFn;
|
|
145
147
|
|
|
146
148
|
if (prop === 'x' || prop === 'y') {
|
|
147
149
|
prop = "translate" + uikitUtil.ucfirst(prop);
|
|
148
|
-
transformFn = (
|
|
150
|
+
transformFn = (step) => uikitUtil.toFloat(uikitUtil.toFloat(step).toFixed(unit === 'px' ? 0 : 6));
|
|
149
151
|
} else if (prop === 'scale') {
|
|
150
152
|
unit = '';
|
|
151
|
-
transformFn = (
|
|
152
|
-
getUnit([
|
|
153
|
+
transformFn = (step) =>
|
|
154
|
+
getUnit([step]) ? uikitUtil.toPx(step, 'width', el, true) / el.offsetWidth : step;
|
|
153
155
|
}
|
|
154
156
|
|
|
155
|
-
if (
|
|
156
|
-
|
|
157
|
+
if (steps.length === 1) {
|
|
158
|
+
steps.unshift(prop === 'scale' ? 1 : 0);
|
|
157
159
|
}
|
|
158
160
|
|
|
159
|
-
|
|
161
|
+
steps = parseSteps(steps, transformFn);
|
|
160
162
|
|
|
161
163
|
return (css, percent) => {
|
|
162
|
-
css.transform += " " + prop + "(" + getValue(
|
|
164
|
+
css.transform += " " + prop + "(" + getValue(steps, percent) + unit + ")";
|
|
163
165
|
};
|
|
164
166
|
}
|
|
165
167
|
|
|
166
|
-
function colorFn(prop, el,
|
|
167
|
-
if (
|
|
168
|
-
|
|
168
|
+
function colorFn(prop, el, steps) {
|
|
169
|
+
if (steps.length === 1) {
|
|
170
|
+
steps.unshift(getCssValue(el, prop, ''));
|
|
169
171
|
}
|
|
170
172
|
|
|
171
|
-
|
|
173
|
+
steps = parseSteps(steps, (step) => parseColor(el, step));
|
|
172
174
|
|
|
173
175
|
return (css, percent) => {
|
|
174
|
-
const [start, end, p] =
|
|
176
|
+
const [start, end, p] = getStep(steps, percent);
|
|
175
177
|
const value = start.
|
|
176
178
|
map((value, i) => {
|
|
177
179
|
value += p * (end[i] - value);
|
|
@@ -191,80 +193,80 @@
|
|
|
191
193
|
map(uikitUtil.toFloat);
|
|
192
194
|
}
|
|
193
195
|
|
|
194
|
-
function filterFn(prop, el,
|
|
195
|
-
if (
|
|
196
|
-
|
|
196
|
+
function filterFn(prop, el, steps) {
|
|
197
|
+
if (steps.length === 1) {
|
|
198
|
+
steps.unshift(0);
|
|
197
199
|
}
|
|
198
200
|
|
|
199
|
-
const unit = getUnit(
|
|
201
|
+
const unit = getUnit(steps) || { blur: 'px', hue: 'deg' }[prop] || '%';
|
|
200
202
|
prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
|
|
201
|
-
|
|
203
|
+
steps = parseSteps(steps);
|
|
202
204
|
|
|
203
205
|
return (css, percent) => {
|
|
204
|
-
const value = getValue(
|
|
206
|
+
const value = getValue(steps, percent);
|
|
205
207
|
css.filter += " " + prop + "(" + (value + unit) + ")";
|
|
206
208
|
};
|
|
207
209
|
}
|
|
208
210
|
|
|
209
|
-
function cssPropFn(prop, el,
|
|
210
|
-
if (
|
|
211
|
-
|
|
211
|
+
function cssPropFn(prop, el, steps) {
|
|
212
|
+
if (steps.length === 1) {
|
|
213
|
+
steps.unshift(getCssValue(el, prop, ''));
|
|
212
214
|
}
|
|
213
215
|
|
|
214
|
-
|
|
216
|
+
steps = parseSteps(steps);
|
|
215
217
|
|
|
216
218
|
return (css, percent) => {
|
|
217
|
-
css[prop] = getValue(
|
|
219
|
+
css[prop] = getValue(steps, percent);
|
|
218
220
|
};
|
|
219
221
|
}
|
|
220
222
|
|
|
221
|
-
function strokeFn(prop, el,
|
|
222
|
-
if (
|
|
223
|
-
|
|
223
|
+
function strokeFn(prop, el, steps) {
|
|
224
|
+
if (steps.length === 1) {
|
|
225
|
+
steps.unshift(0);
|
|
224
226
|
}
|
|
225
227
|
|
|
226
|
-
const unit = getUnit(
|
|
228
|
+
const unit = getUnit(steps);
|
|
227
229
|
const length = getMaxPathLength(el);
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
return unit === '%' ?
|
|
230
|
+
steps = parseSteps(steps.reverse(), (step) => {
|
|
231
|
+
step = uikitUtil.toFloat(step);
|
|
232
|
+
return unit === '%' ? step * length / 100 : step;
|
|
231
233
|
});
|
|
232
234
|
|
|
233
|
-
if (!
|
|
235
|
+
if (!steps.some((_ref) => {let [value] = _ref;return value;})) {
|
|
234
236
|
return uikitUtil.noop;
|
|
235
237
|
}
|
|
236
238
|
|
|
237
239
|
uikitUtil.css(el, 'strokeDasharray', length);
|
|
238
240
|
|
|
239
241
|
return (css, percent) => {
|
|
240
|
-
css.strokeDashoffset = getValue(
|
|
242
|
+
css.strokeDashoffset = getValue(steps, percent);
|
|
241
243
|
};
|
|
242
244
|
}
|
|
243
245
|
|
|
244
|
-
function backgroundFn(prop, el,
|
|
245
|
-
if (
|
|
246
|
-
|
|
246
|
+
function backgroundFn(prop, el, steps) {
|
|
247
|
+
if (steps.length === 1) {
|
|
248
|
+
steps.unshift(0);
|
|
247
249
|
}
|
|
248
250
|
|
|
249
251
|
prop = prop.substr(-1);
|
|
250
252
|
const attr = prop === 'y' ? 'height' : 'width';
|
|
251
|
-
|
|
253
|
+
steps = parseSteps(steps, (step) => uikitUtil.toPx(step, attr, el));
|
|
252
254
|
|
|
253
255
|
const bgPos = getCssValue(el, "background-position-" + prop, '');
|
|
254
256
|
|
|
255
257
|
return getCssValue(el, 'backgroundSize', '') === 'cover' ?
|
|
256
|
-
backgroundCoverFn(prop, el,
|
|
257
|
-
setBackgroundPosFn(prop,
|
|
258
|
+
backgroundCoverFn(prop, el, steps, bgPos, attr) :
|
|
259
|
+
setBackgroundPosFn(prop, steps, bgPos);
|
|
258
260
|
}
|
|
259
261
|
|
|
260
|
-
function backgroundCoverFn(prop, el,
|
|
262
|
+
function backgroundCoverFn(prop, el, steps, bgPos, attr) {
|
|
261
263
|
const dimImage = getBackgroundImageDimensions(el);
|
|
262
264
|
|
|
263
265
|
if (!dimImage.width) {
|
|
264
266
|
return uikitUtil.noop;
|
|
265
267
|
}
|
|
266
268
|
|
|
267
|
-
const values =
|
|
269
|
+
const values = steps.map((_ref2) => {let [value] = _ref2;return value;});
|
|
268
270
|
const min = Math.min(...values);
|
|
269
271
|
const max = Math.max(...values);
|
|
270
272
|
const down = values.indexOf(min) < values.indexOf(max);
|
|
@@ -292,7 +294,7 @@
|
|
|
292
294
|
|
|
293
295
|
const dim = uikitUtil.Dimensions.cover(dimImage, dimEl);
|
|
294
296
|
|
|
295
|
-
const fn = setBackgroundPosFn(prop,
|
|
297
|
+
const fn = setBackgroundPosFn(prop, steps, pos + "px");
|
|
296
298
|
return (css, percent) => {
|
|
297
299
|
fn(css, percent);
|
|
298
300
|
css.backgroundSize = dim.width + "px " + dim.height + "px";
|
|
@@ -300,9 +302,9 @@
|
|
|
300
302
|
};
|
|
301
303
|
}
|
|
302
304
|
|
|
303
|
-
function setBackgroundPosFn(prop,
|
|
305
|
+
function setBackgroundPosFn(prop, steps, pos) {
|
|
304
306
|
return function (css, percent) {
|
|
305
|
-
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(
|
|
307
|
+
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(steps, percent) + "px)";
|
|
306
308
|
};
|
|
307
309
|
}
|
|
308
310
|
|
|
@@ -337,12 +339,12 @@
|
|
|
337
339
|
|
|
338
340
|
}
|
|
339
341
|
|
|
340
|
-
function
|
|
342
|
+
function parseSteps(steps, fn) {if (fn === void 0) {fn = uikitUtil.toFloat;}
|
|
341
343
|
const result = [];
|
|
342
|
-
const { length } =
|
|
344
|
+
const { length } = steps;
|
|
343
345
|
let nullIndex = 0;
|
|
344
346
|
for (let i = 0; i < length; i++) {
|
|
345
|
-
let [value, percent] = uikitUtil.isString(
|
|
347
|
+
let [value, percent] = uikitUtil.isString(steps[i]) ? steps[i].trim().split(' ') : [steps[i]];
|
|
346
348
|
value = fn(value);
|
|
347
349
|
percent = percent ? uikitUtil.toFloat(percent) / 100 : null;
|
|
348
350
|
|
|
@@ -379,24 +381,24 @@
|
|
|
379
381
|
return result;
|
|
380
382
|
}
|
|
381
383
|
|
|
382
|
-
function
|
|
383
|
-
const index = uikitUtil.findIndex(
|
|
384
|
+
function getStep(steps, percent) {
|
|
385
|
+
const index = uikitUtil.findIndex(steps.slice(1), (_ref3) => {let [, targetPercent] = _ref3;return percent <= targetPercent;}) + 1;
|
|
384
386
|
return [
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
(percent -
|
|
387
|
+
steps[index - 1][0],
|
|
388
|
+
steps[index][0],
|
|
389
|
+
(percent - steps[index - 1][1]) / (steps[index][1] - steps[index - 1][1])];
|
|
388
390
|
|
|
389
391
|
}
|
|
390
392
|
|
|
391
|
-
function getValue(
|
|
392
|
-
const [start, end, p] =
|
|
393
|
+
function getValue(steps, percent) {
|
|
394
|
+
const [start, end, p] = getStep(steps, percent);
|
|
393
395
|
return uikitUtil.isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
|
|
394
396
|
}
|
|
395
397
|
|
|
396
398
|
const unitRe = /^-?\d+([^\s]*)/;
|
|
397
|
-
function getUnit(
|
|
398
|
-
for (const
|
|
399
|
-
const match =
|
|
399
|
+
function getUnit(steps, defaultUnit) {
|
|
400
|
+
for (const step of steps) {
|
|
401
|
+
const match = step.match == null ? void 0 : step.match(unitRe);
|
|
400
402
|
if (match) {
|
|
401
403
|
return match[1];
|
|
402
404
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.
|
|
1
|
+
/*! UIkit 3.14.1-dev.dadc910c0 | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(r,g){typeof exports=="object"&&typeof module<"u"?module.exports=g(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslider_parallax",["uikit-util"],g):(r=typeof globalThis<"u"?globalThis:r||self,r.UIkitSlider_parallax=g(r.UIkit.util))})(this,function(r){"use strict";var g={props:{media:Boolean},data:{media:!1},connected(){const n=V(this.media);if(this.matchMedia=!0,n){this.mediaObj=window.matchMedia(n);const t=()=>{this.matchMedia=this.mediaObj.matches,r.trigger(this.$el,r.createEvent("mediachange",!1,!0,[this.mediaObj]))};this.offMediaObj=r.on(this.mediaObj,"change",()=>{t(),this.$emit("resize")}),t()}},disconnected(){var n;(n=this.offMediaObj)==null||n.call(this)}};function V(n){if(r.isString(n)){if(r.startsWith(n,"@")){const t="breakpoint-"+n.substr(1);n=r.toFloat(r.getCssVar(t))}else if(isNaN(n))return n}return n&&r.isNumeric(n)?"(min-width: "+n+"px)":""}r.memoize(async n=>n?r.startsWith(n,"data:")?decodeURIComponent(n.split(",")[1]):(await fetch(n)).text():Promise.reject());function _(n){return Math.ceil(Math.max(0,...r.$$("[stroke]",n).map(t=>{try{return t.getTotalLength()}catch{return 0}})))}const w={x:F,y:F,rotate:F,scale:F,color:P,backgroundColor:P,borderColor:P,blur:m,hue:m,fopacity:m,grayscale:m,invert:m,saturate:m,sepia:m,opacity:L,stroke:A,bgx:O,bgy:O},{keys:M}=Object;var q={mixins:[g],props:W(M(w),"list"),data:W(M(w),void 0),computed:{props(n,t){return M(w).reduce((e,o)=>(r.isUndefined(n[o])||(e[o]=w[o](o,t,n[o].slice())),e),{})}},events:{load(){this.$emit()}},methods:{reset(){for(const n in this.getCss(0))r.css(this.$el,n,"")},getCss(n){const t={transform:"",filter:""};for(const e in this.props)this.props[e](t,n);return t}}};function F(n,t,e){let o=I(e)||{x:"px",y:"px",rotate:"deg"}[n]||"",a;return n==="x"||n==="y"?(n="translate"+r.ucfirst(n),a=s=>r.toFloat(r.toFloat(s).toFixed(o==="px"?0:6))):n==="scale"&&(o="",a=s=>I([s])?r.toPx(s,"width",t,!0)/t.offsetWidth:s),e.length===1&&e.unshift(n==="scale"?1:0),e=l(e,a),(s,c)=>{s.transform+=" "+n+"("+x(e,c)+o+")"}}function P(n,t,e){return e.length===1&&e.unshift(b(t,n,"")),e=l(e,o=>H(t,o)),(o,a)=>{const[s,c,i]=S(e,a),h=s.map((d,f)=>(d+=i*(c[f]-d),f===3?r.toFloat(d):parseInt(d,10))).join(",");o[n]="rgba("+h+")"}}function H(n,t){return b(n,"color",t).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(r.toFloat)}function m(n,t,e){e.length===1&&e.unshift(0);const o=I(e)||{blur:"px",hue:"deg"}[n]||"%";return n={fopacity:"opacity",hue:"hue-rotate"}[n]||n,e=l(e),(a,s)=>{const c=x(e,s);a.filter+=" "+n+"("+(c+o)+")"}}function L(n,t,e){return e.length===1&&e.unshift(b(t,n,"")),e=l(e),(o,a)=>{o[n]=x(e,a)}}function A(n,t,e){e.length===1&&e.unshift(0);const o=I(e),a=_(t);return e=l(e.reverse(),s=>(s=r.toFloat(s),o==="%"?s*a/100:s)),e.some(s=>{let[c]=s;return c})?(r.css(t,"strokeDasharray",a),(s,c)=>{s.strokeDashoffset=x(e,c)}):r.noop}function O(n,t,e){e.length===1&&e.unshift(0),n=n.substr(-1);const o=n==="y"?"height":"width";e=l(e,s=>r.toPx(s,o,t));const a=b(t,"background-position-"+n,"");return b(t,"backgroundSize","")==="cover"?G(n,t,e,a,o):D(n,e,a)}function G(n,t,e,o,a){const s=J(t);if(!s.width)return r.noop;const c=e.map(u=>{let[j]=u;return j}),i=Math.min(...c),h=Math.max(...c),d=c.indexOf(i)<c.indexOf(h),f=h-i;let B=(d?-f:0)-(d?i:h);const y={width:t.offsetWidth,height:t.offsetHeight},E=r.Dimensions.cover(s,y),v=E[a]-y[a];if(v<f)y[a]=E[a]+f-v;else if(v>f){const u=y[a]/r.toPx(o,a,t,!0);u&&(B-=(v-f)/u)}const R=r.Dimensions.cover(s,y),Q=D(n,e,B+"px");return(u,j)=>{Q(u,j),u.backgroundSize=R.width+"px "+R.height+"px",u.backgroundRepeat="no-repeat"}}function D(n,t,e){return function(o,a){o["background-position-"+n]="calc("+e+" + "+x(t,a)+"px)"}}const C={};function J(n){const t=r.css(n,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(C[t])return C[t];const e=new Image;return t&&(e.src=t,!e.naturalWidth)?(e.onload=()=>{C[t]=$(e),r.trigger(n,r.createEvent("load",!1))},$(e)):C[t]=$(e)}function $(n){return{width:n.naturalWidth,height:n.naturalHeight}}function l(n,t){t===void 0&&(t=r.toFloat);const e=[],{length:o}=n;let a=0;for(let s=0;s<o;s++){let[c,i]=r.isString(n[s])?n[s].trim().split(" "):[n[s]];if(c=t(c),i=i?r.toFloat(i)/100:null,s===0?i===null?i=0:i&&e.push([c,0]):s===o-1&&(i===null?i=1:i!==1&&(e.push([c,i]),i=1)),e.push([c,i]),i===null)a++;else if(a){const h=e[s-a-1][1],d=(i-h)/(a+1);for(let f=a;f>0;f--)e[s-f][1]=h+d*(a-f+1);a=0}}return e}function S(n,t){const e=r.findIndex(n.slice(1),o=>{let[,a]=o;return t<=a})+1;return[n[e-1][0],n[e][0],(t-n[e-1][1])/(n[e][1]-n[e-1][1])]}function x(n,t){const[e,o,a]=S(n,t);return r.isNumber(e)?e+Math.abs(e-o)*a*(e<o?1:-1):+o}const K=/^-?\d+([^\s]*)/;function I(n,t){for(const e of n){const o=e.match==null?void 0:e.match(K);if(o)return o[1]}return t}function b(n,t,e){const o=n.style[t],a=r.css(r.css(n,t,e),t);return n.style[t]=o,a}function W(n,t){return n.reduce((e,o)=>(e[o]=t,e),{})}var T={mixins:[q],data:{selItem:"!li"},beforeConnect(){this.item=r.query(this.selItem,this.$el)},disconnected(){this.item=null},events:[{name:"itemin itemout",self:!0,el(){return this.item},handler(n){let{type:t,detail:{percent:e,duration:o,timing:a,dir:s}}=n;r.fastdom.read(()=>{const c=this.getCss(N(t,s,e)),i=this.getCss(z(t)?.5:s>0?1:0);r.fastdom.write(()=>{r.css(this.$el,c),r.Transition.start(this.$el,i,o,a).catch(r.noop)})})}},{name:"transitioncanceled transitionend",self:!0,el(){return this.item},handler(){r.Transition.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el(){return this.item},handler(n){let{type:t,detail:{percent:e,dir:o}}=n;r.fastdom.read(()=>{const a=this.getCss(N(t,o,e));r.fastdom.write(()=>r.css(this.$el,a))})}}]};function z(n){return r.endsWith(n,"in")}function N(n,t,e){return e/=2,z(n)^t<0?e:1-e}return typeof window<"u"&&window.UIkit&&window.UIkit.component("sliderParallax",T),T});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.
|
|
1
|
+
/*! UIkit 3.14.1-dev.dadc910c0 | 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')) :
|
|
@@ -832,7 +832,7 @@
|
|
|
832
832
|
let left = 0;
|
|
833
833
|
const sets = [];
|
|
834
834
|
const width = uikitUtil.dimensions(this.list).width;
|
|
835
|
-
for (let i
|
|
835
|
+
for (let i = 0; i < this.slides.length; i++) {
|
|
836
836
|
const slideWidth = uikitUtil.dimensions(this.slides[i]).width;
|
|
837
837
|
|
|
838
838
|
if (left + slideWidth > width) {
|