uikit-sass-rails 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +15 -12
  4. data/lib/uikit/sass/rails/engine.rb +1 -1
  5. data/lib/uikit/sass/rails/version.rb +1 -1
  6. data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
  7. data/vendor/assets/fonts/fontawesome-webfont.otf +0 -0
  8. data/vendor/assets/fonts/fontawesome-webfont.svg +525 -464
  9. data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
  10. data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
  11. data/vendor/assets/fonts/fontawesome-webfont.woff2 +0 -0
  12. data/vendor/assets/javascripts/uikit.js +30 -3
  13. data/vendor/assets/javascripts/uikit/components/accordion.js +172 -0
  14. data/vendor/assets/javascripts/uikit/components/autocomplete.js +48 -27
  15. data/vendor/assets/javascripts/uikit/components/datepicker.js +2887 -97
  16. data/vendor/assets/javascripts/uikit/components/form-password.js +24 -19
  17. data/vendor/assets/javascripts/uikit/components/form-select.js +24 -18
  18. data/vendor/assets/javascripts/uikit/components/grid.js +524 -0
  19. data/vendor/assets/javascripts/uikit/components/htmleditor.js +46 -39
  20. data/vendor/assets/javascripts/uikit/components/lightbox.js +543 -0
  21. data/vendor/assets/javascripts/uikit/components/nestable.js +125 -98
  22. data/vendor/assets/javascripts/uikit/components/notify.js +34 -22
  23. data/vendor/assets/javascripts/uikit/components/pagination.js +24 -21
  24. data/vendor/assets/javascripts/uikit/components/parallax.js +400 -0
  25. data/vendor/assets/javascripts/uikit/components/search.js +19 -16
  26. data/vendor/assets/javascripts/uikit/components/slider.js +482 -0
  27. data/vendor/assets/javascripts/uikit/components/slideset.js +498 -0
  28. data/vendor/assets/javascripts/uikit/components/slideshow-fx.js +377 -0
  29. data/vendor/assets/javascripts/uikit/components/slideshow.js +540 -0
  30. data/vendor/assets/javascripts/uikit/components/sortable.js +392 -263
  31. data/vendor/assets/javascripts/uikit/components/sticky.js +127 -68
  32. data/vendor/assets/javascripts/uikit/components/timepicker.js +65 -42
  33. data/vendor/assets/javascripts/uikit/components/tooltip.js +220 -0
  34. data/vendor/assets/javascripts/uikit/components/upload.js +11 -10
  35. data/vendor/assets/javascripts/uikit/core/alert.js +66 -0
  36. data/vendor/assets/javascripts/uikit/core/button.js +154 -0
  37. data/vendor/assets/javascripts/uikit/core/core.js +717 -0
  38. data/vendor/assets/javascripts/uikit/{components → core}/cover.js +41 -35
  39. data/vendor/assets/javascripts/uikit/core/dropdown.js +296 -0
  40. data/vendor/assets/javascripts/uikit/core/grid.js +172 -0
  41. data/vendor/assets/javascripts/uikit/core/modal.js +323 -0
  42. data/vendor/assets/javascripts/uikit/core/nav.js +117 -0
  43. data/vendor/assets/javascripts/uikit/core/offcanvas.js +178 -0
  44. data/vendor/assets/javascripts/uikit/core/scrollspy.js +208 -0
  45. data/vendor/assets/javascripts/uikit/core/smooth-scroll.js +62 -0
  46. data/vendor/assets/javascripts/uikit/core/switcher.js +298 -0
  47. data/vendor/assets/javascripts/uikit/core/tab.js +159 -0
  48. data/vendor/assets/javascripts/uikit/core/toggle.js +117 -0
  49. data/vendor/assets/javascripts/uikit/core/touch.js +173 -0
  50. data/vendor/assets/javascripts/uikit/core/utility.js +157 -0
  51. data/vendor/assets/javascripts/uikit/uikit.js +1538 -871
  52. data/vendor/assets/stylesheets/extra/font-awesome.scss +4 -7
  53. data/vendor/assets/stylesheets/uikit.scss +22 -1
  54. data/vendor/assets/stylesheets/uikit/almost-flat.scss +22 -2
  55. data/vendor/assets/stylesheets/uikit/components/accordion.almost-flat.scss +45 -0
  56. data/vendor/assets/stylesheets/uikit/components/accordion.gradient.scss +45 -0
  57. data/vendor/assets/stylesheets/uikit/components/accordion.scss +43 -0
  58. data/vendor/assets/stylesheets/uikit/components/autocomplete.almost-flat.scss +62 -0
  59. data/vendor/assets/stylesheets/uikit/components/autocomplete.gradient.scss +62 -0
  60. data/vendor/assets/stylesheets/uikit/components/autocomplete.scss +60 -0
  61. data/vendor/assets/stylesheets/uikit/components/datepicker.almost-flat.scss +148 -0
  62. data/vendor/assets/stylesheets/uikit/components/datepicker.gradient.scss +158 -0
  63. data/vendor/assets/stylesheets/uikit/components/datepicker.scss +142 -0
  64. data/vendor/assets/stylesheets/uikit/components/dotnav.almost-flat.scss +152 -0
  65. data/vendor/assets/stylesheets/uikit/components/dotnav.gradient.scss +152 -0
  66. data/vendor/assets/stylesheets/uikit/components/dotnav.scss +148 -0
  67. data/vendor/assets/stylesheets/uikit/components/form-advanced.almost-flat.scss +92 -0
  68. data/vendor/assets/stylesheets/uikit/components/form-advanced.gradient.scss +92 -0
  69. data/vendor/assets/stylesheets/uikit/components/form-advanced.scss +92 -0
  70. data/vendor/assets/stylesheets/uikit/components/form-file.almost-flat.scss +36 -0
  71. data/vendor/assets/stylesheets/uikit/components/form-file.gradient.scss +36 -0
  72. data/vendor/assets/stylesheets/uikit/components/form-file.scss +36 -0
  73. data/vendor/assets/stylesheets/uikit/components/form-password.almost-flat.scss +37 -0
  74. data/vendor/assets/stylesheets/uikit/components/form-password.gradient.scss +37 -0
  75. data/vendor/assets/stylesheets/uikit/components/form-password.scss +37 -0
  76. data/vendor/assets/stylesheets/uikit/components/form-select.almost-flat.scss +37 -0
  77. data/vendor/assets/stylesheets/uikit/components/form-select.gradient.scss +37 -0
  78. data/vendor/assets/stylesheets/uikit/components/form-select.scss +37 -0
  79. data/vendor/assets/stylesheets/uikit/components/htmleditor.almost-flat.scss +282 -0
  80. data/vendor/assets/stylesheets/uikit/components/htmleditor.gradient.scss +290 -0
  81. data/vendor/assets/stylesheets/uikit/components/htmleditor.scss +208 -0
  82. data/vendor/assets/stylesheets/uikit/components/nestable.almost-flat.scss +137 -0
  83. data/vendor/assets/stylesheets/uikit/components/nestable.gradient.scss +141 -0
  84. data/vendor/assets/stylesheets/uikit/components/nestable.scss +134 -0
  85. data/vendor/assets/stylesheets/uikit/components/notify.almost-flat.scss +112 -0
  86. data/vendor/assets/stylesheets/uikit/components/notify.gradient.scss +112 -0
  87. data/vendor/assets/stylesheets/uikit/components/notify.scss +106 -0
  88. data/vendor/assets/stylesheets/uikit/components/placeholder.almost-flat.scss +36 -0
  89. data/vendor/assets/stylesheets/uikit/components/placeholder.gradient.scss +36 -0
  90. data/vendor/assets/stylesheets/uikit/components/placeholder.scss +36 -0
  91. data/vendor/assets/stylesheets/uikit/components/progress.almost-flat.scss +130 -0
  92. data/vendor/assets/stylesheets/uikit/components/progress.gradient.scss +138 -0
  93. data/vendor/assets/stylesheets/uikit/components/progress.scss +118 -0
  94. data/vendor/assets/stylesheets/uikit/components/search.almost-flat.scss +216 -0
  95. data/vendor/assets/stylesheets/uikit/components/search.gradient.scss +216 -0
  96. data/vendor/assets/stylesheets/uikit/components/search.scss +214 -0
  97. data/vendor/assets/stylesheets/uikit/components/slidenav.almost-flat.scss +110 -0
  98. data/vendor/assets/stylesheets/uikit/components/slidenav.gradient.scss +110 -0
  99. data/vendor/assets/stylesheets/uikit/components/slidenav.scss +110 -0
  100. data/vendor/assets/stylesheets/uikit/components/slider.almost-flat.scss +105 -0
  101. data/vendor/assets/stylesheets/uikit/components/slider.gradient.scss +105 -0
  102. data/vendor/assets/stylesheets/uikit/components/slider.scss +105 -0
  103. data/vendor/assets/stylesheets/uikit/components/slideshow.almost-flat.scss +166 -0
  104. data/vendor/assets/stylesheets/uikit/components/slideshow.gradient.scss +166 -0
  105. data/vendor/assets/stylesheets/uikit/components/slideshow.scss +166 -0
  106. data/vendor/assets/stylesheets/uikit/components/sortable.almost-flat.scss +90 -0
  107. data/vendor/assets/stylesheets/uikit/components/sortable.gradient.scss +90 -0
  108. data/vendor/assets/stylesheets/uikit/components/sortable.scss +90 -0
  109. data/vendor/assets/stylesheets/uikit/components/sticky.almost-flat.scss +39 -0
  110. data/vendor/assets/stylesheets/uikit/components/sticky.gradient.scss +39 -0
  111. data/vendor/assets/stylesheets/uikit/components/sticky.scss +39 -0
  112. data/vendor/assets/stylesheets/uikit/components/tooltip.almost-flat.scss +129 -0
  113. data/vendor/assets/stylesheets/uikit/components/tooltip.gradient.scss +129 -0
  114. data/vendor/assets/stylesheets/uikit/components/tooltip.scss +127 -0
  115. data/vendor/assets/stylesheets/uikit/components/upload.almost-flat.scss +11 -0
  116. data/vendor/assets/stylesheets/uikit/components/upload.gradient.scss +11 -0
  117. data/vendor/assets/stylesheets/uikit/components/upload.scss +11 -0
  118. data/vendor/assets/stylesheets/uikit/gradient.scss +22 -2
  119. data/vendor/assets/stylesheets/uikit/uikit.almost-flat.scss +1768 -498
  120. data/vendor/assets/stylesheets/uikit/uikit.gradient.scss +1776 -512
  121. data/vendor/assets/stylesheets/uikit/uikit.scss +1722 -462
  122. metadata +92 -7
  123. data/vendor/assets/stylesheets/uikit/components/uikit.components.almost-flat.scss +0 -1586
  124. data/vendor/assets/stylesheets/uikit/components/uikit.components.gradient.scss +0 -1608
  125. data/vendor/assets/stylesheets/uikit/components/uikit.components.scss +0 -1489
@@ -0,0 +1,377 @@
1
+ /*! UIkit 2.20.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ (function(addon) {
3
+
4
+ var component;
5
+
6
+ if (window.UIkit) {
7
+ component = addon(UIkit);
8
+ }
9
+
10
+ if (typeof define == "function" && define.amd) {
11
+ define("uikit-slideshow-fx", ["uikit"], function() {
12
+ return component || addon(UIkit);
13
+ });
14
+ }
15
+
16
+ })(function(UI) {
17
+
18
+ "use strict";
19
+
20
+ var Animations = UI.slideshow.animations;
21
+
22
+ UI.$.extend(UI.slideshow.animations, {
23
+ 'slice': function(current, next, dir, fromfx) {
24
+
25
+ if (!current.data('cover')) {
26
+ return Animations.fade.apply(this, arguments);
27
+ }
28
+
29
+ var d = UI.$.Deferred();
30
+
31
+ var sliceWidth = Math.ceil(this.element.width() / this.options.slices),
32
+ bgimage = next.data('cover').css('background-image'),
33
+ ghost = UI.$('<li></li>').css({
34
+ top : 0,
35
+ left : 0,
36
+ width : this.container.width(),
37
+ height : this.container.height(),
38
+ opacity: 1,
39
+ zIndex : 15
40
+ }),
41
+ ghostWidth = ghost.width(),
42
+ ghostHeight = ghost.height(),
43
+ pos = fromfx == 'slice-up' ? ghostHeight:'0',
44
+ bar;
45
+
46
+ for (var i = 0; i < this.options.slices; i++) {
47
+
48
+ if (fromfx == 'slice-up-down') {
49
+ pos = ((i % 2) + 2) % 2==0 ? '0':ghostHeight;
50
+ }
51
+
52
+ var width = (i == this.options.slices-1) ? sliceWidth : sliceWidth,
53
+ clipto = ('rect(0px, '+(width*(i+1))+'px, '+ghostHeight+'px, '+(sliceWidth*i)+'px)'),
54
+ clipfrom;
55
+
56
+ //slice-down - default
57
+ clipfrom = ('rect(0px, '+(width*(i+1))+'px, 0px, '+(sliceWidth*i)+'px)');
58
+
59
+ if (fromfx == 'slice-up' || (fromfx == 'slice-up-down' && ((i % 2) + 2) % 2==0 )) {
60
+ clipfrom = ('rect('+ghostHeight+'px, '+(width*(i+1))+'px, '+ghostHeight+'px, '+(sliceWidth*i)+'px)');
61
+ }
62
+
63
+ bar = UI.$('<div class="uk-cover-background"></div>').css({
64
+ 'position' : 'absolute',
65
+ 'top' : 0,
66
+ 'left' : 0,
67
+ 'width' : ghostWidth,
68
+ 'height' : ghostHeight,
69
+ 'background-image' : bgimage,
70
+ 'clip' : clipfrom,
71
+ 'opacity' : 0,
72
+ 'transition' : 'all '+this.options.duration+'ms ease-in-out '+(i*60)+'ms',
73
+ '-webkit-transition' : 'all '+this.options.duration+'ms ease-in-out '+(i*60)+'ms'
74
+
75
+ }).data('clip', clipto);
76
+
77
+ ghost.append(bar);
78
+ }
79
+
80
+ this.container.append(ghost);
81
+
82
+ ghost.children().last().on(UI.support.transition.end, function() {
83
+ ghost.remove();
84
+ d.resolve();
85
+ });
86
+
87
+ ghost.width();
88
+
89
+ ghost.children().each(function() {
90
+ var bar = UI.$(this);
91
+
92
+ bar.css({
93
+ 'clip': bar.data('clip'),
94
+ 'opacity': 1
95
+ });
96
+ });
97
+
98
+ return d.promise();
99
+ },
100
+
101
+ 'slice-up': function(current, next, dir) {
102
+ return Animations.slice.apply(this, [current, next, dir, 'slice-up']);
103
+ },
104
+
105
+ 'slice-down': function(current, next, dir) {
106
+ return Animations.slice.apply(this, [current, next, dir, 'slice-down']);
107
+ },
108
+
109
+ 'slice-up-down': function(current, next, dir) {
110
+ return Animations.slice.apply(this, [current, next, dir, 'slice-up-down']);
111
+ },
112
+
113
+ 'fold': function(current, next, dir) {
114
+
115
+ if (!next.data('cover')) {
116
+ return Animations.fade.apply(this, arguments);
117
+ }
118
+
119
+ var d = UI.$.Deferred();
120
+
121
+ var sliceWidth = Math.ceil(this.element.width() / this.options.slices),
122
+ bgimage = next.data('cover').css('background-image'),
123
+ ghost = UI.$('<li></li>').css({
124
+ width : next.width(),
125
+ height : next.height(),
126
+ opacity: 1,
127
+ zIndex : 15
128
+ }),
129
+ ghostWidth = next.width(),
130
+ ghostHeight = next.height(),
131
+ bar;
132
+
133
+ for (var i = 0; i < this.options.slices; i++) {
134
+
135
+ var width = (i == this.options.slices-1) ? (ghostWidth - (sliceWidth*i)) : sliceWidth;
136
+
137
+ bar = UI.$('<div class="uk-cover-background"></div>').css({
138
+ 'position' : 'absolute',
139
+ 'top' : 0,
140
+ 'left' : 0,
141
+ 'width' : ghostWidth,
142
+ 'height' : ghostHeight,
143
+ 'background-image' : bgimage,
144
+ 'transform-origin' : (sliceWidth*i)+'px 0 0',
145
+ 'clip' : ('rect(0px, '+(sliceWidth*(i+1))+'px, '+ghostHeight+'px, '+(sliceWidth*i)+'px)'),
146
+ 'opacity' : 0,
147
+ 'transform' : 'scaleX(0.000001)',
148
+ 'transition' : 'all '+this.options.duration+'ms ease-in-out '+(100+i*60)+'ms',
149
+ '-webkit-transition' : 'all '+this.options.duration+'ms ease-in-out '+(100+i*60)+'ms'
150
+ });
151
+
152
+ ghost.prepend(bar);
153
+ }
154
+
155
+ this.container.append(ghost);
156
+
157
+ ghost.width();
158
+
159
+ ghost.children().first().on(UI.support.transition.end, function() {
160
+ ghost.remove();
161
+ d.resolve();
162
+ }).end().css({
163
+ 'transform': 'scaleX(1)',
164
+ 'opacity': 1
165
+ });
166
+
167
+ return d.promise();
168
+ },
169
+
170
+ 'puzzle': function(current, next, dir) {
171
+
172
+ if (!next.data('cover')) {
173
+ return Animations.fade.apply(this, arguments);
174
+ }
175
+
176
+ var d = UI.$.Deferred(), $this = this;
177
+
178
+ var boxCols = Math.round(this.options.slices/2),
179
+ boxWidth = Math.round(next.width()/boxCols),
180
+ boxRows = Math.round(next.height()/boxWidth),
181
+ boxHeight = Math.round(next.height()/boxRows)+1,
182
+ bgimage = next.data('cover').css('background-image'),
183
+ ghost = UI.$('<li></li>').css({
184
+ width : this.container.width(),
185
+ height : this.container.height(),
186
+ opacity : 1,
187
+ zIndex : 15
188
+ }),
189
+ ghostWidth = this.container.width(),
190
+ ghostHeight = this.container.height(),
191
+ box, rect, width;
192
+
193
+ for (var rows = 0; rows < boxRows; rows++) {
194
+
195
+ for (var cols = 0; cols < boxCols; cols++) {
196
+
197
+ width = (cols == boxCols-1) ? (boxWidth + 2) : boxWidth;
198
+
199
+ rect = [
200
+ (boxHeight * rows) +'px', // top
201
+ (width * (cols+1)) +'px', // right
202
+ (boxHeight * (rows + 1)) +'px', // bottom
203
+ (boxWidth * cols) +'px' // left
204
+ ];
205
+
206
+ box = UI.$('<div class="uk-cover-background"></div>').css({
207
+ 'position' : 'absolute',
208
+ 'top' : 0,
209
+ 'left' : 0,
210
+ 'opacity' : 0,
211
+ 'width' : ghostWidth,
212
+ 'height' : ghostHeight,
213
+ 'background-image' : bgimage,
214
+ 'clip' : ('rect('+rect.join(',')+')'),
215
+ '-webkit-transform' : 'translateZ(0)', // fixes webkit opacity flickering bug
216
+ 'transform' : 'translateZ(0)' // fixes moz opacity flickering bug
217
+ });
218
+
219
+ ghost.append(box);
220
+ }
221
+ }
222
+
223
+ this.container.append(ghost);
224
+
225
+ var boxes = shuffle(ghost.children());
226
+
227
+ boxes.each(function(i) {
228
+ UI.$(this).css({
229
+ 'transition': 'all '+$this.options.duration+'ms ease-in-out '+(50+i*25)+'ms',
230
+ '-webkit-transition': 'all '+$this.options.duration+'ms ease-in-out '+(50+i*25)+'ms'
231
+ });
232
+ }).last().on(UI.support.transition.end, function() {
233
+ ghost.remove();
234
+ d.resolve();
235
+ });
236
+
237
+ ghost.width();
238
+
239
+ boxes.css({'opacity': 1});
240
+
241
+ return d.promise();
242
+ },
243
+
244
+ 'boxes': function(current, next, dir, fromfx) {
245
+
246
+ if (!next.data('cover')) {
247
+ return Animations.fade.apply(this, arguments);
248
+ }
249
+
250
+ var d = UI.$.Deferred();
251
+
252
+ var boxCols = Math.round(this.options.slices/2),
253
+ boxWidth = Math.round(next.width()/boxCols),
254
+ boxRows = Math.round(next.height()/boxWidth),
255
+ boxHeight = Math.round(next.height()/boxRows)+1,
256
+ bgimage = next.data('cover').css('background-image'),
257
+ ghost = UI.$('<li></li>').css({
258
+ width : next.width(),
259
+ height : next.height(),
260
+ opacity : 1,
261
+ zIndex : 15
262
+ }),
263
+ ghostWidth = next.width(),
264
+ ghostHeight = next.height(),
265
+ box, rect, width, cols;
266
+
267
+ for (var rows = 0; rows < boxRows; rows++) {
268
+
269
+ for (cols = 0; cols < boxCols; cols++) {
270
+
271
+ width = (cols == boxCols-1) ? (boxWidth + 2) : boxWidth;
272
+
273
+ rect = [
274
+ (boxHeight * rows) +'px', // top
275
+ (width * (cols+1)) +'px', // right
276
+ (boxHeight * (rows + 1)) +'px', // bottom
277
+ (boxWidth * cols) +'px' // left
278
+ ];
279
+
280
+ box = UI.$('<div class="uk-cover-background"></div>').css({
281
+ 'position' : 'absolute',
282
+ 'top' : 0,
283
+ 'left' : 0,
284
+ 'opacity' : 1,
285
+ 'width' : ghostWidth,
286
+ 'height' : ghostHeight,
287
+ 'background-image' : bgimage,
288
+ 'transform-origin' : rect[3]+' '+rect[0]+' 0',
289
+ 'clip' : ('rect('+rect.join(',')+')'),
290
+ '-webkit-transform' : 'scale(0.0000000000000001)',
291
+ 'transform' : 'scale(0.0000000000000001)'
292
+ });
293
+
294
+ ghost.append(box);
295
+ }
296
+ }
297
+
298
+ this.container.append(ghost);
299
+
300
+ var rowIndex = 0, colIndex = 0, timeBuff = 0, box2Darr = [[]], boxes = ghost.children(), prevCol;
301
+
302
+ if (fromfx == 'boxes-reverse') {
303
+ boxes = [].reverse.apply(boxes);
304
+ }
305
+
306
+ boxes.each(function() {
307
+
308
+ box2Darr[rowIndex][colIndex] = UI.$(this);
309
+ colIndex++;
310
+
311
+ if(colIndex == boxCols) {
312
+ rowIndex++;
313
+ colIndex = 0;
314
+ box2Darr[rowIndex] = [];
315
+ }
316
+ });
317
+
318
+ for (cols = 0, prevCol = 0; cols < (boxCols * boxRows); cols++) {
319
+
320
+ prevCol = cols;
321
+
322
+ for (var row = 0; row < boxRows; row++) {
323
+
324
+ if (prevCol >= 0 && prevCol < boxCols) {
325
+
326
+ box2Darr[row][prevCol].css({
327
+ 'transition': 'all '+this.options.duration+'ms linear '+(50+timeBuff)+'ms',
328
+ '-webkit-transition': 'all '+this.options.duration+'ms linear '+(50+timeBuff)+'ms'
329
+ });
330
+ }
331
+ prevCol--;
332
+ }
333
+ timeBuff += 100;
334
+ }
335
+
336
+ boxes.last().on(UI.support.transition.end, function() {
337
+ ghost.remove();
338
+ d.resolve();
339
+ });
340
+
341
+ ghost.width();
342
+
343
+ boxes.css({
344
+ '-webkit-transform': 'scale(1)',
345
+ 'transform': 'scale(1)'
346
+ });
347
+
348
+ return d.promise();
349
+ },
350
+
351
+ 'boxes-reverse': function(current, next, dir) {
352
+ return Animations.boxes.apply(this, [current, next, dir, 'boxes-reverse']);
353
+ },
354
+
355
+ 'random-fx': function(){
356
+
357
+ var animations = ['slice-up', 'fold', 'puzzle', 'slice-down', 'boxes', 'slice-up-down', 'boxes-reverse'];
358
+
359
+ this.fxIndex = (this.fxIndex === undefined ? -1 : this.fxIndex) + 1;
360
+
361
+ if (!animations[this.fxIndex]) this.fxIndex = 0;
362
+
363
+ return Animations[animations[this.fxIndex]].apply(this, arguments);
364
+ },
365
+ });
366
+
367
+
368
+ // helper functions
369
+
370
+ // Shuffle an array
371
+ var shuffle = function(arr) {
372
+ for (var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x) {}
373
+ return arr;
374
+ };
375
+
376
+ return UI.slideshow.animations;
377
+ });
@@ -0,0 +1,540 @@
1
+ /*! UIkit 2.20.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ (function(addon) {
3
+
4
+ var component;
5
+
6
+ if (window.UIkit) {
7
+ component = addon(UIkit);
8
+ }
9
+
10
+ if (typeof define == "function" && define.amd) {
11
+ define("uikit-slideshow", ["uikit"], function() {
12
+ return component || addon(UIkit);
13
+ });
14
+ }
15
+
16
+ })(function(UI) {
17
+
18
+ "use strict";
19
+
20
+ var Animations, playerId = 0;
21
+
22
+ UI.component('slideshow', {
23
+
24
+ defaults: {
25
+ animation : "fade",
26
+ duration : 500,
27
+ height : "auto",
28
+ start : 0,
29
+ autoplay : false,
30
+ autoplayInterval : 7000,
31
+ videoautoplay : true,
32
+ videomute : true,
33
+ kenburns : false,
34
+ slices : 15,
35
+ pauseOnHover : true
36
+ },
37
+
38
+ current : false,
39
+ interval : null,
40
+ hovering : false,
41
+
42
+ boot: function() {
43
+
44
+ // init code
45
+ UI.ready(function(context) {
46
+
47
+ UI.$('[data-uk-slideshow]', context).each(function() {
48
+
49
+ var slideshow = UI.$(this);
50
+
51
+ if (!slideshow.data("slideshow")) {
52
+ var obj = UI.slideshow(slideshow, UI.Utils.options(slideshow.attr("data-uk-slideshow")));
53
+ }
54
+ });
55
+ });
56
+ },
57
+
58
+ init: function() {
59
+
60
+ var $this = this, canvas, kbanimduration;
61
+
62
+ this.container = this.element.hasClass('uk-slideshow') ? this.element : UI.$(this.find('.uk-slideshow'));
63
+ this.slides = this.container.children();
64
+ this.slidesCount = this.slides.length;
65
+ this.current = this.options.start;
66
+ this.animating = false;
67
+ this.triggers = this.find('[data-uk-slideshow-item]');
68
+ this.fixFullscreen = navigator.userAgent.match(/(iPad|iPhone|iPod)/g) && this.container.hasClass('uk-slideshow-fullscreen'); // viewport unit fix for height:100vh - should be fixed in iOS 8
69
+
70
+ if (this.options.kenburns) {
71
+
72
+ kbanimduration = this.options.kenburns === true ? '15s': this.options.kenburns;
73
+
74
+ if (!String(kbanimduration).match(/(ms|s)$/)) {
75
+ kbanimduration += 'ms';
76
+ }
77
+ }
78
+
79
+ this.slides.each(function(index) {
80
+
81
+ var slide = UI.$(this),
82
+ media = slide.children('img,video,iframe').eq(0);
83
+
84
+ slide.data('media', media);
85
+ slide.data('sizer', media);
86
+
87
+ if (media.length) {
88
+
89
+ var placeholder;
90
+
91
+ switch(media[0].nodeName) {
92
+ case 'IMG':
93
+
94
+ var cover = UI.$('<div class="uk-cover-background uk-position-cover"></div>').css({'background-image':'url('+ media.attr('src') + ')'});
95
+
96
+ media.css({'width': '100%','height': 'auto'});
97
+ slide.prepend(cover).data('cover', cover);
98
+ break;
99
+
100
+ case 'IFRAME':
101
+
102
+ var src = media[0].src, iframeId = 'sw-'+(++playerId);
103
+
104
+ media
105
+ .attr('src', '').on('load', function(){
106
+
107
+ if (index !== $this.current || (index == $this.current && !$this.options.videoautoplay)) {
108
+ $this.pausemedia(media);
109
+ }
110
+
111
+ if ($this.options.videomute) {
112
+
113
+ $this.mutemedia(media);
114
+
115
+ var inv = setInterval((function(ic) {
116
+ return function() {
117
+ $this.mutemedia(media);
118
+ if (++ic >= 4) clearInterval(inv);
119
+ }
120
+ })(0), 250);
121
+ }
122
+
123
+ })
124
+ .data('slideshow', $this) // add self-reference for the vimeo-ready listener
125
+ .attr('data-player-id', iframeId) // add frameId for the vimeo-ready listener
126
+ .attr('src', [src, (src.indexOf('?') > -1 ? '&':'?'), 'enablejsapi=1&api=1&player_id='+iframeId].join(''))
127
+ .addClass('uk-position-absolute');
128
+
129
+ // disable pointer events
130
+ if(!UI.support.touch) media.css('pointer-events', 'none');
131
+
132
+ placeholder = true;
133
+
134
+ if (UI.cover) {
135
+ UI.cover(media);
136
+ media.attr('data-uk-cover', '{}');
137
+ }
138
+
139
+ break;
140
+
141
+ case 'VIDEO':
142
+ media.addClass('uk-cover-object uk-position-absolute');
143
+ placeholder = true;
144
+
145
+ if ($this.options.videomute) $this.mutemedia(media);
146
+ }
147
+
148
+ if (placeholder) {
149
+
150
+ canvas = UI.$('<canvas></canvas>').attr({'width': media[0].width, 'height': media[0].height});
151
+ var img = UI.$('<img style="width:100%;height:auto;">').attr('src', canvas[0].toDataURL());
152
+
153
+ slide.prepend(img);
154
+ slide.data('sizer', img);
155
+ }
156
+
157
+ } else {
158
+ slide.data('sizer', slide);
159
+ }
160
+
161
+ if ($this.hasKenBurns(slide)) {
162
+
163
+ slide.data('cover').css({
164
+ '-webkit-animation-duration': kbanimduration,
165
+ 'animation-duration': kbanimduration
166
+ });
167
+ }
168
+ });
169
+
170
+ this.on("click.uikit.slideshow", '[data-uk-slideshow-item]', function(e) {
171
+
172
+ e.preventDefault();
173
+
174
+ var slide = UI.$(this).attr('data-uk-slideshow-item');
175
+
176
+ if ($this.current == slide) return;
177
+
178
+ switch(slide) {
179
+ case 'next':
180
+ case 'previous':
181
+ $this[slide=='next' ? 'next':'previous']();
182
+ break;
183
+ default:
184
+ $this.show(parseInt(slide, 10));
185
+ }
186
+
187
+ $this.stop();
188
+ });
189
+
190
+ // Set start slide
191
+ this.slides.attr('aria-hidden', 'true').eq(this.current).addClass('uk-active').attr('aria-hidden', 'false');
192
+ this.triggers.filter('[data-uk-slideshow-item="'+this.current+'"]').addClass('uk-active');
193
+
194
+ UI.$win.on("resize load", UI.Utils.debounce(function() {
195
+ $this.resize();
196
+
197
+ if ($this.fixFullscreen) {
198
+ $this.container.css('height', window.innerHeight);
199
+ $this.slides.css('height', window.innerHeight);
200
+ }
201
+ }, 100));
202
+
203
+ // chrome image load fix
204
+ setTimeout(function(){
205
+ $this.resize();
206
+ }, 80);
207
+
208
+ // Set autoplay
209
+ if (this.options.autoplay) {
210
+ this.start();
211
+ }
212
+
213
+ if (this.options.videoautoplay && this.slides.eq(this.current).data('media')) {
214
+ this.playmedia(this.slides.eq(this.current).data('media'));
215
+ }
216
+
217
+ if (this.options.kenburns) {
218
+ this.applyKenBurns(this.slides.eq(this.current));
219
+ }
220
+
221
+ this.container.on({
222
+ mouseenter: function() { if ($this.options.pauseOnHover) $this.hovering = true; },
223
+ mouseleave: function() { $this.hovering = false; }
224
+ });
225
+
226
+ this.on('swipeRight swipeLeft', function(e) {
227
+ $this[e.type=='swipeLeft' ? 'next' : 'previous']();
228
+ });
229
+
230
+ this.on('display.uk.check', function(){
231
+ if ($this.element.is(":visible")) {
232
+
233
+ $this.resize();
234
+
235
+ if ($this.fixFullscreen) {
236
+ $this.container.css('height', window.innerHeight);
237
+ $this.slides.css('height', window.innerHeight);
238
+ }
239
+ }
240
+ });
241
+ },
242
+
243
+
244
+ resize: function() {
245
+
246
+ if (this.container.hasClass('uk-slideshow-fullscreen')) return;
247
+
248
+ var $this = this, height = this.options.height;
249
+
250
+ if (this.options.height === 'auto') {
251
+
252
+ height = 0;
253
+
254
+ this.slides.css('height', '').each(function() {
255
+ height = Math.max(height, UI.$(this).height());
256
+ });
257
+ }
258
+
259
+ this.container.css('height', height);
260
+ this.slides.css('height', height);
261
+ },
262
+
263
+ show: function(index, direction) {
264
+
265
+ if (this.animating || this.current == index) return;
266
+
267
+ this.animating = true;
268
+
269
+ var $this = this,
270
+ current = this.slides.eq(this.current),
271
+ next = this.slides.eq(index),
272
+ dir = direction ? direction : this.current < index ? -1 : 1,
273
+ currentmedia = current.data('media'),
274
+ animation = Animations[this.options.animation] ? this.options.animation : 'fade',
275
+ nextmedia = next.data('media'),
276
+ finalize = function() {
277
+
278
+ if (!$this.animating) return;
279
+
280
+ if (currentmedia && currentmedia.is('video,iframe')) {
281
+ $this.pausemedia(currentmedia);
282
+ }
283
+
284
+ if (nextmedia && nextmedia.is('video,iframe')) {
285
+ $this.playmedia(nextmedia);
286
+ }
287
+
288
+ next.addClass("uk-active").attr('aria-hidden', 'false');
289
+ current.removeClass("uk-active").attr('aria-hidden', 'true');
290
+
291
+ $this.animating = false;
292
+ $this.current = index;
293
+
294
+ UI.Utils.checkDisplay(next, '[class*="uk-animation-"]:not(.uk-cover-background.uk-position-cover)');
295
+
296
+ $this.trigger('show.uk.slideshow', [next]);
297
+ };
298
+
299
+ $this.applyKenBurns(next);
300
+
301
+ // animation fallback
302
+ if (!UI.support.animation) {
303
+ animation = 'none';
304
+ }
305
+
306
+ current = UI.$(current);
307
+ next = UI.$(next);
308
+
309
+ Animations[animation].apply(this, [current, next, dir]).then(finalize);
310
+
311
+ $this.triggers.removeClass('uk-active');
312
+ $this.triggers.filter('[data-uk-slideshow-item="'+index+'"]').addClass('uk-active');
313
+ },
314
+
315
+ applyKenBurns: function(slide) {
316
+
317
+ if (!this.hasKenBurns(slide)) {
318
+ return;
319
+ }
320
+
321
+ var animations = [
322
+ 'uk-animation-middle-left',
323
+ 'uk-animation-top-right',
324
+ 'uk-animation-bottom-left',
325
+ 'uk-animation-top-center',
326
+ '', // middle-center
327
+ 'uk-animation-bottom-right'
328
+ ],
329
+ index = this.kbindex || 0;
330
+
331
+
332
+ slide.data('cover').attr('class', 'uk-cover-background uk-position-cover').width();
333
+ slide.data('cover').addClass(['uk-animation-scale', 'uk-animation-reverse', animations[index]].join(' '));
334
+
335
+ this.kbindex = animations[index + 1] ? (index+1):0;
336
+ },
337
+
338
+ hasKenBurns: function(slide) {
339
+ return (this.options.kenburns && slide.data('cover'));
340
+ },
341
+
342
+ next: function() {
343
+ this.show(this.slides[this.current + 1] ? (this.current + 1) : 0);
344
+ },
345
+
346
+ previous: function() {
347
+ this.show(this.slides[this.current - 1] ? (this.current - 1) : (this.slides.length - 1));
348
+ },
349
+
350
+ start: function() {
351
+
352
+ this.stop();
353
+
354
+ var $this = this;
355
+
356
+ this.interval = setInterval(function() {
357
+ if (!$this.hovering) $this.next();
358
+ }, this.options.autoplayInterval);
359
+
360
+ },
361
+
362
+ stop: function() {
363
+ if (this.interval) clearInterval(this.interval);
364
+ },
365
+
366
+ playmedia: function(media) {
367
+
368
+ if (!(media && media[0])) return;
369
+
370
+ switch(media[0].nodeName) {
371
+ case 'VIDEO':
372
+
373
+ if (!this.options.videomute) {
374
+ media[0].muted = false;
375
+ }
376
+
377
+ media[0].play();
378
+ break;
379
+ case 'IFRAME':
380
+
381
+ if (!this.options.videomute) {
382
+ media[0].contentWindow.postMessage('{ "event": "command", "func": "unmute", "method":"setVolume", "value":1}', '*');
383
+ }
384
+
385
+ media[0].contentWindow.postMessage('{ "event": "command", "func": "playVideo", "method":"play"}', '*');
386
+ break;
387
+ }
388
+ },
389
+
390
+ pausemedia: function(media) {
391
+
392
+ switch(media[0].nodeName) {
393
+ case 'VIDEO':
394
+ media[0].pause();
395
+ break;
396
+ case 'IFRAME':
397
+ media[0].contentWindow.postMessage('{ "event": "command", "func": "pauseVideo", "method":"pause"}', '*');
398
+ break;
399
+ }
400
+ },
401
+
402
+ mutemedia: function(media) {
403
+
404
+ switch(media[0].nodeName) {
405
+ case 'VIDEO':
406
+ media[0].muted = true;
407
+ break;
408
+ case 'IFRAME':
409
+ media[0].contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}', '*');
410
+ break;
411
+ }
412
+ }
413
+ });
414
+
415
+ Animations = {
416
+
417
+ 'none': function() {
418
+
419
+ var d = UI.$.Deferred();
420
+ d.resolve();
421
+ return d.promise();
422
+ },
423
+
424
+ 'scroll': function(current, next, dir) {
425
+
426
+ var d = UI.$.Deferred();
427
+
428
+ current.css('animation-duration', this.options.duration+'ms');
429
+ next.css('animation-duration', this.options.duration+'ms');
430
+
431
+ next.css('opacity', 1).one(UI.support.animation.end, function() {
432
+
433
+ current.removeClass(dir === 1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
434
+ next.css('opacity', '').removeClass(dir === 1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
435
+ d.resolve();
436
+
437
+ }.bind(this));
438
+
439
+ current.addClass(dir == 1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
440
+ next.addClass(dir == 1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
441
+ next.width(); // force redraw
442
+
443
+ return d.promise();
444
+ },
445
+
446
+ 'swipe': function(current, next, dir) {
447
+
448
+ var d = UI.$.Deferred();
449
+
450
+ current.css('animation-duration', this.options.duration+'ms');
451
+ next.css('animation-duration', this.options.duration+'ms');
452
+
453
+ next.css('opacity', 1).one(UI.support.animation.end, function() {
454
+
455
+ current.removeClass(dir === 1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
456
+ next.css('opacity', '').removeClass(dir === 1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
457
+ d.resolve();
458
+
459
+ }.bind(this));
460
+
461
+ current.addClass(dir == 1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
462
+ next.addClass(dir == 1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
463
+ next.width(); // force redraw
464
+
465
+ return d.promise();
466
+ },
467
+
468
+ 'scale': function(current, next, dir) {
469
+
470
+ var d = UI.$.Deferred();
471
+
472
+ current.css('animation-duration', this.options.duration+'ms');
473
+ next.css('animation-duration', this.options.duration+'ms');
474
+
475
+ next.css('opacity', 1);
476
+
477
+ current.one(UI.support.animation.end, function() {
478
+
479
+ current.removeClass('uk-slideshow-scale-out');
480
+ next.css('opacity', '');
481
+ d.resolve();
482
+
483
+ }.bind(this));
484
+
485
+ current.addClass('uk-slideshow-scale-out');
486
+ current.width(); // force redraw
487
+
488
+ return d.promise();
489
+ },
490
+
491
+ 'fade': function(current, next, dir) {
492
+
493
+ var d = UI.$.Deferred();
494
+
495
+ current.css('animation-duration', this.options.duration+'ms');
496
+ next.css('animation-duration', this.options.duration+'ms');
497
+
498
+ next.css('opacity', 1);
499
+
500
+ current.one(UI.support.animation.end, function() {
501
+
502
+ current.removeClass('uk-slideshow-fade-out');
503
+ next.css('opacity', '');
504
+ d.resolve();
505
+
506
+ }.bind(this));
507
+
508
+ current.addClass('uk-slideshow-fade-out');
509
+ current.width(); // force redraw
510
+
511
+ return d.promise();
512
+ }
513
+ };
514
+
515
+ UI.slideshow.animations = Animations;
516
+
517
+ // Listen for messages from the vimeo player
518
+ window.addEventListener('message', function onMessageReceived(e) {
519
+
520
+ var data = e.data, iframe;
521
+
522
+ if (typeof(data) == 'string') {
523
+
524
+ try {
525
+ data = JSON.parse(data);
526
+ } catch(err) {
527
+ data = {};
528
+ }
529
+ }
530
+
531
+ if (e.origin && e.origin.indexOf('vimeo') > -1 && data.event == 'ready' && data.player_id) {
532
+ iframe = UI.$('[data-player-id="'+ data.player_id+'"]');
533
+
534
+ if (iframe.length) {
535
+ iframe.data('slideshow').mutemedia(iframe);
536
+ }
537
+ }
538
+ }, false);
539
+
540
+ });