uikit 3.11.1-dev.fbcf9eec9 → 3.11.2-dev.31cd2ba38
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 +30 -0
- package/dist/css/uikit-core-rtl.css +1 -1
- package/dist/css/uikit-core-rtl.min.css +1 -1
- package/dist/css/uikit-core.css +1 -1
- package/dist/css/uikit-core.min.css +1 -1
- package/dist/css/uikit-rtl.css +1 -1
- package/dist/css/uikit-rtl.min.css +1 -1
- package/dist/css/uikit.css +1 -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 +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 +37 -41
- package/dist/js/components/parallax.min.js +1 -1
- package/dist/js/components/slider-parallax.js +32 -25
- 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 +32 -25
- 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 +2 -3
- 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 +224 -195
- 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 +287 -263
- package/dist/js/uikit.min.js +1 -1
- package/package.json +1 -1
- package/src/js/api/state.js +4 -4
- package/src/js/components/parallax.js +5 -16
- package/src/js/components/slider.js +1 -1
- package/src/js/components/sortable.js +1 -2
- package/src/js/core/core.js +2 -2
- package/src/js/core/drop.js +1 -1
- package/src/js/core/height-viewport.js +2 -2
- package/src/js/core/img.js +68 -92
- package/src/js/core/navbar.js +6 -2
- package/src/js/core/sticky.js +82 -50
- package/src/js/mixin/parallax.js +32 -21
- package/src/js/util/dimensions.js +28 -12
- package/src/js/util/fastdom.js +2 -2
- package/src/js/util/options.js +5 -5
- package/src/js/util/viewport.js +7 -3
- package/tests/image.html +22 -38
- package/tests/images/test.avif +0 -0
- package/tests/images/test.webp +0 -0
- package/tests/sticky-parallax.html +44 -41
- package/tests/sticky.html +56 -24
package/src/js/mixin/parallax.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Media from '../mixin/media';
|
|
2
2
|
import {getMaxPathLength} from '../core/svg';
|
|
3
|
-
import {css, Dimensions, each, isNumber, isString, isUndefined, noop, startsWith, toFloat, toPx, ucfirst} from 'uikit-util';
|
|
3
|
+
import {css, Dimensions, each, isNumber, isString, isUndefined, noop, startsWith, toFloat, toPx, trigger, ucfirst} from 'uikit-util';
|
|
4
4
|
|
|
5
5
|
const props = {
|
|
6
6
|
x: transformFn,
|
|
@@ -38,7 +38,7 @@ export default {
|
|
|
38
38
|
props(properties, $el) {
|
|
39
39
|
return keys(props).reduce((result, prop) => {
|
|
40
40
|
if (!isUndefined(properties[prop])) {
|
|
41
|
-
result[prop] = props[prop]
|
|
41
|
+
result[prop] = props[prop](prop, $el, properties[prop].slice());
|
|
42
42
|
}
|
|
43
43
|
return result;
|
|
44
44
|
}, {});
|
|
@@ -46,6 +46,12 @@ export default {
|
|
|
46
46
|
|
|
47
47
|
},
|
|
48
48
|
|
|
49
|
+
events: {
|
|
50
|
+
bgimageload() {
|
|
51
|
+
this.$emit();
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
|
|
49
55
|
methods: {
|
|
50
56
|
|
|
51
57
|
reset() {
|
|
@@ -186,15 +192,15 @@ function backgroundFn(prop, el, steps) {
|
|
|
186
192
|
const bgPos = css(el, 'backgroundPosition').split(' ')[prop === 'x' ? 0 : 1]; // IE 11 can't read background-position-[x|y]
|
|
187
193
|
|
|
188
194
|
return getCssValue(el, 'backgroundSize', '') === 'cover'
|
|
189
|
-
? backgroundCoverFn
|
|
195
|
+
? backgroundCoverFn(prop, el, steps, bgPos, attr)
|
|
190
196
|
: setBackgroundPosFn(prop, steps, bgPos);
|
|
191
197
|
}
|
|
192
198
|
|
|
193
199
|
function backgroundCoverFn(prop, el, steps, bgPos, attr) {
|
|
194
200
|
|
|
195
|
-
const
|
|
201
|
+
const dimImage = getBackgroundImageDimensions(el);
|
|
196
202
|
|
|
197
|
-
if (!
|
|
203
|
+
if (!dimImage.width) {
|
|
198
204
|
return noop;
|
|
199
205
|
}
|
|
200
206
|
|
|
@@ -210,11 +216,6 @@ function backgroundCoverFn(prop, el, steps, bgPos, attr) {
|
|
|
210
216
|
height: el.offsetHeight
|
|
211
217
|
};
|
|
212
218
|
|
|
213
|
-
const dimImage = {
|
|
214
|
-
width: image.naturalWidth,
|
|
215
|
-
height: image.naturalHeight
|
|
216
|
-
};
|
|
217
|
-
|
|
218
219
|
const baseDim = Dimensions.cover(dimImage, dimEl);
|
|
219
220
|
const span = baseDim[attr] - dimEl[attr];
|
|
220
221
|
|
|
@@ -245,24 +246,34 @@ function setBackgroundPosFn(prop, steps, pos) {
|
|
|
245
246
|
};
|
|
246
247
|
}
|
|
247
248
|
|
|
248
|
-
|
|
249
|
+
const dimensions = {};
|
|
250
|
+
function getBackgroundImageDimensions(el) {
|
|
249
251
|
const src = css(el, 'backgroundImage').replace(/^none|url\(["']?(.+?)["']?\)$/, '$1');
|
|
250
252
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
if (data[src]) {
|
|
254
|
-
return data[src];
|
|
253
|
+
if (dimensions[src]) {
|
|
254
|
+
return dimensions[src];
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
+
const image = new Image();
|
|
257
258
|
if (src) {
|
|
258
|
-
|
|
259
|
-
img.src = src;
|
|
260
|
-
if (!img.naturalWidth) {
|
|
261
|
-
img.onload = () => this.$update();
|
|
262
|
-
}
|
|
259
|
+
image.src = src;
|
|
263
260
|
|
|
264
|
-
|
|
261
|
+
if (!image.naturalWidth) {
|
|
262
|
+
image.onload = () => {
|
|
263
|
+
dimensions[src] = toDimensions(image);
|
|
264
|
+
trigger(el, 'bgimageload');
|
|
265
|
+
};
|
|
266
|
+
}
|
|
265
267
|
}
|
|
268
|
+
|
|
269
|
+
return dimensions[src] = toDimensions(image);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function toDimensions(image) {
|
|
273
|
+
return {
|
|
274
|
+
width: image.naturalWidth,
|
|
275
|
+
height: image.naturalHeight
|
|
276
|
+
};
|
|
266
277
|
}
|
|
267
278
|
|
|
268
279
|
function getStep(steps, percent) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {css} from './style';
|
|
2
|
-
import {each,
|
|
2
|
+
import {each, isDocument, isElement, isString, isUndefined, isWindow, memoize, toFloat, toNode, toWindow, ucfirst} from './lang';
|
|
3
3
|
|
|
4
4
|
const dirs = {
|
|
5
5
|
width: ['left', 'right'],
|
|
@@ -157,19 +157,35 @@ export function flipPosition(pos) {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
export function toPx(value, property = 'width', element = window, offsetDim = false) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
160
|
+
|
|
161
|
+
if (!isString(value)) {
|
|
162
|
+
return toFloat(value);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return parseCalc(value).reduce((result, value) => {
|
|
166
|
+
const unit = parseUnit(value);
|
|
167
|
+
if (unit) {
|
|
168
|
+
value = percent(
|
|
169
|
+
unit === 'vh'
|
|
170
|
+
? height(toWindow(element))
|
|
171
|
+
: unit === 'vw'
|
|
172
|
+
? width(toWindow(element))
|
|
173
|
+
: offsetDim
|
|
174
|
+
? element[`offset${ucfirst(property)}`]
|
|
175
|
+
: dimensions(element)[property],
|
|
176
|
+
value
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return result + toFloat(value);
|
|
181
|
+
}, 0);
|
|
171
182
|
}
|
|
172
183
|
|
|
184
|
+
const calcRe = /-?\d+(?:\.\d+)?(?:v[wh]|%|px)?/g;
|
|
185
|
+
const parseCalc = memoize(calc => calc.toString().replace(/\s/g, '').match(calcRe) || []);
|
|
186
|
+
const unitRe = /(?:v[hw]|%)$/;
|
|
187
|
+
const parseUnit = memoize(str => (str.match(unitRe) || [])[0]);
|
|
188
|
+
|
|
173
189
|
function percent(base, value) {
|
|
174
190
|
return base * toFloat(value) / 100;
|
|
175
191
|
}
|
package/src/js/util/fastdom.js
CHANGED
|
@@ -31,7 +31,7 @@ export const fastdom = {
|
|
|
31
31
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
function flush(recursion
|
|
34
|
+
function flush(recursion) {
|
|
35
35
|
runTasks(fastdom.reads);
|
|
36
36
|
runTasks(fastdom.writes.splice(0));
|
|
37
37
|
|
|
@@ -53,7 +53,7 @@ function scheduleFlush(recursion) {
|
|
|
53
53
|
if (recursion && recursion < RECURSION_LIMIT) {
|
|
54
54
|
Promise.resolve().then(() => flush(recursion));
|
|
55
55
|
} else {
|
|
56
|
-
requestAnimationFrame(() => flush());
|
|
56
|
+
requestAnimationFrame(() => flush(1));
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
}
|
package/src/js/util/options.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {assign, hasOwn, includes, isArray, isFunction, isUndefined, sortBy
|
|
1
|
+
import {assign, hasOwn, includes, isArray, isFunction, isUndefined, sortBy} from './lang';
|
|
2
2
|
|
|
3
3
|
const strats = {};
|
|
4
4
|
|
|
@@ -134,9 +134,8 @@ export function parseOptions(options, args = []) {
|
|
|
134
134
|
|
|
135
135
|
try {
|
|
136
136
|
|
|
137
|
-
return
|
|
138
|
-
? {
|
|
139
|
-
: startsWith(options, '{')
|
|
137
|
+
return options
|
|
138
|
+
? options.match(/^[{[]/)
|
|
140
139
|
? JSON.parse(options)
|
|
141
140
|
: args.length && !includes(options, ':')
|
|
142
141
|
? ({[args[0]]: options})
|
|
@@ -146,7 +145,8 @@ export function parseOptions(options, args = []) {
|
|
|
146
145
|
options[key.trim()] = value.trim();
|
|
147
146
|
}
|
|
148
147
|
return options;
|
|
149
|
-
}, {})
|
|
148
|
+
}, {})
|
|
149
|
+
: {};
|
|
150
150
|
|
|
151
151
|
} catch (e) {
|
|
152
152
|
return {};
|
package/src/js/util/viewport.js
CHANGED
|
@@ -2,7 +2,7 @@ import {css} from './style';
|
|
|
2
2
|
import {Promise} from './promise';
|
|
3
3
|
import {isVisible, parents} from './filter';
|
|
4
4
|
import {offset, offsetPosition} from './dimensions';
|
|
5
|
-
import {clamp, findIndex, intersectRect, isDocument, isWindow, toNode, toWindow} from './lang';
|
|
5
|
+
import {clamp, findIndex, intersectRect, isDocument, isUndefined, isWindow, toNode, toWindow} from './lang';
|
|
6
6
|
|
|
7
7
|
export function isInView(element, offsetTop = 0, offsetLeft = 0) {
|
|
8
8
|
|
|
@@ -31,7 +31,11 @@ export function scrollTop(element, top) {
|
|
|
31
31
|
element = toNode(element);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
if (isUndefined(top)) {
|
|
35
|
+
return element.scrollTop;
|
|
36
|
+
} else {
|
|
37
|
+
element.scrollTop = top;
|
|
38
|
+
}
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
export function scrollIntoView(element, {offset: offsetBy = 0} = {}) {
|
|
@@ -145,7 +149,7 @@ export function getViewportClientHeight(scrollElement) {
|
|
|
145
149
|
return (scrollElement === getScrollingElement(scrollElement) ? document.documentElement : scrollElement).clientHeight;
|
|
146
150
|
}
|
|
147
151
|
|
|
148
|
-
function getScrollingElement(element) {
|
|
152
|
+
export function getScrollingElement(element) {
|
|
149
153
|
const {document} = toWindow(element);
|
|
150
154
|
return document.scrollingElement || document.documentElement;
|
|
151
155
|
}
|
package/tests/image.html
CHANGED
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
<h1>Image</h1>
|
|
16
16
|
|
|
17
|
-
<p><button class="uk-button uk-button-default" onclick="sessionStorage.clear()">Clear Session Storage</button></p>
|
|
18
|
-
|
|
19
17
|
<div class="uk-child-width-1-2@m" uk-grid>
|
|
20
18
|
<div>
|
|
21
19
|
<img data-src="https://images.unsplash.com/photo-1522201949034-507737bce479?fit=crop&w=900&h=600&q=80" width="900" height="600" alt="" uk-img>
|
|
@@ -25,7 +23,11 @@
|
|
|
25
23
|
</div>
|
|
26
24
|
</div>
|
|
27
25
|
|
|
28
|
-
<div class="uk-height-large uk-background-cover uk-margin-medium uk-flex uk-flex-center uk-flex-middle uk-light" data-src="https://images.unsplash.com/photo-1490822180406-880c226c150b?fit=crop&w=1200&h=450&q=80" uk-img>
|
|
26
|
+
<div class="uk-height-large uk-background-cover uk-margin-medium uk-flex uk-flex-center uk-flex-middle uk-light" data-src="https://images.unsplash.com/photo-1490822180406-880c226c150b?fit=crop&w=1200&h=450&q=80" data-sources="srcset: images/test.avif; type: image/avif" uk-img>
|
|
27
|
+
<h1>Background Image</h1>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="uk-height-large uk-background-cover uk-margin-medium uk-flex uk-flex-center uk-flex-middle uk-light" data-src="https://images.unsplash.com/photo-1490822180406-880c226c150b?fit=crop&w=1200&h=450&q=80" data-sources="[{"srcset": "images/test.avif", "type": "image/avif"},{"srcset": "images/test.webp", "type": "image/webp"}]" uk-img>
|
|
29
31
|
<h1>Background Image</h1>
|
|
30
32
|
</div>
|
|
31
33
|
|
|
@@ -255,28 +257,28 @@
|
|
|
255
257
|
|
|
256
258
|
<ul class="uk-slideshow-items">
|
|
257
259
|
<li>
|
|
258
|
-
<img data-src="images/photo.jpg" alt="" uk-cover
|
|
260
|
+
<img data-src="images/photo.jpg" alt="" uk-cover width="1800" height="1200" uk-img="target: !.uk-slideshow-items > :last-child, !* +*">
|
|
259
261
|
<div class="uk-position-center uk-position-small uk-text-center">
|
|
260
262
|
<h2 uk-slideshow-parallax="x: 100,-100">Heading</h2>
|
|
261
263
|
<p uk-slideshow-parallax="x: 200,-200">Lorem ipsum dolor sit amet.</p>
|
|
262
264
|
</div>
|
|
263
265
|
</li>
|
|
264
266
|
<li>
|
|
265
|
-
<img data-src="images/dark.jpg" alt="" uk-cover
|
|
267
|
+
<img data-src="images/dark.jpg" alt="" uk-cover width="1800" height="1200" uk-img="target: !* -*, !* +*">
|
|
266
268
|
<div class="uk-position-center uk-position-small uk-text-center">
|
|
267
269
|
<h2 uk-slideshow-parallax="x: 100,-100">Heading</h2>
|
|
268
270
|
<p uk-slideshow-parallax="x: 200,-200">Lorem ipsum dolor sit amet.</p>
|
|
269
271
|
</div>
|
|
270
272
|
</li>
|
|
271
273
|
<li>
|
|
272
|
-
<img data-src="images/light.jpg" alt="" uk-cover
|
|
274
|
+
<img data-src="images/light.jpg" alt="" uk-cover width="1800" height="1200" uk-img="target: !* -*, !* +*">
|
|
273
275
|
<div class="uk-position-center uk-position-small uk-text-center">
|
|
274
276
|
<h2 uk-slideshow-parallax="y: -50,0,0; opacity: 1,1,0">Heading</h2>
|
|
275
277
|
<p uk-slideshow-parallax="y: 50,0,0; opacity: 1,1,0">Lorem ipsum dolor sit amet.</p>
|
|
276
278
|
</div>
|
|
277
279
|
</li>
|
|
278
280
|
<li>
|
|
279
|
-
<img data-src="images/photo2.jpg" alt="" uk-cover
|
|
281
|
+
<img data-src="images/photo2.jpg" alt="" uk-cover width="1800" height="1200" uk-img="target: !* -*, !.uk-slideshow-items > :first-child">
|
|
280
282
|
<div class="uk-position-center uk-position-small uk-text-center">
|
|
281
283
|
<h2 uk-slideshow-parallax="x: 200,0,0">Heading</h2>
|
|
282
284
|
<p uk-slideshow-parallax="x: 0,0,-200">Lorem ipsum dolor sit amet.</p>
|
|
@@ -296,43 +298,43 @@
|
|
|
296
298
|
|
|
297
299
|
<ul class="uk-slider-items uk-child-width-1-2@s uk-child-width-1-3@m">
|
|
298
300
|
<li>
|
|
299
|
-
<img data-src="images/slider1.jpg" alt=""
|
|
301
|
+
<img data-src="images/slider1.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
|
|
300
302
|
<div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">1</h1></div>
|
|
301
303
|
</li>
|
|
302
304
|
<li>
|
|
303
|
-
<img data-src="images/slider2.jpg" alt=""
|
|
305
|
+
<img data-src="images/slider2.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
|
|
304
306
|
<div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">2</h1></div>
|
|
305
307
|
</li>
|
|
306
308
|
<li>
|
|
307
|
-
<img data-src="images/slider3.jpg" alt=""
|
|
309
|
+
<img data-src="images/slider3.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
|
|
308
310
|
<div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">3</h1></div>
|
|
309
311
|
</li>
|
|
310
312
|
<li>
|
|
311
|
-
<img data-src="images/slider4.jpg" alt=""
|
|
313
|
+
<img data-src="images/slider4.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
|
|
312
314
|
<div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">4</h1></div>
|
|
313
315
|
</li>
|
|
314
316
|
<li>
|
|
315
|
-
<img data-src="images/slider5.jpg" alt=""
|
|
317
|
+
<img data-src="images/slider5.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
|
|
316
318
|
<div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">5</h1></div>
|
|
317
319
|
</li>
|
|
318
320
|
<li>
|
|
319
|
-
<img data-src="images/slider1.jpg" alt=""
|
|
321
|
+
<img data-src="images/slider1.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
|
|
320
322
|
<div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">6</h1></div>
|
|
321
323
|
</li>
|
|
322
324
|
<li>
|
|
323
|
-
<img data-src="images/slider2.jpg" alt=""
|
|
325
|
+
<img data-src="images/slider2.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
|
|
324
326
|
<div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">7</h1></div>
|
|
325
327
|
</li>
|
|
326
328
|
<li>
|
|
327
|
-
<img data-src="images/slider3.jpg" alt=""
|
|
329
|
+
<img data-src="images/slider3.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
|
|
328
330
|
<div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">8</h1></div>
|
|
329
331
|
</li>
|
|
330
332
|
<li>
|
|
331
|
-
<img data-src="images/slider4.jpg" alt=""
|
|
333
|
+
<img data-src="images/slider4.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
|
|
332
334
|
<div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">9</h1></div>
|
|
333
335
|
</li>
|
|
334
336
|
<li>
|
|
335
|
-
<img data-src="images/slider5.jpg" alt=""
|
|
337
|
+
<img data-src="images/slider5.jpg" alt="" width="400" height="600" uk-img="target: !.uk-slider-items">
|
|
336
338
|
<div class="uk-position-center uk-panel"><h1 class="uk-transition-slide-bottom-small">10</h1></div>
|
|
337
339
|
</li>
|
|
338
340
|
</ul>
|
|
@@ -365,28 +367,10 @@
|
|
|
365
367
|
<td>The image's `src` attribute.</td>
|
|
366
368
|
</tr>
|
|
367
369
|
<tr>
|
|
368
|
-
<td><code>
|
|
369
|
-
<td>String</td>
|
|
370
|
-
<td>false</td>
|
|
371
|
-
<td>The image's `srcset` attribute.</td>
|
|
372
|
-
</tr>
|
|
373
|
-
<tr>
|
|
374
|
-
<td><code>sizes</code></td>
|
|
375
|
-
<td>String</td>
|
|
376
|
-
<td>false</td>
|
|
377
|
-
<td>The image's `sizes` attribute.</td>
|
|
378
|
-
</tr>
|
|
379
|
-
<tr>
|
|
380
|
-
<td><code>width</code></td>
|
|
370
|
+
<td><code>dataSources</code></td>
|
|
381
371
|
<td>String</td>
|
|
382
|
-
<td>
|
|
383
|
-
<td>The image's
|
|
384
|
-
</tr>
|
|
385
|
-
<tr>
|
|
386
|
-
<td><code>height</code></td>
|
|
387
|
-
<td>String</td>
|
|
388
|
-
<td>false</td>
|
|
389
|
-
<td>The image's `height` attribute. It will be used to determine the placeholder's height and the images position in the document.</td>
|
|
372
|
+
<td>''</td>
|
|
373
|
+
<td>The image's sources. This option is used for background images only. The sources attributes be passed in `key: value;` format for a single source. For multiple sources in JSON format.</td>
|
|
390
374
|
</tr>
|
|
391
375
|
<tr>
|
|
392
376
|
<td><code>offsetTop</code></td>
|
|
Binary file
|
|
Binary file
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
<script src="js/test.js"></script>
|
|
9
9
|
</head>
|
|
10
10
|
|
|
11
|
-
<body style="padding-bottom:
|
|
11
|
+
<body style="padding-bottom: 100vh;">
|
|
12
12
|
|
|
13
|
-
<div class="uk-section uk-section-primary uk-position-z-index-negative uk-flex uk-flex-center uk-flex-middle uk-text-center" uk-sticky="bottom: +* +*" uk-height-viewport>
|
|
13
|
+
<div class="uk-section uk-section-primary uk-position-z-index-negative uk-flex uk-flex-center uk-flex-middle uk-text-center" uk-sticky="position: auto; bottom: +* +*" uk-height-viewport>
|
|
14
14
|
<div class="uk-container">
|
|
15
15
|
|
|
16
16
|
<h1 class="uk-heading-2xlarge">Sticky Section</h1>
|
|
@@ -21,21 +21,20 @@
|
|
|
21
21
|
<div class="uk-section uk-section-default">
|
|
22
22
|
<div class="uk-container">
|
|
23
23
|
|
|
24
|
-
<div id="js-sticky-parallax-container" class="uk-position-relative uk-background-muted uk-text-center" style="height:
|
|
25
|
-
<div uk-sticky="bottom: #js-sticky-parallax-container
|
|
24
|
+
<div id="js-sticky-parallax-container" class="uk-position-relative uk-background-muted uk-text-center" style="height: 300vh">
|
|
25
|
+
<div class="uk-flex uk-flex-center uk-flex-middle" style="height: 100vh;" uk-sticky="bottom: #js-sticky-parallax-container">
|
|
26
|
+
<div>
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</div>
|
|
28
|
+
<img class="uk-position-relative uk-position-z-index" src="images/size-v.jpg" alt="" width="400" height="800" style="max-width: 50vw" uk-parallax="target: #js-sticky-parallax-container; y: 0,-250; easing: -1; start: 100vh; end: 100vh;">
|
|
29
|
+
|
|
30
|
+
<div style="margin-top: -200px">
|
|
31
|
+
<h1 class="uk-heading-2xlarge">
|
|
32
|
+
<span class="uk-display-inline-block" uk-parallax="target: #js-sticky-parallax-container; x: 0,-15vw,-7vw,0; easing: -1; start: 60vh; end: 100vh;">Sticky</span>
|
|
33
|
+
<br><span class="uk-display-inline-block" uk-parallax="target: #js-sticky-parallax-container; x: 0,10vw,5vw,0; easing: -1; start: 60vh; end: 100vh;">Parallax</span>
|
|
34
|
+
</h1>
|
|
35
35
|
</div>
|
|
36
|
-
</div>
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
</div>
|
|
39
38
|
|
|
40
39
|
</div>
|
|
41
40
|
</div>
|
|
@@ -117,7 +116,7 @@
|
|
|
117
116
|
|
|
118
117
|
<div class="uk-section uk-section-default">
|
|
119
118
|
|
|
120
|
-
<div id="js-sticky-parallax-viewport" class="uk-child-width-1-3 uk-text-center" uk-grid>
|
|
119
|
+
<div id="js-sticky-parallax-viewport" class="uk-child-width-1-2 uk-child-width-1-3@s uk-text-center" uk-grid>
|
|
121
120
|
<div>
|
|
122
121
|
|
|
123
122
|
<img class="uk-margin-large" src="images/photo.jpg" alt="" width="1800" height="1200">
|
|
@@ -125,13 +124,15 @@
|
|
|
125
124
|
<img class="uk-margin-large" src="images/photo2.jpg" alt="" width="1800" height="1200">
|
|
126
125
|
<img class="uk-margin-large" src="images/photo.jpg" alt="" width="1800" height="1200">
|
|
127
126
|
<img class="uk-margin-large" src="images/photo3.jpg" alt="" width="1800" height="1200">
|
|
127
|
+
<img class="uk-margin-large" src="images/photo2.jpg" alt="" width="1800" height="1200">
|
|
128
|
+
<img class="uk-margin-large" src="images/photo.jpg" alt="" width="1800" height="1200">
|
|
128
129
|
|
|
129
130
|
</div>
|
|
130
131
|
<div>
|
|
131
132
|
|
|
132
|
-
<div class="uk-
|
|
133
|
+
<div class="uk-background-muted uk-text-center" style="height: 100vh" uk-sticky="bottom: #js-sticky-parallax-viewport">
|
|
133
134
|
|
|
134
|
-
<div uk-parallax="target: #js-sticky-parallax-viewport; start: 100vh; end: 100vh; y:
|
|
135
|
+
<div uk-parallax="target: #js-sticky-parallax-viewport; start: 100vh; end: 100vh; y: 10vh, 80vh; easing: 0">
|
|
135
136
|
|
|
136
137
|
<h1 class="uk-margin-remove">Sticky Parallax Viewport</h1>
|
|
137
138
|
|
|
@@ -140,13 +141,15 @@
|
|
|
140
141
|
</div>
|
|
141
142
|
|
|
142
143
|
</div>
|
|
143
|
-
<div>
|
|
144
|
+
<div class="uk-visible@s">
|
|
144
145
|
|
|
145
146
|
<img class="uk-margin-large" src="images/photo2.jpg" alt="" width="1800" height="1200">
|
|
146
147
|
<img class="uk-margin-large" src="images/photo.jpg" alt="" width="1800" height="1200">
|
|
147
148
|
<img class="uk-margin-large" src="images/photo3.jpg" alt="" width="1800" height="1200">
|
|
148
149
|
<img class="uk-margin-large" src="images/photo2.jpg" alt="" width="1800" height="1200">
|
|
149
150
|
<img class="uk-margin-large" src="images/photo.jpg" alt="" width="1800" height="1200">
|
|
151
|
+
<img class="uk-margin-large" src="images/photo3.jpg" alt="" width="1800" height="1200">
|
|
152
|
+
<img class="uk-margin-large" src="images/photo2.jpg" alt="" width="1800" height="1200">
|
|
150
153
|
|
|
151
154
|
</div>
|
|
152
155
|
</div>
|
|
@@ -155,10 +158,10 @@
|
|
|
155
158
|
|
|
156
159
|
<div class="uk-section uk-section-default">
|
|
157
160
|
|
|
158
|
-
<div id="js-sticky-parallax-images"
|
|
159
|
-
<div class="uk-
|
|
161
|
+
<div id="js-sticky-parallax-images" style="height: 250vh" uk-grid>
|
|
162
|
+
<div class="uk-width-expand">
|
|
160
163
|
|
|
161
|
-
<div style="height: 100vh;" uk-sticky="bottom: #js-sticky-parallax-images">
|
|
164
|
+
<div class="uk-background-muted" style="height: 100vh;" uk-sticky="bottom: #js-sticky-parallax-images">
|
|
162
165
|
<div uk-parallax="target: #js-sticky-parallax-images; y: 55vh, 45vh;">
|
|
163
166
|
<img class="uk-position-center-left" src="images/photo.jpg" alt="" width="1800" height="1200">
|
|
164
167
|
<img class="uk-position-center-left" src="images/photo2.jpg" alt="" width="1800" height="1200" uk-parallax="target: #js-sticky-parallax-images; start: 125vh; end: 100% + 100vh - 135vh; opacity: 0,1">
|
|
@@ -167,12 +170,12 @@
|
|
|
167
170
|
</div>
|
|
168
171
|
|
|
169
172
|
</div>
|
|
170
|
-
<div class="uk-width-small">
|
|
171
|
-
<div class="uk-
|
|
172
|
-
<div class="uk-
|
|
173
|
-
<div class="uk-
|
|
174
|
-
<div class="uk-
|
|
175
|
-
<div class="uk-
|
|
173
|
+
<div class="uk-width-auto uk-text-small">
|
|
174
|
+
<div class="uk-flex uk-flex-center uk-flex-bottom uk-background-muted" style="height: 75vh">75vh</div>
|
|
175
|
+
<div class="uk-flex uk-flex-center uk-flex-bottom uk-background-primary uk-light" style="height: 50vh">125vh</div>
|
|
176
|
+
<div class="uk-flex uk-flex-center uk-flex-bottom uk-background-secondary uk-light" style="height: 50vh">175vh</div>
|
|
177
|
+
<div class="uk-flex uk-flex-center uk-flex-bottom uk-background-muted" style="height: 50vh">225vh</div>
|
|
178
|
+
<div class="uk-flex uk-flex-center uk-flex-bottom uk-background-primary uk-light" style="height: 25vh">250vh</div>
|
|
176
179
|
</div>
|
|
177
180
|
<div class="uk-width-expand">
|
|
178
181
|
|
|
@@ -183,7 +186,7 @@
|
|
|
183
186
|
|
|
184
187
|
<h1>Sticky Parallax Images 1</h1>
|
|
185
188
|
|
|
186
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
189
|
+
<p class="uk-visible@s">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
187
190
|
|
|
188
191
|
</div>
|
|
189
192
|
</div>
|
|
@@ -193,7 +196,7 @@
|
|
|
193
196
|
|
|
194
197
|
<h1>Sticky Parallax Images 2</h1>
|
|
195
198
|
|
|
196
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
199
|
+
<p class="uk-visible@s">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
197
200
|
|
|
198
201
|
</div>
|
|
199
202
|
</div>
|
|
@@ -203,7 +206,7 @@
|
|
|
203
206
|
|
|
204
207
|
<h1>Sticky Parallax Images 3</h1>
|
|
205
208
|
|
|
206
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
209
|
+
<p class="uk-visible@s">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
207
210
|
|
|
208
211
|
</div>
|
|
209
212
|
</div>
|
|
@@ -215,10 +218,10 @@
|
|
|
215
218
|
|
|
216
219
|
<div class="uk-section uk-section-default">
|
|
217
220
|
|
|
218
|
-
<div id="js-sticky-parallax-images-all"
|
|
219
|
-
<div class="uk-
|
|
221
|
+
<div id="js-sticky-parallax-images-all" style="height: 250vh" uk-grid>
|
|
222
|
+
<div class="uk-width-expand">
|
|
220
223
|
|
|
221
|
-
<div style="height: 100vh;" uk-sticky="bottom: #js-sticky-parallax-images-all">
|
|
224
|
+
<div class="uk-background-muted" style="height: 100vh;" uk-sticky="bottom: #js-sticky-parallax-images-all">
|
|
222
225
|
<div uk-parallax="target: #js-sticky-parallax-images-all; y: 55vh, 45vh;">
|
|
223
226
|
<img class="uk-position-center-left" src="images/photo.jpg" alt="" width="1800" height="1200">
|
|
224
227
|
<img class="uk-position-center-left" src="images/photo2.jpg" alt="" width="1800" height="1200" uk-parallax="target: #js-sticky-parallax-images-all; start: 150vh; end: 100% + 100vh - 160vh; opacity: 0,1">
|
|
@@ -227,11 +230,11 @@
|
|
|
227
230
|
</div>
|
|
228
231
|
|
|
229
232
|
</div>
|
|
230
|
-
<div class="uk-width-small">
|
|
231
|
-
<div class="uk-
|
|
232
|
-
<div class="uk-
|
|
233
|
-
<div class="uk-
|
|
234
|
-
<div class="uk-
|
|
233
|
+
<div class="uk-width-auto uk-text-small">
|
|
234
|
+
<div class="uk-flex uk-flex-center uk-flex-bottom uk-background-muted" style="height: 100vh">100vh</div>
|
|
235
|
+
<div class="uk-flex uk-flex-center uk-flex-bottom uk-background-primary uk-light" style="height: 50vh">150vh</div>
|
|
236
|
+
<div class="uk-flex uk-flex-center uk-flex-bottom uk-background-secondary uk-light" style="height: 50vh">200vh</div>
|
|
237
|
+
<div class="uk-flex uk-flex-center uk-flex-bottom uk-background-muted" style="height: 50vh">250vh</div>
|
|
235
238
|
</div>
|
|
236
239
|
<div class="uk-width-expand">
|
|
237
240
|
|
|
@@ -242,7 +245,7 @@
|
|
|
242
245
|
|
|
243
246
|
<h1>Sticky Parallax Images All 1</h1>
|
|
244
247
|
|
|
245
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
248
|
+
<p class="uk-visible@s">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
246
249
|
|
|
247
250
|
</div>
|
|
248
251
|
</div>
|
|
@@ -251,7 +254,7 @@
|
|
|
251
254
|
|
|
252
255
|
<h1>Sticky Parallax Images All 2</h1>
|
|
253
256
|
|
|
254
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
257
|
+
<p class="uk-visible@s">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
255
258
|
|
|
256
259
|
</div>
|
|
257
260
|
</div>
|
|
@@ -259,7 +262,7 @@
|
|
|
259
262
|
|
|
260
263
|
<h1>Sticky Parallax Images All 3</h1>
|
|
261
264
|
|
|
262
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
265
|
+
<p class="uk-visible@s">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
|
|
263
266
|
|
|
264
267
|
</div>
|
|
265
268
|
</div>
|