uikit2-rails 0.1.0

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