uikit 3.11.2-dev.7dd548556 → 3.11.2-dev.93483bd3e
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 +32 -18
- package/dist/css/uikit-core-rtl.css +80 -186
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +80 -186
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +82 -192
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +82 -192
- package/dist/css/uikit.min.css +1 -1
- package/dist/js/components/countdown.js +3 -3
- package/dist/js/components/countdown.min.js +1 -1
- package/dist/js/components/filter.js +6 -8
- package/dist/js/components/filter.min.js +1 -1
- package/dist/js/components/lightbox-panel.js +31 -60
- package/dist/js/components/lightbox-panel.min.js +1 -1
- package/dist/js/components/lightbox.js +34 -64
- 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 +108 -72
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +108 -72
- package/dist/js/components/slider-parallax.min.js +1 -1
- package/dist/js/components/slider.js +75 -28
- package/dist/js/components/slider.min.js +1 -1
- package/dist/js/components/slideshow-parallax.js +108 -72
- package/dist/js/components/slideshow-parallax.min.js +1 -1
- package/dist/js/components/slideshow.js +57 -21
- package/dist/js/components/slideshow.min.js +1 -1
- package/dist/js/components/sortable.js +12 -14
- package/dist/js/components/sortable.min.js +1 -1
- package/dist/js/components/tooltip.js +2 -2
- package/dist/js/components/tooltip.min.js +1 -1
- package/dist/js/components/upload.js +4 -4
- package/dist/js/components/upload.min.js +1 -1
- package/dist/js/uikit-core.js +271 -287
- 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 +507 -458
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/api/component.js +2 -11
- package/src/js/api/hooks.js +1 -1
- package/src/js/api/state.js +3 -3
- package/src/js/components/countdown.js +2 -2
- package/src/js/components/filter.js +2 -3
- package/src/js/components/internal/lightbox-animations.js +4 -3
- package/src/js/components/internal/slider-preload.js +37 -0
- package/src/js/components/internal/slider-transitioner.js +2 -2
- package/src/js/components/internal/slideshow-animations.js +4 -3
- package/src/js/components/lightbox-panel.js +34 -58
- package/src/js/components/lightbox.js +3 -4
- package/src/js/components/slider.js +30 -11
- package/src/js/components/slideshow.js +8 -1
- package/src/js/components/sortable.js +8 -8
- package/src/js/components/upload.js +3 -3
- package/src/js/core/accordion.js +3 -3
- package/src/js/core/alert.js +1 -2
- package/src/js/core/height-match.js +3 -3
- package/src/js/core/img.js +132 -115
- package/src/js/core/modal.js +1 -2
- package/src/js/core/navbar.js +5 -5
- package/src/js/core/scrollspy.js +6 -6
- package/src/js/core/sticky.js +1 -1
- package/src/js/core/svg.js +10 -6
- package/src/js/core/toggle.js +4 -3
- package/src/js/mixin/internal/animate-slide.js +9 -12
- package/src/js/mixin/parallax.js +108 -72
- package/src/js/mixin/slider-drag.js +3 -3
- package/src/js/mixin/slider-nav.js +2 -2
- package/src/js/mixin/slider.js +8 -16
- package/src/js/mixin/slideshow.js +2 -2
- package/src/js/mixin/togglable.js +1 -2
- package/src/js/util/ajax.js +9 -12
- package/src/js/util/animation.js +7 -12
- package/src/js/util/attr.js +11 -9
- package/src/js/util/dom.js +27 -45
- package/src/js/util/lang.js +7 -6
- package/src/js/util/options.js +2 -11
- package/src/js/util/player.js +5 -4
- package/src/js/util/position.js +2 -2
- package/src/js/util/selector.js +12 -18
- package/src/js/util/style.js +4 -4
- package/src/less/components/base.less +10 -33
- package/src/less/components/form-range.less +52 -97
- package/src/less/components/form.less +0 -1
- package/src/less/components/leader.less +0 -1
- 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 -33
- package/src/scss/components/form-range.scss +52 -97
- package/src/scss/components/form.scss +0 -1
- package/src/scss/components/leader.scss +0 -1
- 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 +14 -5
- 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 +47 -62
- 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/src/js/util/promise.js +0 -0
- package/tests/images/animated.gif +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.93483bd3e | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(a,m){typeof exports=="object"&&typeof module<"u"?module.exports=m(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitparallax",["uikit-util"],m):(a=typeof globalThis<"u"?globalThis:a||self,a.UIkitParallax=m(a.UIkit.util))})(this,function(a){"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(a.isString(e)){if(e[0]==="@"){const t="breakpoint-"+e.substr(1);e=a.toFloat(a.getCssVar(t))}else if(isNaN(e))return e}return e&&!isNaN(e)?"(min-width: "+e+"px)":!1}a.memoize(async e=>e?a.startsWith(e,"data:")?decodeURIComponent(e.split(",")[1]):(await fetch(e)).text():Promise.reject());function V(e){return Math.ceil(Math.max(0,...a.$$("[stroke]",e).map(t=>{try{return t.getTotalLength()}catch{return 0}})))}const y={x:v,y:v,rotate:v,scale:v,color:P,backgroundColor:P,borderColor:P,blur:d,hue:d,fopacity:d,grayscale:d,invert:d,saturate:d,sepia:d,opacity:L,stroke:_,bgx:D,bgy:D},{keys:F}=Object;var q={mixins:[m],props:$(F(y),"list"),data:$(F(y),void 0),computed:{props(e,t){return F(y).reduce((n,o)=>(a.isUndefined(e[o])||(n[o]=y[o](o,t,e[o].slice())),n),{})}},events:{bgimageload(){this.$emit()}},methods:{reset(){a.each(this.getCss(0),(e,t)=>a.css(this.$el,t,""))},getCss(e){return F(this.props).reduce((t,n)=>(this.props[n](t,e),t),{transform:"",filter:""})}}};function v(e,t,n){const o=C(n)||{x:"px",y:"px",rotate:"deg"}[e]||"";let r;return(e==="x"||e==="y")&&(e="translate"+a.ucfirst(e),r=c=>a.toFloat(a.toFloat(c).toFixed(o==="px"?0:6))),n.length===1&&n.unshift(e==="scale"?1:0),n=l(n,r),(c,s)=>{c.transform+=" "+e+"("+x(n,s)+o+")"}}function P(e,t,n){return n.length===1&&n.unshift(b(t,e,"")),n=l(n,o=>H(t,o)),(o,r)=>{const[c,s,i]=O(n,r),h=c.map((g,f)=>(g+=i*(s[f]-g),f===3?a.toFloat(g):parseInt(g,10))).join(",");o[e]="rgba("+h+")"}}function H(e,t){return b(e,"color",t).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(a.toFloat)}function d(e,t,n){n.length===1&&n.unshift(0);const o=C(n)||{blur:"px",hue:"deg"}[e]||"%";return e={fopacity:"opacity",hue:"hue-rotate"}[e]||e,n=l(n),(r,c)=>{const s=x(n,c);r.filter+=" "+e+"("+(s+o)+")"}}function L(e,t,n){return n.length===1&&n.unshift(b(t,e,"")),n=l(n),(o,r)=>{o[e]=x(n,r)}}function _(e,t,n){n.length===1&&n.unshift(0);const o=C(n),r=V(t);return n=l(n.reverse(),c=>(c=a.toFloat(c),o==="%"?c*r/100:c)),n.some(c=>{let[s]=c;return s})?(a.css(t,"strokeDasharray",r),(c,s)=>{c.strokeDashoffset=x(n,s)}):a.noop}function D(e,t,n){n.length===1&&n.unshift(0),e=e.substr(-1);const o=e==="y"?"height":"width";n=l(n,c=>a.toPx(c,o,t));const r=b(t,"background-position-"+e,"");return b(t,"backgroundSize","")==="cover"?A(e,t,n,r,o):N(e,n,r)}function A(e,t,n,o,r){const c=G(t);if(!c.width)return a.noop;const s=n.map(u=>{let[S]=u;return S}),i=Math.min(...s),h=Math.max(...s),g=s.indexOf(i)<s.indexOf(h),f=h-i;let W=(g?-f:0)-(g?i:h);const w={width:t.offsetWidth,height:t.offsetHeight},B=a.Dimensions.cover(c,w),I=B[r]-w[r];if(I<f)w[r]=B[r]+f-I;else if(I>f){const u=w[r]/a.toPx(o,r,t,!0);u&&(W-=(I-f)/u)}const E=a.Dimensions.cover(c,w),Q=N(e,n,W+"px");return(u,S)=>{Q(u,S),u.backgroundSize=E.width+"px "+E.height+"px",u.backgroundRepeat="no-repeat"}}function N(e,t,n){return function(o,r){o["background-position-"+e]="calc("+n+" + "+x(t,r)+"px)"}}const M={};function G(e){const t=a.css(e,"backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/,"$1");if(M[t])return M[t];const n=new Image;return t&&(n.src=t,n.naturalWidth||(n.onload=()=>{M[t]=j(n),a.trigger(e,"bgimageload")})),M[t]=j(n)}function j(e){return{width:e.naturalWidth,height:e.naturalHeight}}function l(e,t){t===void 0&&(t=a.toFloat);const n=[],{length:o}=e;for(let r=0;r<o;r++){let[c,s]=a.isString(e[r])?e[r].trim().split(" "):[e[r]];c=t(c),s=s?a.toFloat(s)/100:null,r===0?s===null?s=0:s&&n.push([c,0]):r===o-1&&(s===null?s=1:s!==1&&(n.push([c,s]),s=1)),n.push([c,s])}for(let r=1;r<n.length-1;r++)if(n[r][1]===null){const c=a.findIndex(n.slice(r+1),i=>{let[,h]=i;return h!==null})+1,s=(n[r+c][1]-n[r-1][1])/(c+1);for(let i=0;i<c;i++)n[r+i][1]=n[r-1][1]+s*(i+1);r+=c}return n}function O(e,t){const n=a.findIndex(e.slice(1),o=>{let[,r]=o;return t<=r})+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,o,r]=O(e,t);return a.isNumber(n)?n+Math.abs(n-o)*r*(n<o?1:-1):+o}const J=/^[\d-]+([^\s]+)/;function C(e,t){for(const n of e){const o=n.match==null?void 0:n.match(J);if(o)return o[1]}return t}function b(e,t,n){const o=e.style[t],r=a.css(a.css(e,t,n),t);return e.style[t]=o,r}function $(e,t){return e.reduce((n,o)=>(n[o]=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&&a.query(n,t)||t)},start(e){let{start:t}=e;return a.toPx(t,"height",this.target,!0)},end(e){let{end:t,viewport:n}=e;return a.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(a.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&&a.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(a.parent(e)):document.documentElement}return typeof window<"u"&&window.UIkit&&window.UIkit.component("parallax",z),z});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.93483bd3e | 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')) :
|
|
@@ -127,39 +127,35 @@
|
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
|
|
130
|
-
function transformFn(prop, el,
|
|
131
|
-
const unit = getUnit(
|
|
130
|
+
function transformFn(prop, el, stops) {
|
|
131
|
+
const unit = getUnit(stops) || { x: 'px', y: 'px', rotate: 'deg' }[prop] || '';
|
|
132
|
+
let transformFn;
|
|
132
133
|
|
|
133
134
|
if (prop === 'x' || prop === 'y') {
|
|
134
135
|
prop = "translate" + uikitUtil.ucfirst(prop);
|
|
136
|
+
transformFn = (stop) => uikitUtil.toFloat(uikitUtil.toFloat(stop).toFixed(unit === 'px' ? 0 : 6));
|
|
135
137
|
}
|
|
136
138
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (steps.length === 1) {
|
|
140
|
-
steps.unshift(prop === 'scale' ? 1 : 0);
|
|
139
|
+
if (stops.length === 1) {
|
|
140
|
+
stops.unshift(prop === 'scale' ? 1 : 0);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
|
|
144
|
-
let value = getValue(steps, percent);
|
|
145
|
-
|
|
146
|
-
if (uikitUtil.startsWith(prop, 'translate')) {
|
|
147
|
-
value = uikitUtil.toFloat(value).toFixed(unit === 'px' ? 0 : 6);
|
|
148
|
-
}
|
|
143
|
+
stops = parseStops(stops, transformFn);
|
|
149
144
|
|
|
150
|
-
|
|
145
|
+
return (css, percent) => {
|
|
146
|
+
css.transform += " " + prop + "(" + getValue(stops, percent) + unit + ")";
|
|
151
147
|
};
|
|
152
148
|
}
|
|
153
149
|
|
|
154
|
-
function colorFn(prop, el,
|
|
155
|
-
if (
|
|
156
|
-
|
|
150
|
+
function colorFn(prop, el, stops) {
|
|
151
|
+
if (stops.length === 1) {
|
|
152
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
157
153
|
}
|
|
158
154
|
|
|
159
|
-
|
|
155
|
+
stops = parseStops(stops, (stop) => parseColor(el, stop));
|
|
160
156
|
|
|
161
157
|
return (css, percent) => {
|
|
162
|
-
const [start, end, p] =
|
|
158
|
+
const [start, end, p] = getStop(stops, percent);
|
|
163
159
|
const value = start.
|
|
164
160
|
map((value, i) => {
|
|
165
161
|
value += p * (end[i] - value);
|
|
@@ -179,85 +175,83 @@
|
|
|
179
175
|
map(uikitUtil.toFloat);
|
|
180
176
|
}
|
|
181
177
|
|
|
182
|
-
function filterFn(prop, el,
|
|
183
|
-
if (
|
|
184
|
-
|
|
178
|
+
function filterFn(prop, el, stops) {
|
|
179
|
+
if (stops.length === 1) {
|
|
180
|
+
stops.unshift(0);
|
|
185
181
|
}
|
|
186
182
|
|
|
187
|
-
const unit = getUnit(
|
|
183
|
+
const unit = getUnit(stops) || { blur: 'px', hue: 'deg' }[prop] || '%';
|
|
188
184
|
prop = { fopacity: 'opacity', hue: 'hue-rotate' }[prop] || prop;
|
|
189
|
-
|
|
185
|
+
stops = parseStops(stops);
|
|
190
186
|
|
|
191
187
|
return (css, percent) => {
|
|
192
|
-
const value = getValue(
|
|
188
|
+
const value = getValue(stops, percent);
|
|
193
189
|
css.filter += " " + prop + "(" + (value + unit) + ")";
|
|
194
190
|
};
|
|
195
191
|
}
|
|
196
192
|
|
|
197
|
-
function cssPropFn(prop, el,
|
|
198
|
-
if (
|
|
199
|
-
|
|
193
|
+
function cssPropFn(prop, el, stops) {
|
|
194
|
+
if (stops.length === 1) {
|
|
195
|
+
stops.unshift(getCssValue(el, prop, ''));
|
|
200
196
|
}
|
|
201
197
|
|
|
202
|
-
|
|
198
|
+
stops = parseStops(stops);
|
|
203
199
|
|
|
204
200
|
return (css, percent) => {
|
|
205
|
-
css[prop] = getValue(
|
|
201
|
+
css[prop] = getValue(stops, percent);
|
|
206
202
|
};
|
|
207
203
|
}
|
|
208
204
|
|
|
209
|
-
function strokeFn(prop, el,
|
|
210
|
-
if (
|
|
211
|
-
|
|
205
|
+
function strokeFn(prop, el, stops) {
|
|
206
|
+
if (stops.length === 1) {
|
|
207
|
+
stops.unshift(0);
|
|
212
208
|
}
|
|
213
209
|
|
|
214
|
-
const unit = getUnit(
|
|
215
|
-
|
|
210
|
+
const unit = getUnit(stops);
|
|
211
|
+
const length = getMaxPathLength(el);
|
|
212
|
+
stops = parseStops(stops.reverse(), (stop) => {
|
|
213
|
+
stop = uikitUtil.toFloat(stop);
|
|
214
|
+
return unit === '%' ? stop * length / 100 : stop;
|
|
215
|
+
});
|
|
216
216
|
|
|
217
|
-
if (!
|
|
217
|
+
if (!stops.some((_ref) => {let [value] = _ref;return value;})) {
|
|
218
218
|
return uikitUtil.noop;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
const length = getMaxPathLength(el);
|
|
222
221
|
uikitUtil.css(el, 'strokeDasharray', length);
|
|
223
222
|
|
|
224
|
-
if (unit === '%') {
|
|
225
|
-
steps = steps.map((step) => step * length / 100);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
steps = steps.reverse();
|
|
229
|
-
|
|
230
223
|
return (css, percent) => {
|
|
231
|
-
css.strokeDashoffset = getValue(
|
|
224
|
+
css.strokeDashoffset = getValue(stops, percent);
|
|
232
225
|
};
|
|
233
226
|
}
|
|
234
227
|
|
|
235
|
-
function backgroundFn(prop, el,
|
|
236
|
-
if (
|
|
237
|
-
|
|
228
|
+
function backgroundFn(prop, el, stops) {
|
|
229
|
+
if (stops.length === 1) {
|
|
230
|
+
stops.unshift(0);
|
|
238
231
|
}
|
|
239
232
|
|
|
240
233
|
prop = prop.substr(-1);
|
|
241
234
|
const attr = prop === 'y' ? 'height' : 'width';
|
|
242
|
-
|
|
235
|
+
stops = parseStops(stops, (stop) => uikitUtil.toPx(stop, attr, el));
|
|
243
236
|
|
|
244
237
|
const bgPos = getCssValue(el, "background-position-" + prop, '');
|
|
245
238
|
|
|
246
239
|
return getCssValue(el, 'backgroundSize', '') === 'cover' ?
|
|
247
|
-
backgroundCoverFn(prop, el,
|
|
248
|
-
setBackgroundPosFn(prop,
|
|
240
|
+
backgroundCoverFn(prop, el, stops, bgPos, attr) :
|
|
241
|
+
setBackgroundPosFn(prop, stops, bgPos);
|
|
249
242
|
}
|
|
250
243
|
|
|
251
|
-
function backgroundCoverFn(prop, el,
|
|
244
|
+
function backgroundCoverFn(prop, el, stops, bgPos, attr) {
|
|
252
245
|
const dimImage = getBackgroundImageDimensions(el);
|
|
253
246
|
|
|
254
247
|
if (!dimImage.width) {
|
|
255
248
|
return uikitUtil.noop;
|
|
256
249
|
}
|
|
257
250
|
|
|
258
|
-
const
|
|
259
|
-
const
|
|
260
|
-
const
|
|
251
|
+
const values = stops.map((_ref2) => {let [value] = _ref2;return value;});
|
|
252
|
+
const min = Math.min(...values);
|
|
253
|
+
const max = Math.max(...values);
|
|
254
|
+
const down = values.indexOf(min) < values.indexOf(max);
|
|
261
255
|
|
|
262
256
|
const diff = max - min;
|
|
263
257
|
let pos = (down ? -diff : 0) - (down ? min : max);
|
|
@@ -282,7 +276,7 @@
|
|
|
282
276
|
|
|
283
277
|
const dim = uikitUtil.Dimensions.cover(dimImage, dimEl);
|
|
284
278
|
|
|
285
|
-
const fn = setBackgroundPosFn(prop,
|
|
279
|
+
const fn = setBackgroundPosFn(prop, stops, pos + "px");
|
|
286
280
|
return (css, percent) => {
|
|
287
281
|
fn(css, percent);
|
|
288
282
|
css.backgroundSize = dim.width + "px " + dim.height + "px";
|
|
@@ -290,9 +284,9 @@
|
|
|
290
284
|
};
|
|
291
285
|
}
|
|
292
286
|
|
|
293
|
-
function setBackgroundPosFn(prop,
|
|
287
|
+
function setBackgroundPosFn(prop, stops, pos) {
|
|
294
288
|
return function (css, percent) {
|
|
295
|
-
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(
|
|
289
|
+
css["background-position-" + prop] = "calc(" + pos + " + " + getValue(stops, percent) + "px)";
|
|
296
290
|
};
|
|
297
291
|
}
|
|
298
292
|
|
|
@@ -326,27 +320,69 @@
|
|
|
326
320
|
|
|
327
321
|
}
|
|
328
322
|
|
|
329
|
-
function
|
|
330
|
-
const
|
|
331
|
-
const
|
|
323
|
+
function parseStops(stops, fn) {if (fn === void 0) {fn = uikitUtil.toFloat;}
|
|
324
|
+
const result = [];
|
|
325
|
+
const { length } = stops;
|
|
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
|
+
|
|
349
|
+
for (let i = 1; i < result.length - 1; i++) {
|
|
350
|
+
if (result[i][1] === null) {
|
|
351
|
+
const nextIndex = uikitUtil.findIndex(result.slice(i + 1), (_ref3) => {let [, percent] = _ref3;return percent !== null;}) + 1;
|
|
352
|
+
const percent = (result[i + nextIndex][1] - result[i - 1][1]) / (nextIndex + 1);
|
|
353
|
+
for (let j = 0; j < nextIndex; j++) {
|
|
354
|
+
result[i + j][1] = result[i - 1][1] + percent * (j + 1);
|
|
355
|
+
}
|
|
356
|
+
i += nextIndex;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
return result;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
function getStop(stops, percent) {
|
|
364
|
+
const index = uikitUtil.findIndex(stops.slice(1), (_ref4) => {let [, targetPercent] = _ref4;return percent <= targetPercent;}) + 1;
|
|
365
|
+
return [
|
|
366
|
+
stops[index - 1][0],
|
|
367
|
+
stops[index][0],
|
|
368
|
+
(percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])];
|
|
332
369
|
|
|
333
|
-
return steps.
|
|
334
|
-
slice(index, index + 2).
|
|
335
|
-
concat(percent === 1 ? 1 : percent % (1 / count) * count);
|
|
336
370
|
}
|
|
337
371
|
|
|
338
|
-
function getValue(
|
|
339
|
-
const [start, end, p] =
|
|
372
|
+
function getValue(stops, percent) {
|
|
373
|
+
const [start, end, p] = getStop(stops, percent);
|
|
340
374
|
return uikitUtil.isNumber(start) ? start + Math.abs(start - end) * p * (start < end ? 1 : -1) : +end;
|
|
341
375
|
}
|
|
342
376
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
377
|
+
const unitRe = /^[\d-]+([^\s]+)/;
|
|
378
|
+
function getUnit(stops, defaultUnit) {
|
|
379
|
+
for (const stop of stops) {
|
|
380
|
+
const match = stop.match == null ? void 0 : stop.match(unitRe);
|
|
381
|
+
if (match) {
|
|
382
|
+
return match[1];
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return defaultUnit;
|
|
350
386
|
}
|
|
351
387
|
|
|
352
388
|
function getCssValue(el, prop, value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.93483bd3e | https://www.getuikit.com | (c) 2014 - 2022 YOOtheme | MIT License */(function(o,g){typeof exports=="object"&&typeof module<"u"?module.exports=g(require("uikit-util")):typeof define=="function"&&define.amd?define("uikitslider_parallax",["uikit-util"],g):(o=typeof globalThis<"u"?globalThis:o||self,o.UIkitSlider_parallax=g(o.UIkit.util))})(this,function(o){"use strict";var g={props:{media:Boolean},data:{media:!1},computed:{matchMedia(){const n=_(this.media);return!n||window.matchMedia(n).matches}}};function _(n){if(o.isString(n)){if(n[0]==="@"){const t="breakpoint-"+n.substr(1);n=o.toFloat(o.getCssVar(t))}else if(isNaN(n))return n}return n&&!isNaN(n)?"(min-width: "+n+"px)":!1}o.memoize(async n=>n?o.startsWith(n,"data:")?decodeURIComponent(n.split(",")[1]):(await fetch(n)).text():Promise.reject());function q(n){return Math.ceil(Math.max(0,...o.$$("[stroke]",n).map(t=>{try{return t.getTotalLength()}catch{return 0}})))}const w={x:I,y:I,rotate:I,scale:I,color:v,backgroundColor:v,borderColor:v,blur:u,hue:u,fopacity:u,grayscale:u,invert:u,saturate:u,sepia:u,opacity:E,stroke:A,bgx:D,bgy:D},{keys:F}=Object;var H={mixins:[g],props:N(F(w),"list"),data:N(F(w),void 0),computed:{props(n,t){return F(w).reduce((e,a)=>(o.isUndefined(n[a])||(e[a]=w[a](a,t,n[a].slice())),e),{})}},events:{bgimageload(){this.$emit()}},methods:{reset(){o.each(this.getCss(0),(n,t)=>o.css(this.$el,t,""))},getCss(n){return F(this.props).reduce((t,e)=>(this.props[e](t,n),t),{transform:"",filter:""})}}};function I(n,t,e){const a=M(e)||{x:"px",y:"px",rotate:"deg"}[n]||"";let r;return(n==="x"||n==="y")&&(n="translate"+o.ucfirst(n),r=s=>o.toFloat(o.toFloat(s).toFixed(a==="px"?0:6))),e.length===1&&e.unshift(n==="scale"?1:0),e=l(e,r),(s,c)=>{s.transform+=" "+n+"("+x(e,c)+a+")"}}function v(n,t,e){return e.length===1&&e.unshift(b(t,n,"")),e=l(e,a=>L(t,a)),(a,r)=>{const[s,c,i]=T(e,r),h=s.map((m,f)=>(m+=i*(c[f]-m),f===3?o.toFloat(m):parseInt(m,10))).join(",");a[n]="rgba("+h+")"}}function L(n,t){return b(n,"color",t).split(/[(),]/g).slice(1,-1).concat(1).slice(0,4).map(o.toFloat)}function u(n,t,e){e.length===1&&e.unshift(0);const a=M(e)||{blur:"px",hue:"deg"}[n]||"%";return n={fopacity:"opacity",hue:"hue-rotate"}[n]||n,e=l(e),(r,s)=>{const c=x(e,s);r.filter+=" "+n+"("+(c+a)+")"}}function E(n,t,e){return e.length===1&&e.unshift(b(t,n,"")),e=l(e),(a,r)=>{a[n]=x(e,r)}}function A(n,t,e){e.length===1&&e.unshift(0);const a=M(e),r=q(t);return e=l(e.reverse(),s=>(s=o.toFloat(s),a==="%"?s*r/100:s)),e.some(s=>{let[c]=s;return c})?(o.css(t,"strokeDasharray",r),(s,c)=>{s.strokeDashoffset=x(e,c)}):o.noop}function D(n,t,e){e.length===1&&e.unshift(0),n=n.substr(-1);const a=n==="y"?"height":"width";e=l(e,s=>o.toPx(s,a,t));const r=b(t,"background-position-"+n,"");return b(t,"backgroundSize","")==="cover"?G(n,t,e,r,a):S(n,e,r)}function G(n,t,e,a,r){const s=J(t);if(!s.width)return o.noop;const c=e.map(d=>{let[$]=d;return $}),i=Math.min(...c),h=Math.max(...c),m=c.indexOf(i)<c.indexOf(h),f=h-i;let B=(m?-f:0)-(m?i:h);const y={width:t.offsetWidth,height:t.offsetHeight},R=o.Dimensions.cover(s,y),P=R[r]-y[r];if(P<f)y[r]=R[r]+f-P;else if(P>f){const d=y[r]/o.toPx(a,r,t,!0);d&&(B-=(P-f)/d)}const V=o.Dimensions.cover(s,y),Q=S(n,e,B+"px");return(d,$)=>{Q(d,$),d.backgroundSize=V.width+"px "+V.height+"px",d.backgroundRepeat="no-repeat"}}function S(n,t,e){return function(a,r){a["background-position-"+n]="calc("+e+" + "+x(t,r)+"px)"}}const C={};function J(n){const t=o.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]=j(e),o.trigger(n,"bgimageload")})),C[t]=j(e)}function j(n){return{width:n.naturalWidth,height:n.naturalHeight}}function l(n,t){t===void 0&&(t=o.toFloat);const e=[],{length:a}=n;for(let r=0;r<a;r++){let[s,c]=o.isString(n[r])?n[r].trim().split(" "):[n[r]];s=t(s),c=c?o.toFloat(c)/100:null,r===0?c===null?c=0:c&&e.push([s,0]):r===a-1&&(c===null?c=1:c!==1&&(e.push([s,c]),c=1)),e.push([s,c])}for(let r=1;r<e.length-1;r++)if(e[r][1]===null){const s=o.findIndex(e.slice(r+1),i=>{let[,h]=i;return h!==null})+1,c=(e[r+s][1]-e[r-1][1])/(s+1);for(let i=0;i<s;i++)e[r+i][1]=e[r-1][1]+c*(i+1);r+=s}return e}function T(n,t){const e=o.findIndex(n.slice(1),a=>{let[,r]=a;return t<=r})+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,a,r]=T(n,t);return o.isNumber(e)?e+Math.abs(e-a)*r*(e<a?1:-1):+a}const K=/^[\d-]+([^\s]+)/;function M(n,t){for(const e of n){const a=e.match==null?void 0:e.match(K);if(a)return a[1]}return t}function b(n,t,e){const a=n.style[t],r=o.css(o.css(n,t,e),t);return n.style[t]=a,r}function N(n,t){return n.reduce((e,a)=>(e[a]=t,e),{})}var W={mixins:[H],data:{selItem:"!li"},computed:{item(n,t){let{selItem:e}=n;return o.query(e,t)}},events:[{name:"itemin itemout",self:!0,el(){return this.item},handler(n){let{type:t,detail:{percent:e,duration:a,timing:r,dir:s}}=n;o.fastdom.read(()=>{const c=this.getCss(z(t,s,e)),i=this.getCss(O(t)?.5:s>0?1:0);o.fastdom.write(()=>{o.css(this.$el,c),o.Transition.start(this.$el,i,a,r).catch(o.noop)})})}},{name:"transitioncanceled transitionend",self:!0,el(){return this.item},handler(){o.Transition.cancel(this.$el)}},{name:"itemtranslatein itemtranslateout",self:!0,el(){return this.item},handler(n){let{type:t,detail:{percent:e,dir:a}}=n;o.fastdom.read(()=>{const r=this.getCss(z(t,a,e));o.fastdom.write(()=>o.css(this.$el,r))})}}]};function O(n){return o.endsWith(n,"in")}function z(n,t,e){return e/=2,O(n)^t<0?e:1-e}return typeof window<"u"&&window.UIkit&&window.UIkit.component("sliderParallax",W),W});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! UIkit 3.11.2-dev.
|
|
1
|
+
/*! UIkit 3.11.2-dev.93483bd3e | 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')) :
|
|
@@ -87,17 +87,17 @@
|
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
created() {
|
|
90
|
-
['start', 'move', 'end']
|
|
90
|
+
for (const key of ['start', 'move', 'end']) {
|
|
91
91
|
const fn = this[key];
|
|
92
92
|
this[key] = (e) => {
|
|
93
93
|
const pos = uikitUtil.getEventPos(e).x * (uikitUtil.isRtl ? -1 : 1);
|
|
94
94
|
|
|
95
|
-
this.prevPos = pos
|
|
95
|
+
this.prevPos = pos === this.pos ? this.prevPos : this.pos;
|
|
96
96
|
this.pos = pos;
|
|
97
97
|
|
|
98
98
|
fn(e);
|
|
99
99
|
};
|
|
100
|
-
}
|
|
100
|
+
}
|
|
101
101
|
},
|
|
102
102
|
|
|
103
103
|
events: [
|
|
@@ -335,7 +335,7 @@
|
|
|
335
335
|
methods: {
|
|
336
336
|
updateNav() {
|
|
337
337
|
const i = this.getValidIndex();
|
|
338
|
-
this.navItems
|
|
338
|
+
for (const el of this.navItems) {
|
|
339
339
|
const cmd = uikitUtil.data(el, this.attrItem);
|
|
340
340
|
|
|
341
341
|
uikitUtil.toggleClass(el, this.clsActive, uikitUtil.toNumber(cmd) === i);
|
|
@@ -345,7 +345,7 @@
|
|
|
345
345
|
this.finite && (
|
|
346
346
|
cmd === 'previous' && i === 0 || cmd === 'next' && i >= this.maxIndex));
|
|
347
347
|
|
|
348
|
-
}
|
|
348
|
+
}
|
|
349
349
|
} } };
|
|
350
350
|
|
|
351
351
|
var Slider = {
|
|
@@ -503,20 +503,13 @@
|
|
|
503
503
|
},
|
|
504
504
|
|
|
505
505
|
_show(prev, next, force) {
|
|
506
|
-
this._transitioner = this._getTransitioner(
|
|
507
|
-
prev,
|
|
508
|
-
next,
|
|
509
|
-
this.dir,
|
|
510
|
-
uikitUtil.assign(
|
|
511
|
-
{
|
|
506
|
+
this._transitioner = this._getTransitioner(prev, next, this.dir, {
|
|
512
507
|
easing: force ?
|
|
513
508
|
next.offsetWidth < 600 ?
|
|
514
509
|
'cubic-bezier(0.25, 0.46, 0.45, 0.94)' /* easeOutQuad */ :
|
|
515
510
|
'cubic-bezier(0.165, 0.84, 0.44, 1)' /* easeOutQuart */ :
|
|
516
|
-
this.easing
|
|
517
|
-
|
|
518
|
-
this.transitionOptions));
|
|
519
|
-
|
|
511
|
+
this.easing,
|
|
512
|
+
...this.transitionOptions });
|
|
520
513
|
|
|
521
514
|
|
|
522
515
|
if (!force && !prev) {
|
|
@@ -581,6 +574,42 @@
|
|
|
581
574
|
|
|
582
575
|
events: ['resize'] } };
|
|
583
576
|
|
|
577
|
+
var SliderPreload = {
|
|
578
|
+
connected() {
|
|
579
|
+
if (window.IntersectionObserver) {
|
|
580
|
+
this.observer = new IntersectionObserver(
|
|
581
|
+
(entries) => {
|
|
582
|
+
if (entries.some((entry) => entry.isIntersecting)) {
|
|
583
|
+
removeLazyLoad(this.getAdjacentSlides());
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
{ rootMargin: '50% 50%' });
|
|
587
|
+
|
|
588
|
+
this.observer.observe(this.$el);
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
|
|
592
|
+
disconnected() {
|
|
593
|
+
this.observer && this.observer.disconnect();
|
|
594
|
+
},
|
|
595
|
+
|
|
596
|
+
update: {
|
|
597
|
+
read() {
|
|
598
|
+
if (uikitUtil.isVisible(this.$el)) {
|
|
599
|
+
removeLazyLoad(this.getAdjacentSlides());
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
|
|
603
|
+
events: ['resize'] } };
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
function removeLazyLoad(elements) {if (elements === void 0) {elements = [];}
|
|
608
|
+
for (const el of elements) {
|
|
609
|
+
el && uikitUtil.$$('img[loading="lazy"]', el).forEach((el) => uikitUtil.removeAttr(el, 'loading'));
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
|
|
584
613
|
function translate(value, unit) {if (value === void 0) {value = 0;}if (unit === void 0) {unit = '%';}
|
|
585
614
|
value += value ? unit : '';
|
|
586
615
|
return "translate3d(" + value + ", 0, 0)";
|
|
@@ -660,7 +689,7 @@
|
|
|
660
689
|
|
|
661
690
|
percent = prev ? uikitUtil.clamp(percent, -1, 1) : 0;
|
|
662
691
|
|
|
663
|
-
uikitUtil.children(list)
|
|
692
|
+
for (const slide of uikitUtil.children(list)) {
|
|
664
693
|
const isActive = uikitUtil.includes(actives, slide);
|
|
665
694
|
const isIn = slide === itemIn;
|
|
666
695
|
const isOut = slide === itemOut;
|
|
@@ -675,7 +704,7 @@
|
|
|
675
704
|
dir,
|
|
676
705
|
percent: isOut ? 1 - percent : isIn ? percent : isActive ? 1 : 0 });
|
|
677
706
|
|
|
678
|
-
}
|
|
707
|
+
}
|
|
679
708
|
},
|
|
680
709
|
|
|
681
710
|
percent() {
|
|
@@ -752,7 +781,7 @@
|
|
|
752
781
|
}
|
|
753
782
|
|
|
754
783
|
var Component = {
|
|
755
|
-
mixins: [Class, Slider, SliderReactive],
|
|
784
|
+
mixins: [Class, Slider, SliderReactive, SliderPreload],
|
|
756
785
|
|
|
757
786
|
props: {
|
|
758
787
|
center: Boolean,
|
|
@@ -862,7 +891,7 @@
|
|
|
862
891
|
|
|
863
892
|
update: {
|
|
864
893
|
write() {
|
|
865
|
-
this.navItems
|
|
894
|
+
for (const el of this.navItems) {
|
|
866
895
|
const index = uikitUtil.toNumber(uikitUtil.data(el, this.attrItem));
|
|
867
896
|
if (index !== false) {
|
|
868
897
|
el.hidden =
|
|
@@ -870,7 +899,7 @@
|
|
|
870
899
|
index > this.maxIndex ||
|
|
871
900
|
this.sets && !uikitUtil.includes(this.sets, index);
|
|
872
901
|
}
|
|
873
|
-
}
|
|
902
|
+
}
|
|
874
903
|
|
|
875
904
|
if (this.length && !this.dragging && !this.stack.length) {
|
|
876
905
|
this.reorder();
|
|
@@ -878,14 +907,13 @@
|
|
|
878
907
|
}
|
|
879
908
|
|
|
880
909
|
const actives = this._getTransitioner(this.index).getActives();
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
if (this.clsActivated && (!this.sets || uikitUtil.includes(this.sets, uikitUtil.toFloat(this.index)))) {
|
|
886
|
-
this.slides.forEach((slide) =>
|
|
887
|
-
uikitUtil.toggleClass(slide, this.clsActivated || '', uikitUtil.includes(actives, slide)));
|
|
910
|
+
const activeClasses = [
|
|
911
|
+
this.clsActive,
|
|
912
|
+
(!this.sets || uikitUtil.includes(this.sets, uikitUtil.toFloat(this.index))) && this.clsActivated ||
|
|
913
|
+
''];
|
|
888
914
|
|
|
915
|
+
for (const slide of this.slides) {
|
|
916
|
+
uikitUtil.toggleClass(slide, activeClasses, uikitUtil.includes(actives, slide));
|
|
889
917
|
}
|
|
890
918
|
},
|
|
891
919
|
|
|
@@ -990,6 +1018,25 @@
|
|
|
990
1018
|
} while (index !== prev);
|
|
991
1019
|
|
|
992
1020
|
return index;
|
|
1021
|
+
},
|
|
1022
|
+
|
|
1023
|
+
getAdjacentSlides() {
|
|
1024
|
+
const { width } = uikitUtil.dimensions(this.list);
|
|
1025
|
+
const left = -width;
|
|
1026
|
+
const right = width * 2;
|
|
1027
|
+
const slideWidth = uikitUtil.dimensions(this.slides[this.index]).width;
|
|
1028
|
+
const slideLeft = this.center ? width / 2 - slideWidth / 2 : 0;
|
|
1029
|
+
const slides = new Set();
|
|
1030
|
+
for (const i of [-1, 1]) {
|
|
1031
|
+
let currentLeft = slideLeft + (i > 0 ? slideWidth : 0);
|
|
1032
|
+
let j = 0;
|
|
1033
|
+
do {
|
|
1034
|
+
const slide = this.slides[this.getIndex(this.index + i + j++ * i)];
|
|
1035
|
+
currentLeft += uikitUtil.dimensions(slide).width * i;
|
|
1036
|
+
slides.add(slide);
|
|
1037
|
+
} while (this.slides.length > j && currentLeft > left && currentLeft < right);
|
|
1038
|
+
}
|
|
1039
|
+
return Array.from(slides);
|
|
993
1040
|
} } };
|
|
994
1041
|
|
|
995
1042
|
|