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.
Files changed (62) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/css/uikit-core-rtl.css +1 -1
  3. package/dist/css/uikit-core-rtl.min.css +1 -1
  4. package/dist/css/uikit-core.css +1 -1
  5. package/dist/css/uikit-core.min.css +1 -1
  6. package/dist/css/uikit-rtl.css +1 -1
  7. package/dist/css/uikit-rtl.min.css +1 -1
  8. package/dist/css/uikit.css +1 -1
  9. package/dist/css/uikit.min.css +1 -1
  10. package/dist/js/components/countdown.js +1 -1
  11. package/dist/js/components/countdown.min.js +1 -1
  12. package/dist/js/components/filter.js +1 -1
  13. package/dist/js/components/filter.min.js +1 -1
  14. package/dist/js/components/lightbox-panel.js +1 -1
  15. package/dist/js/components/lightbox-panel.min.js +1 -1
  16. package/dist/js/components/lightbox.js +1 -1
  17. package/dist/js/components/lightbox.min.js +1 -1
  18. package/dist/js/components/notification.js +1 -1
  19. package/dist/js/components/notification.min.js +1 -1
  20. package/dist/js/components/parallax.js +37 -41
  21. package/dist/js/components/parallax.min.js +1 -1
  22. package/dist/js/components/slider-parallax.js +32 -25
  23. package/dist/js/components/slider-parallax.min.js +1 -1
  24. package/dist/js/components/slider.js +2 -2
  25. package/dist/js/components/slider.min.js +1 -1
  26. package/dist/js/components/slideshow-parallax.js +32 -25
  27. package/dist/js/components/slideshow-parallax.min.js +1 -1
  28. package/dist/js/components/slideshow.js +1 -1
  29. package/dist/js/components/slideshow.min.js +1 -1
  30. package/dist/js/components/sortable.js +2 -3
  31. package/dist/js/components/sortable.min.js +1 -1
  32. package/dist/js/components/tooltip.js +1 -1
  33. package/dist/js/components/tooltip.min.js +1 -1
  34. package/dist/js/components/upload.js +1 -1
  35. package/dist/js/components/upload.min.js +1 -1
  36. package/dist/js/uikit-core.js +224 -195
  37. package/dist/js/uikit-core.min.js +1 -1
  38. package/dist/js/uikit-icons.js +1 -1
  39. package/dist/js/uikit-icons.min.js +1 -1
  40. package/dist/js/uikit.js +287 -263
  41. package/dist/js/uikit.min.js +1 -1
  42. package/package.json +1 -1
  43. package/src/js/api/state.js +4 -4
  44. package/src/js/components/parallax.js +5 -16
  45. package/src/js/components/slider.js +1 -1
  46. package/src/js/components/sortable.js +1 -2
  47. package/src/js/core/core.js +2 -2
  48. package/src/js/core/drop.js +1 -1
  49. package/src/js/core/height-viewport.js +2 -2
  50. package/src/js/core/img.js +68 -92
  51. package/src/js/core/navbar.js +6 -2
  52. package/src/js/core/sticky.js +82 -50
  53. package/src/js/mixin/parallax.js +32 -21
  54. package/src/js/util/dimensions.js +28 -12
  55. package/src/js/util/fastdom.js +2 -2
  56. package/src/js/util/options.js +5 -5
  57. package/src/js/util/viewport.js +7 -3
  58. package/tests/image.html +22 -38
  59. package/tests/images/test.avif +0 -0
  60. package/tests/images/test.webp +0 -0
  61. package/tests/sticky-parallax.html +44 -41
  62. package/tests/sticky.html +56 -24
@@ -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].call(this, prop, $el, properties[prop].slice());
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.call(this, prop, el, steps, bgPos, attr)
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 image = getBackgroundImage.call(this, el);
201
+ const dimImage = getBackgroundImageDimensions(el);
196
202
 
197
- if (!image.naturalWidth) {
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
- function getBackgroundImage(el) {
249
+ const dimensions = {};
250
+ function getBackgroundImageDimensions(el) {
249
251
  const src = css(el, 'backgroundImage').replace(/^none|url\(["']?(.+?)["']?\)$/, '$1');
250
252
 
251
- const data = this._data;
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
- const img = new Image();
259
- img.src = src;
260
- if (!img.naturalWidth) {
261
- img.onload = () => this.$update();
262
- }
259
+ image.src = src;
263
260
 
264
- return data[src] = img;
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, endsWith, isDocument, isElement, isNumeric, isUndefined, isWindow, toFloat, toNode, toWindow, ucfirst} from './lang';
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
- return isNumeric(value)
161
- ? +value
162
- : endsWith(value, 'vh')
163
- ? percent(height(toWindow(element)), value)
164
- : endsWith(value, 'vw')
165
- ? percent(width(toWindow(element)), value)
166
- : endsWith(value, '%')
167
- ? percent(offsetDim
168
- ? dimension(property)(element)
169
- : dimensions(element)[property], value)
170
- : toFloat(value);
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
  }
@@ -31,7 +31,7 @@ export const fastdom = {
31
31
 
32
32
  };
33
33
 
34
- function flush(recursion = 1) {
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
  }
@@ -1,4 +1,4 @@
1
- import {assign, hasOwn, includes, isArray, isFunction, isUndefined, sortBy, startsWith} from './lang';
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 !options
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 {};
@@ -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
- element.scrollTop = top;
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="[{&quot;srcset&quot;: &quot;images/test.avif&quot;, &quot;type&quot;: &quot;image/avif&quot;},{&quot;srcset&quot;: &quot;images/test.webp&quot;, &quot;type&quot;: &quot;image/webp&quot;}]" 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 data-width="1800" data-height="1200" uk-img="target: !.uk-slideshow-items > :last-child, !* +*">
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 data-width="1800" data-height="1200" uk-img="target: !* -*, !* +*">
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 data-width="1800" data-height="1200" uk-img="target: !* -*, !* +*">
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 data-width="1800" data-height="1200" uk-img="target: !* -*, !.uk-slideshow-items > :first-child">
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="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
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="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
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="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
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="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
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="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
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="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
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="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
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="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
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="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
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="" data-width="400" data-height="600" uk-img="target: !.uk-slider-items">
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>dataSrcset</code></td>
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>false</td>
383
- <td>The image's `width` attribute. It will be used to determine the placeholder's width and the images position in the document.</td>
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: 1100px;">
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: 200vh">
25
- <div uk-sticky="bottom: #js-sticky-parallax-container; offset: 20vh">
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
- <div class="uk-position-center">
28
- <div class="uk-flex">
29
- <div>
30
- <h1 class="uk-heading-2xlarge" uk-parallax="target: #js-sticky-parallax-container; x: 0,-250,-250,0; easing: -1; start: 60vh; end: 100vh;">Sticky</h1>
31
- </div>
32
- <div>
33
- <h1 class="uk-heading-2xlarge" uk-parallax="target: #js-sticky-parallax-container; x: 0,250,250,0; easing: -1; start: 60vh; end: 100vh;">Parallax</h1>
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
- <img class="uk-position-relative uk-position-z-index" src="images/size-v.jpg" alt="" width="400" height="800">
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-tile uk-tile-muted uk-text-center" style="height: 100vh" uk-sticky="bottom: #js-sticky-parallax-viewport">
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: 0, 35vh; easing: 0">
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" class="uk-child-width-1-3" style="height: 250vh" uk-grid>
159
- <div class="uk-background-muted uk-width-expand">
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-position-relative uk-background-muted" style="height: 75vh"><div class="uk-position-bottom-center">75vh</div></div>
172
- <div class="uk-position-relative uk-background-primary uk-light" style="height: 50vh"><div class="uk-position-bottom-center">125vh</div></div>
173
- <div class="uk-position-relative uk-background-secondary uk-light" style="height: 50vh"><div class="uk-position-bottom-center">175vh</div></div>
174
- <div class="uk-position-relative uk-background-muted" style="height: 50vh"><div class="uk-position-bottom-center">225vh</div></div>
175
- <div class="uk-position-relative uk-background-primary uk-light" style="height: 25vh"><div class="uk-position-bottom-center">250vh</div></div>
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" class="uk-child-width-1-3" style="height: 250vh" uk-grid>
219
- <div class="uk-background-muted uk-width-expand">
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-position-relative uk-background-muted" style="height: 100vh"><div class="uk-position-bottom-center">100vh</div></div>
232
- <div class="uk-position-relative uk-background-primary uk-light" style="height: 50vh"><div class="uk-position-bottom-center">150vh</div></div>
233
- <div class="uk-position-relative uk-background-secondary uk-light" style="height: 50vh"><div class="uk-position-bottom-center">200vh</div></div>
234
- <div class="uk-position-relative uk-background-muted" style="height: 50vh"><div class="uk-position-bottom-center">250vh</div></div>
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>