foundation6-jekyll-base 0.0.1

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 (160) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +2 -0
  4. data/_includes/footer.html +1 -0
  5. data/_includes/head.html +16 -0
  6. data/_includes/header.html +1 -0
  7. data/_includes/javascripts.html +4 -0
  8. data/_layouts/default.html +18 -0
  9. data/_layouts/home.html +26 -0
  10. data/_layouts/page.html +15 -0
  11. data/_layouts/post.html +25 -0
  12. data/_sass/_vendor/normalize-scss/sass/_normalize.scss +3 -0
  13. data/_sass/_vendor/normalize-scss/sass/normalize/_import-now.scss +11 -0
  14. data/_sass/_vendor/normalize-scss/sass/normalize/_normalize-mixin.scss +676 -0
  15. data/_sass/_vendor/normalize-scss/sass/normalize/_variables.scss +36 -0
  16. data/_sass/_vendor/normalize-scss/sass/normalize/_vertical-rhythm.scss +61 -0
  17. data/_sass/_vendor/sassy-lists/stylesheets/functions/_purge.scss +38 -0
  18. data/_sass/_vendor/sassy-lists/stylesheets/functions/_remove.scss +31 -0
  19. data/_sass/_vendor/sassy-lists/stylesheets/functions/_replace.scss +46 -0
  20. data/_sass/_vendor/sassy-lists/stylesheets/functions/_to-list.scss +27 -0
  21. data/_sass/_vendor/sassy-lists/stylesheets/helpers/_missing-dependencies.scss +25 -0
  22. data/_sass/_vendor/sassy-lists/stylesheets/helpers/_true.scss +13 -0
  23. data/_sass/foundation/_global.scss +219 -0
  24. data/_sass/foundation/components/_accordion-menu.scss +36 -0
  25. data/_sass/foundation/components/_accordion.scss +150 -0
  26. data/_sass/foundation/components/_badge.scss +63 -0
  27. data/_sass/foundation/components/_breadcrumbs.scss +97 -0
  28. data/_sass/foundation/components/_button-group.scss +249 -0
  29. data/_sass/foundation/components/_button.scss +303 -0
  30. data/_sass/foundation/components/_callout.scss +106 -0
  31. data/_sass/foundation/components/_card.scss +121 -0
  32. data/_sass/foundation/components/_close-button.scss +102 -0
  33. data/_sass/foundation/components/_drilldown.scss +93 -0
  34. data/_sass/foundation/components/_dropdown-menu.scss +226 -0
  35. data/_sass/foundation/components/_dropdown.scss +72 -0
  36. data/_sass/foundation/components/_flex-video.scss +1 -0
  37. data/_sass/foundation/components/_flex.scss +28 -0
  38. data/_sass/foundation/components/_float.scss +27 -0
  39. data/_sass/foundation/components/_label.scss +64 -0
  40. data/_sass/foundation/components/_media-object.scss +114 -0
  41. data/_sass/foundation/components/_menu-icon.scss +9 -0
  42. data/_sass/foundation/components/_menu.scss +371 -0
  43. data/_sass/foundation/components/_off-canvas.scss +329 -0
  44. data/_sass/foundation/components/_orbit.scss +196 -0
  45. data/_sass/foundation/components/_pagination.scss +193 -0
  46. data/_sass/foundation/components/_progress-bar.scss +64 -0
  47. data/_sass/foundation/components/_responsive-embed.scss +67 -0
  48. data/_sass/foundation/components/_reveal.scss +178 -0
  49. data/_sass/foundation/components/_slider.scss +138 -0
  50. data/_sass/foundation/components/_sticky.scss +38 -0
  51. data/_sass/foundation/components/_switch.scss +247 -0
  52. data/_sass/foundation/components/_table.scss +329 -0
  53. data/_sass/foundation/components/_tabs.scss +196 -0
  54. data/_sass/foundation/components/_thumbnail.scss +67 -0
  55. data/_sass/foundation/components/_title-bar.scss +84 -0
  56. data/_sass/foundation/components/_tooltip.scss +107 -0
  57. data/_sass/foundation/components/_top-bar.scss +173 -0
  58. data/_sass/foundation/components/_visibility.scss +132 -0
  59. data/_sass/foundation/forms/_checkbox.scss +41 -0
  60. data/_sass/foundation/forms/_error.scss +88 -0
  61. data/_sass/foundation/forms/_fieldset.scss +54 -0
  62. data/_sass/foundation/forms/_forms.scss +34 -0
  63. data/_sass/foundation/forms/_help-text.scss +30 -0
  64. data/_sass/foundation/forms/_input-group.scss +135 -0
  65. data/_sass/foundation/forms/_label.scss +50 -0
  66. data/_sass/foundation/forms/_meter.scss +110 -0
  67. data/_sass/foundation/forms/_progress.scss +94 -0
  68. data/_sass/foundation/forms/_range.scss +149 -0
  69. data/_sass/foundation/forms/_select.scss +85 -0
  70. data/_sass/foundation/forms/_text.scss +170 -0
  71. data/_sass/foundation/foundation.scss +118 -0
  72. data/_sass/foundation/grid/_classes.scss +176 -0
  73. data/_sass/foundation/grid/_column.scss +112 -0
  74. data/_sass/foundation/grid/_flex-grid.scss +307 -0
  75. data/_sass/foundation/grid/_grid.scss +44 -0
  76. data/_sass/foundation/grid/_gutter.scss +82 -0
  77. data/_sass/foundation/grid/_layout.scss +76 -0
  78. data/_sass/foundation/grid/_position.scss +76 -0
  79. data/_sass/foundation/grid/_row.scss +99 -0
  80. data/_sass/foundation/grid/_size.scss +24 -0
  81. data/_sass/foundation/settings/_settings.scss +621 -0
  82. data/_sass/foundation/typography/_alignment.scss +22 -0
  83. data/_sass/foundation/typography/_base.scss +509 -0
  84. data/_sass/foundation/typography/_helpers.scss +78 -0
  85. data/_sass/foundation/typography/_print.scss +81 -0
  86. data/_sass/foundation/typography/_typography.scss +26 -0
  87. data/_sass/foundation/util/_breakpoint.scss +281 -0
  88. data/_sass/foundation/util/_color.scss +126 -0
  89. data/_sass/foundation/util/_direction.scss +31 -0
  90. data/_sass/foundation/util/_flex.scss +85 -0
  91. data/_sass/foundation/util/_math.scss +72 -0
  92. data/_sass/foundation/util/_mixins.scss +276 -0
  93. data/_sass/foundation/util/_selector.scss +41 -0
  94. data/_sass/foundation/util/_unit.scss +152 -0
  95. data/_sass/foundation/util/_util.scss +13 -0
  96. data/_sass/foundation/util/_value.scss +140 -0
  97. data/assets/js/app.js +1 -0
  98. data/assets/js/vendor/foundation/foundation.d.ts +496 -0
  99. data/assets/js/vendor/foundation/foundation.js +10207 -0
  100. data/assets/js/vendor/foundation/foundation.min.js +4 -0
  101. data/assets/js/vendor/foundation/plugins/foundation.abide.js +637 -0
  102. data/assets/js/vendor/foundation/plugins/foundation.abide.min.js +1 -0
  103. data/assets/js/vendor/foundation/plugins/foundation.accordion.js +252 -0
  104. data/assets/js/vendor/foundation/plugins/foundation.accordion.min.js +1 -0
  105. data/assets/js/vendor/foundation/plugins/foundation.accordionMenu.js +318 -0
  106. data/assets/js/vendor/foundation/plugins/foundation.accordionMenu.min.js +1 -0
  107. data/assets/js/vendor/foundation/plugins/foundation.core.js +386 -0
  108. data/assets/js/vendor/foundation/plugins/foundation.core.min.js +1 -0
  109. data/assets/js/vendor/foundation/plugins/foundation.drilldown.js +565 -0
  110. data/assets/js/vendor/foundation/plugins/foundation.drilldown.min.js +1 -0
  111. data/assets/js/vendor/foundation/plugins/foundation.dropdown.js +465 -0
  112. data/assets/js/vendor/foundation/plugins/foundation.dropdown.min.js +1 -0
  113. data/assets/js/vendor/foundation/plugins/foundation.dropdownMenu.js +486 -0
  114. data/assets/js/vendor/foundation/plugins/foundation.dropdownMenu.min.js +1 -0
  115. data/assets/js/vendor/foundation/plugins/foundation.equalizer.js +374 -0
  116. data/assets/js/vendor/foundation/plugins/foundation.equalizer.min.js +1 -0
  117. data/assets/js/vendor/foundation/plugins/foundation.interchange.js +233 -0
  118. data/assets/js/vendor/foundation/plugins/foundation.interchange.min.js +1 -0
  119. data/assets/js/vendor/foundation/plugins/foundation.magellan.js +285 -0
  120. data/assets/js/vendor/foundation/plugins/foundation.magellan.min.js +1 -0
  121. data/assets/js/vendor/foundation/plugins/foundation.offcanvas.js +474 -0
  122. data/assets/js/vendor/foundation/plugins/foundation.offcanvas.min.js +1 -0
  123. data/assets/js/vendor/foundation/plugins/foundation.orbit.js +566 -0
  124. data/assets/js/vendor/foundation/plugins/foundation.orbit.min.js +1 -0
  125. data/assets/js/vendor/foundation/plugins/foundation.responsiveMenu.js +169 -0
  126. data/assets/js/vendor/foundation/plugins/foundation.responsiveMenu.min.js +1 -0
  127. data/assets/js/vendor/foundation/plugins/foundation.responsiveToggle.js +177 -0
  128. data/assets/js/vendor/foundation/plugins/foundation.responsiveToggle.min.js +1 -0
  129. data/assets/js/vendor/foundation/plugins/foundation.reveal.js +633 -0
  130. data/assets/js/vendor/foundation/plugins/foundation.reveal.min.js +1 -0
  131. data/assets/js/vendor/foundation/plugins/foundation.slider.js +762 -0
  132. data/assets/js/vendor/foundation/plugins/foundation.slider.min.js +1 -0
  133. data/assets/js/vendor/foundation/plugins/foundation.sticky.js +518 -0
  134. data/assets/js/vendor/foundation/plugins/foundation.sticky.min.js +1 -0
  135. data/assets/js/vendor/foundation/plugins/foundation.tabs.js +512 -0
  136. data/assets/js/vendor/foundation/plugins/foundation.tabs.min.js +1 -0
  137. data/assets/js/vendor/foundation/plugins/foundation.toggler.js +169 -0
  138. data/assets/js/vendor/foundation/plugins/foundation.toggler.min.js +1 -0
  139. data/assets/js/vendor/foundation/plugins/foundation.tooltip.js +492 -0
  140. data/assets/js/vendor/foundation/plugins/foundation.tooltip.min.js +1 -0
  141. data/assets/js/vendor/foundation/plugins/foundation.util.box.js +196 -0
  142. data/assets/js/vendor/foundation/plugins/foundation.util.box.min.js +1 -0
  143. data/assets/js/vendor/foundation/plugins/foundation.util.keyboard.js +163 -0
  144. data/assets/js/vendor/foundation/plugins/foundation.util.keyboard.min.js +1 -0
  145. data/assets/js/vendor/foundation/plugins/foundation.util.mediaQuery.js +233 -0
  146. data/assets/js/vendor/foundation/plugins/foundation.util.mediaQuery.min.js +1 -0
  147. data/assets/js/vendor/foundation/plugins/foundation.util.motion.js +103 -0
  148. data/assets/js/vendor/foundation/plugins/foundation.util.motion.min.js +1 -0
  149. data/assets/js/vendor/foundation/plugins/foundation.util.nest.js +74 -0
  150. data/assets/js/vendor/foundation/plugins/foundation.util.nest.min.js +1 -0
  151. data/assets/js/vendor/foundation/plugins/foundation.util.timerAndImageLoader.js +90 -0
  152. data/assets/js/vendor/foundation/plugins/foundation.util.timerAndImageLoader.min.js +1 -0
  153. data/assets/js/vendor/foundation/plugins/foundation.util.touch.js +352 -0
  154. data/assets/js/vendor/foundation/plugins/foundation.util.touch.min.js +1 -0
  155. data/assets/js/vendor/foundation/plugins/foundation.util.triggers.js +261 -0
  156. data/assets/js/vendor/foundation/plugins/foundation.util.triggers.min.js +1 -0
  157. data/assets/js/vendor/foundation/plugins/foundation.zf.responsiveAccordionTabs.js +262 -0
  158. data/assets/js/vendor/foundation/plugins/foundation.zf.responsiveAccordionTabs.min.js +1 -0
  159. data/assets/main.scss +6 -0
  160. metadata +232 -0
@@ -0,0 +1 @@
1
+ "use strict";!function(e){function t(e){var t={};return"string"!=typeof e?t:(e=e.trim().slice(1,-1))?t=e.split("&").reduce(function(e,t){var n=t.replace(/\+/g," ").split("="),r=n[0],i=n[1];return r=decodeURIComponent(r),i=void 0===i?null:decodeURIComponent(i),e.hasOwnProperty(r)?Array.isArray(e[r])?e[r].push(i):e[r]=[e[r],i]:e[r]=i,e},{}):t}var n={queries:[],current:"",_init:function(){var n,r=this,i=e(".foundation-mq").css("font-family");n=t(i);for(var a in n)n.hasOwnProperty(a)&&r.queries.push({name:a,value:"only screen and (min-width: "+n[a]+")"});this.current=this._getCurrentSize(),this._watcher()},atLeast:function(e){var t=this.get(e);return!!t&&window.matchMedia(t).matches},is:function(e){return e=e.trim().split(" "),e.length>1&&"only"===e[1]?e[0]===this._getCurrentSize():this.atLeast(e[0])},get:function(e){for(var t in this.queries)if(this.queries.hasOwnProperty(t)){var n=this.queries[t];if(e===n.name)return n.value}return null},_getCurrentSize:function(){for(var e,t=0;t<this.queries.length;t++){var n=this.queries[t];window.matchMedia(n.value).matches&&(e=n)}return"object"==typeof e?e.name:e},_watcher:function(){var t=this;e(window).on("resize.zf.mediaquery",function(){var n=t._getCurrentSize(),r=t.current;n!==r&&(t.current=n,e(window).trigger("changed.zf.mediaquery",[n,r]))})}};Foundation.MediaQuery=n,window.matchMedia||(window.matchMedia=function(){var e=window.styleMedia||window.media;if(!e){var t=document.createElement("style"),n=document.getElementsByTagName("script")[0],r=null;t.type="text/css",t.id="matchmediajs-test",n&&n.parentNode&&n.parentNode.insertBefore(t,n),r="getComputedStyle"in window&&window.getComputedStyle(t,null)||t.currentStyle,e={matchMedium:function(e){var n="@media "+e+"{ #matchmediajs-test { width: 1px; } }";return t.styleSheet?t.styleSheet.cssText=n:t.textContent=n,"1px"===r.width}}}return function(t){return{matches:e.matchMedium(t||"all"),media:t||"all"}}}()),Foundation.MediaQuery=n}(jQuery);
@@ -0,0 +1,103 @@
1
+ 'use strict';
2
+
3
+ !function ($) {
4
+
5
+ /**
6
+ * Motion module.
7
+ * @module foundation.motion
8
+ */
9
+
10
+ var initClasses = ['mui-enter', 'mui-leave'];
11
+ var activeClasses = ['mui-enter-active', 'mui-leave-active'];
12
+
13
+ var Motion = {
14
+ animateIn: function (element, animation, cb) {
15
+ animate(true, element, animation, cb);
16
+ },
17
+
18
+ animateOut: function (element, animation, cb) {
19
+ animate(false, element, animation, cb);
20
+ }
21
+ };
22
+
23
+ function Move(duration, elem, fn) {
24
+ var anim,
25
+ prog,
26
+ start = null;
27
+ // console.log('called');
28
+
29
+ if (duration === 0) {
30
+ fn.apply(elem);
31
+ elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);
32
+ return;
33
+ }
34
+
35
+ function move(ts) {
36
+ if (!start) start = ts;
37
+ // console.log(start, ts);
38
+ prog = ts - start;
39
+ fn.apply(elem);
40
+
41
+ if (prog < duration) {
42
+ anim = window.requestAnimationFrame(move, elem);
43
+ } else {
44
+ window.cancelAnimationFrame(anim);
45
+ elem.trigger('finished.zf.animate', [elem]).triggerHandler('finished.zf.animate', [elem]);
46
+ }
47
+ }
48
+ anim = window.requestAnimationFrame(move);
49
+ }
50
+
51
+ /**
52
+ * Animates an element in or out using a CSS transition class.
53
+ * @function
54
+ * @private
55
+ * @param {Boolean} isIn - Defines if the animation is in or out.
56
+ * @param {Object} element - jQuery or HTML object to animate.
57
+ * @param {String} animation - CSS class to use.
58
+ * @param {Function} cb - Callback to run when animation is finished.
59
+ */
60
+ function animate(isIn, element, animation, cb) {
61
+ element = $(element).eq(0);
62
+
63
+ if (!element.length) return;
64
+
65
+ var initClass = isIn ? initClasses[0] : initClasses[1];
66
+ var activeClass = isIn ? activeClasses[0] : activeClasses[1];
67
+
68
+ // Set up the animation
69
+ reset();
70
+
71
+ element.addClass(animation).css('transition', 'none');
72
+
73
+ requestAnimationFrame(function () {
74
+ element.addClass(initClass);
75
+ if (isIn) element.show();
76
+ });
77
+
78
+ // Start the animation
79
+ requestAnimationFrame(function () {
80
+ element[0].offsetWidth;
81
+ element.css('transition', '').addClass(activeClass);
82
+ });
83
+
84
+ // Clean up the animation when it finishes
85
+ element.one(Foundation.transitionend(element), finish);
86
+
87
+ // Hides the element (for out animations), resets the element, and runs a callback
88
+ function finish() {
89
+ if (!isIn) element.hide();
90
+ reset();
91
+ if (cb) cb.apply(element);
92
+ }
93
+
94
+ // Resets transitions and removes motion-specific classes
95
+ function reset() {
96
+ element[0].style.transitionDuration = 0;
97
+ element.removeClass(initClass + ' ' + activeClass + ' ' + animation);
98
+ }
99
+ }
100
+
101
+ Foundation.Move = Move;
102
+ Foundation.Motion = Motion;
103
+ }(jQuery);
@@ -0,0 +1 @@
1
+ "use strict";!function(n){function i(n,i,e){function t(s){r||(r=s),o=s-r,e.apply(i),o<n?a=window.requestAnimationFrame(t,i):(window.cancelAnimationFrame(a),i.trigger("finished.zf.animate",[i]).triggerHandler("finished.zf.animate",[i]))}var a,o,r=null;return 0===n?(e.apply(i),void i.trigger("finished.zf.animate",[i]).triggerHandler("finished.zf.animate",[i])):void(a=window.requestAnimationFrame(t))}function e(i,e,o,r){function s(){i||e.hide(),u(),r&&r.apply(e)}function u(){e[0].style.transitionDuration=0,e.removeClass(d+" "+f+" "+o)}if(e=n(e).eq(0),e.length){var d=i?t[0]:t[1],f=i?a[0]:a[1];u(),e.addClass(o).css("transition","none"),requestAnimationFrame(function(){e.addClass(d),i&&e.show()}),requestAnimationFrame(function(){e[0].offsetWidth,e.css("transition","").addClass(f)}),e.one(Foundation.transitionend(e),s)}}var t=["mui-enter","mui-leave"],a=["mui-enter-active","mui-leave-active"],o={animateIn:function(n,i,t){e(!0,n,i,t)},animateOut:function(n,i,t){e(!1,n,i,t)}};Foundation.Move=i,Foundation.Motion=o}(jQuery);
@@ -0,0 +1,74 @@
1
+ 'use strict';
2
+
3
+ !function ($) {
4
+
5
+ var Nest = {
6
+ Feather: function (menu) {
7
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'zf';
8
+
9
+ menu.attr('role', 'menubar');
10
+
11
+ var items = menu.find('li').attr({ 'role': 'menuitem' }),
12
+ subMenuClass = 'is-' + type + '-submenu',
13
+ subItemClass = subMenuClass + '-item',
14
+ hasSubClass = 'is-' + type + '-submenu-parent';
15
+
16
+ items.each(function () {
17
+ var $item = $(this),
18
+ $sub = $item.children('ul');
19
+
20
+ if ($sub.length) {
21
+ $item.addClass(hasSubClass).attr({
22
+ 'aria-haspopup': true,
23
+ 'aria-label': $item.children('a:first').text()
24
+ });
25
+ // Note: Drilldowns behave differently in how they hide, and so need
26
+ // additional attributes. We should look if this possibly over-generalized
27
+ // utility (Nest) is appropriate when we rework menus in 6.4
28
+ if (type === 'drilldown') {
29
+ $item.attr({ 'aria-expanded': false });
30
+ }
31
+
32
+ $sub.addClass('submenu ' + subMenuClass).attr({
33
+ 'data-submenu': '',
34
+ 'role': 'menu'
35
+ });
36
+ if (type === 'drilldown') {
37
+ $sub.attr({ 'aria-hidden': true });
38
+ }
39
+ }
40
+
41
+ if ($item.parent('[data-submenu]').length) {
42
+ $item.addClass('is-submenu-item ' + subItemClass);
43
+ }
44
+ });
45
+
46
+ return;
47
+ },
48
+ Burn: function (menu, type) {
49
+ var //items = menu.find('li'),
50
+ subMenuClass = 'is-' + type + '-submenu',
51
+ subItemClass = subMenuClass + '-item',
52
+ hasSubClass = 'is-' + type + '-submenu-parent';
53
+
54
+ menu.find('>li, .menu, .menu > li').removeClass(subMenuClass + ' ' + subItemClass + ' ' + hasSubClass + ' is-submenu-item submenu is-active').removeAttr('data-submenu').css('display', '');
55
+
56
+ // console.log( menu.find('.' + subMenuClass + ', .' + subItemClass + ', .has-submenu, .is-submenu-item, .submenu, [data-submenu]')
57
+ // .removeClass(subMenuClass + ' ' + subItemClass + ' has-submenu is-submenu-item submenu')
58
+ // .removeAttr('data-submenu'));
59
+ // items.each(function(){
60
+ // var $item = $(this),
61
+ // $sub = $item.children('ul');
62
+ // if($item.parent('[data-submenu]').length){
63
+ // $item.removeClass('is-submenu-item ' + subItemClass);
64
+ // }
65
+ // if($sub.length){
66
+ // $item.removeClass('has-submenu');
67
+ // $sub.removeClass('submenu ' + subMenuClass).removeAttr('data-submenu');
68
+ // }
69
+ // });
70
+ }
71
+ };
72
+
73
+ Foundation.Nest = Nest;
74
+ }(jQuery);
@@ -0,0 +1 @@
1
+ "use strict";!function(e){var a={Feather:function(a){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"zf";a.attr("role","menubar");var n=a.find("li").attr({role:"menuitem"}),i="is-"+t+"-submenu",u=i+"-item",s="is-"+t+"-submenu-parent";n.each(function(){var a=e(this),n=a.children("ul");n.length&&(a.addClass(s).attr({"aria-haspopup":!0,"aria-label":a.children("a:first").text()}),"drilldown"===t&&a.attr({"aria-expanded":!1}),n.addClass("submenu "+i).attr({"data-submenu":"",role:"menu"}),"drilldown"===t&&n.attr({"aria-hidden":!0})),a.parent("[data-submenu]").length&&a.addClass("is-submenu-item "+u)})},Burn:function(e,a){var t="is-"+a+"-submenu",n=t+"-item",i="is-"+a+"-submenu-parent";e.find(">li, .menu, .menu > li").removeClass(t+" "+n+" "+i+" is-submenu-item submenu is-active").removeAttr("data-submenu").css("display","")}};Foundation.Nest=a}(jQuery);
@@ -0,0 +1,90 @@
1
+ 'use strict';
2
+
3
+ !function ($) {
4
+
5
+ function Timer(elem, options, cb) {
6
+ var _this = this,
7
+ duration = options.duration,
8
+ //options is an object for easily adding features later.
9
+ nameSpace = Object.keys(elem.data())[0] || 'timer',
10
+ remain = -1,
11
+ start,
12
+ timer;
13
+
14
+ this.isPaused = false;
15
+
16
+ this.restart = function () {
17
+ remain = -1;
18
+ clearTimeout(timer);
19
+ this.start();
20
+ };
21
+
22
+ this.start = function () {
23
+ this.isPaused = false;
24
+ // if(!elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.
25
+ clearTimeout(timer);
26
+ remain = remain <= 0 ? duration : remain;
27
+ elem.data('paused', false);
28
+ start = Date.now();
29
+ timer = setTimeout(function () {
30
+ if (options.infinite) {
31
+ _this.restart(); //rerun the timer.
32
+ }
33
+ if (cb && typeof cb === 'function') {
34
+ cb();
35
+ }
36
+ }, remain);
37
+ elem.trigger('timerstart.zf.' + nameSpace);
38
+ };
39
+
40
+ this.pause = function () {
41
+ this.isPaused = true;
42
+ //if(elem.data('paused')){ return false; }//maybe implement this sanity check if used for other things.
43
+ clearTimeout(timer);
44
+ elem.data('paused', true);
45
+ var end = Date.now();
46
+ remain = remain - (end - start);
47
+ elem.trigger('timerpaused.zf.' + nameSpace);
48
+ };
49
+ }
50
+
51
+ /**
52
+ * Runs a callback function when images are fully loaded.
53
+ * @param {Object} images - Image(s) to check if loaded.
54
+ * @param {Func} callback - Function to execute when image is fully loaded.
55
+ */
56
+ function onImagesLoaded(images, callback) {
57
+ var self = this,
58
+ unloaded = images.length;
59
+
60
+ if (unloaded === 0) {
61
+ callback();
62
+ }
63
+
64
+ images.each(function () {
65
+ // Check if image is loaded
66
+ if (this.complete || this.readyState === 4 || this.readyState === 'complete') {
67
+ singleImageLoaded();
68
+ }
69
+ // Force load the image
70
+ else {
71
+ // fix for IE. See https://css-tricks.com/snippets/jquery/fixing-load-in-ie-for-cached-images/
72
+ var src = $(this).attr('src');
73
+ $(this).attr('src', src + (src.indexOf('?') >= 0 ? '&' : '?') + new Date().getTime());
74
+ $(this).one('load', function () {
75
+ singleImageLoaded();
76
+ });
77
+ }
78
+ });
79
+
80
+ function singleImageLoaded() {
81
+ unloaded--;
82
+ if (unloaded === 0) {
83
+ callback();
84
+ }
85
+ }
86
+ }
87
+
88
+ Foundation.Timer = Timer;
89
+ Foundation.onImagesLoaded = onImagesLoaded;
90
+ }(jQuery);
@@ -0,0 +1 @@
1
+ "use strict";!function(t){function e(t,e,i){var a,s,n=this,r=e.duration,o=Object.keys(t.data())[0]||"timer",u=-1;this.isPaused=!1,this.restart=function(){u=-1,clearTimeout(s),this.start()},this.start=function(){this.isPaused=!1,clearTimeout(s),u=u<=0?r:u,t.data("paused",!1),a=Date.now(),s=setTimeout(function(){e.infinite&&n.restart(),i&&"function"==typeof i&&i()},u),t.trigger("timerstart.zf."+o)},this.pause=function(){this.isPaused=!0,clearTimeout(s),t.data("paused",!0);var e=Date.now();u-=e-a,t.trigger("timerpaused.zf."+o)}}function i(e,i){function a(){s--,0===s&&i()}var s=e.length;0===s&&i(),e.each(function(){if(this.complete||4===this.readyState||"complete"===this.readyState)a();else{var e=t(this).attr("src");t(this).attr("src",e+(e.indexOf("?")>=0?"&":"?")+(new Date).getTime()),t(this).one("load",function(){a()})}})}Foundation.Timer=e,Foundation.onImagesLoaded=i}(jQuery);
@@ -0,0 +1,352 @@
1
+ //**************************************************
2
+ //**Work inspired by multiple jquery swipe plugins**
3
+ //**Done by Yohai Ararat ***************************
4
+ //**************************************************
5
+ (function ($) {
6
+
7
+ $.spotSwipe = {
8
+ version: '1.0.0',
9
+ enabled: 'ontouchstart' in document.documentElement,
10
+ preventDefault: false,
11
+ moveThreshold: 75,
12
+ timeThreshold: 200
13
+ };
14
+
15
+ var startPosX,
16
+ startPosY,
17
+ startTime,
18
+ elapsedTime,
19
+ isMoving = false;
20
+
21
+ function onTouchEnd() {
22
+ // alert(this);
23
+ this.removeEventListener('touchmove', onTouchMove);
24
+ this.removeEventListener('touchend', onTouchEnd);
25
+ isMoving = false;
26
+ }
27
+
28
+ function onTouchMove(e) {
29
+ if ($.spotSwipe.preventDefault) {
30
+ e.preventDefault();
31
+ }
32
+ if (isMoving) {
33
+ var x = e.touches[0].pageX;
34
+ var y = e.touches[0].pageY;
35
+ var dx = startPosX - x;
36
+ var dy = startPosY - y;
37
+ var dir;
38
+ elapsedTime = new Date().getTime() - startTime;
39
+ if (Math.abs(dx) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {
40
+ dir = dx > 0 ? 'left' : 'right';
41
+ }
42
+ // else if(Math.abs(dy) >= $.spotSwipe.moveThreshold && elapsedTime <= $.spotSwipe.timeThreshold) {
43
+ // dir = dy > 0 ? 'down' : 'up';
44
+ // }
45
+ if (dir) {
46
+ e.preventDefault();
47
+ onTouchEnd.call(this);
48
+ $(this).trigger('swipe', dir).trigger('swipe' + dir);
49
+ }
50
+ }
51
+ }
52
+
53
+ function onTouchStart(e) {
54
+ if (e.touches.length == 1) {
55
+ startPosX = e.touches[0].pageX;
56
+ startPosY = e.touches[0].pageY;
57
+ isMoving = true;
58
+ startTime = new Date().getTime();
59
+ this.addEventListener('touchmove', onTouchMove, false);
60
+ this.addEventListener('touchend', onTouchEnd, false);
61
+ }
62
+ }
63
+
64
+ function init() {
65
+ this.addEventListener && this.addEventListener('touchstart', onTouchStart, false);
66
+ }
67
+
68
+ function teardown() {
69
+ this.removeEventListener('touchstart', onTouchStart);
70
+ }
71
+
72
+ $.event.special.swipe = { setup: init };
73
+
74
+ $.each(['left', 'up', 'down', 'right'], function () {
75
+ $.event.special['swipe' + this] = { setup: function () {
76
+ $(this).on('swipe', $.noop);
77
+ } };
78
+ });
79
+ })(jQuery);
80
+ /****************************************************
81
+ * Method for adding psuedo drag events to elements *
82
+ ***************************************************/
83
+ !function ($) {
84
+ $.fn.addTouch = function () {
85
+ this.each(function (i, el) {
86
+ $(el).bind('touchstart touchmove touchend touchcancel', function () {
87
+ //we pass the original event object because the jQuery event
88
+ //object is normalized to w3c specs and does not provide the TouchList
89
+ handleTouch(event);
90
+ });
91
+ });
92
+
93
+ var handleTouch = function (event) {
94
+ var touches = event.changedTouches,
95
+ first = touches[0],
96
+ eventTypes = {
97
+ touchstart: 'mousedown',
98
+ touchmove: 'mousemove',
99
+ touchend: 'mouseup'
100
+ },
101
+ type = eventTypes[event.type],
102
+ simulatedEvent;
103
+
104
+ if ('MouseEvent' in window && typeof window.MouseEvent === 'function') {
105
+ simulatedEvent = new window.MouseEvent(type, {
106
+ 'bubbles': true,
107
+ 'cancelable': true,
108
+ 'screenX': first.screenX,
109
+ 'screenY': first.screenY,
110
+ 'clientX': first.clientX,
111
+ 'clientY': first.clientY
112
+ });
113
+ } else {
114
+ simulatedEvent = document.createEvent('MouseEvent');
115
+ simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0 /*left*/, null);
116
+ }
117
+ first.target.dispatchEvent(simulatedEvent);
118
+ };
119
+ };
120
+ }(jQuery);
121
+
122
+ //**********************************
123
+ //**From the jQuery Mobile Library**
124
+ //**need to recreate functionality**
125
+ //**and try to improve if possible**
126
+ //**********************************
127
+
128
+ /* Removing the jQuery function ****
129
+ ************************************
130
+
131
+ (function( $, window, undefined ) {
132
+
133
+ var $document = $( document ),
134
+ // supportTouch = $.mobile.support.touch,
135
+ touchStartEvent = 'touchstart'//supportTouch ? "touchstart" : "mousedown",
136
+ touchStopEvent = 'touchend'//supportTouch ? "touchend" : "mouseup",
137
+ touchMoveEvent = 'touchmove'//supportTouch ? "touchmove" : "mousemove";
138
+
139
+ // setup new event shortcuts
140
+ $.each( ( "touchstart touchmove touchend " +
141
+ "swipe swipeleft swiperight" ).split( " " ), function( i, name ) {
142
+
143
+ $.fn[ name ] = function( fn ) {
144
+ return fn ? this.bind( name, fn ) : this.trigger( name );
145
+ };
146
+
147
+ // jQuery < 1.8
148
+ if ( $.attrFn ) {
149
+ $.attrFn[ name ] = true;
150
+ }
151
+ });
152
+
153
+ function triggerCustomEvent( obj, eventType, event, bubble ) {
154
+ var originalType = event.type;
155
+ event.type = eventType;
156
+ if ( bubble ) {
157
+ $.event.trigger( event, undefined, obj );
158
+ } else {
159
+ $.event.dispatch.call( obj, event );
160
+ }
161
+ event.type = originalType;
162
+ }
163
+
164
+ // also handles taphold
165
+
166
+ // Also handles swipeleft, swiperight
167
+ $.event.special.swipe = {
168
+
169
+ // More than this horizontal displacement, and we will suppress scrolling.
170
+ scrollSupressionThreshold: 30,
171
+
172
+ // More time than this, and it isn't a swipe.
173
+ durationThreshold: 1000,
174
+
175
+ // Swipe horizontal displacement must be more than this.
176
+ horizontalDistanceThreshold: window.devicePixelRatio >= 2 ? 15 : 30,
177
+
178
+ // Swipe vertical displacement must be less than this.
179
+ verticalDistanceThreshold: window.devicePixelRatio >= 2 ? 15 : 30,
180
+
181
+ getLocation: function ( event ) {
182
+ var winPageX = window.pageXOffset,
183
+ winPageY = window.pageYOffset,
184
+ x = event.clientX,
185
+ y = event.clientY;
186
+
187
+ if ( event.pageY === 0 && Math.floor( y ) > Math.floor( event.pageY ) ||
188
+ event.pageX === 0 && Math.floor( x ) > Math.floor( event.pageX ) ) {
189
+
190
+ // iOS4 clientX/clientY have the value that should have been
191
+ // in pageX/pageY. While pageX/page/ have the value 0
192
+ x = x - winPageX;
193
+ y = y - winPageY;
194
+ } else if ( y < ( event.pageY - winPageY) || x < ( event.pageX - winPageX ) ) {
195
+
196
+ // Some Android browsers have totally bogus values for clientX/Y
197
+ // when scrolling/zooming a page. Detectable since clientX/clientY
198
+ // should never be smaller than pageX/pageY minus page scroll
199
+ x = event.pageX - winPageX;
200
+ y = event.pageY - winPageY;
201
+ }
202
+
203
+ return {
204
+ x: x,
205
+ y: y
206
+ };
207
+ },
208
+
209
+ start: function( event ) {
210
+ var data = event.originalEvent.touches ?
211
+ event.originalEvent.touches[ 0 ] : event,
212
+ location = $.event.special.swipe.getLocation( data );
213
+ return {
214
+ time: ( new Date() ).getTime(),
215
+ coords: [ location.x, location.y ],
216
+ origin: $( event.target )
217
+ };
218
+ },
219
+
220
+ stop: function( event ) {
221
+ var data = event.originalEvent.touches ?
222
+ event.originalEvent.touches[ 0 ] : event,
223
+ location = $.event.special.swipe.getLocation( data );
224
+ return {
225
+ time: ( new Date() ).getTime(),
226
+ coords: [ location.x, location.y ]
227
+ };
228
+ },
229
+
230
+ handleSwipe: function( start, stop, thisObject, origTarget ) {
231
+ if ( stop.time - start.time < $.event.special.swipe.durationThreshold &&
232
+ Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.horizontalDistanceThreshold &&
233
+ Math.abs( start.coords[ 1 ] - stop.coords[ 1 ] ) < $.event.special.swipe.verticalDistanceThreshold ) {
234
+ var direction = start.coords[0] > stop.coords[ 0 ] ? "swipeleft" : "swiperight";
235
+
236
+ triggerCustomEvent( thisObject, "swipe", $.Event( "swipe", { target: origTarget, swipestart: start, swipestop: stop }), true );
237
+ triggerCustomEvent( thisObject, direction,$.Event( direction, { target: origTarget, swipestart: start, swipestop: stop } ), true );
238
+ return true;
239
+ }
240
+ return false;
241
+
242
+ },
243
+
244
+ // This serves as a flag to ensure that at most one swipe event event is
245
+ // in work at any given time
246
+ eventInProgress: false,
247
+
248
+ setup: function() {
249
+ var events,
250
+ thisObject = this,
251
+ $this = $( thisObject ),
252
+ context = {};
253
+
254
+ // Retrieve the events data for this element and add the swipe context
255
+ events = $.data( this, "mobile-events" );
256
+ if ( !events ) {
257
+ events = { length: 0 };
258
+ $.data( this, "mobile-events", events );
259
+ }
260
+ events.length++;
261
+ events.swipe = context;
262
+
263
+ context.start = function( event ) {
264
+
265
+ // Bail if we're already working on a swipe event
266
+ if ( $.event.special.swipe.eventInProgress ) {
267
+ return;
268
+ }
269
+ $.event.special.swipe.eventInProgress = true;
270
+
271
+ var stop,
272
+ start = $.event.special.swipe.start( event ),
273
+ origTarget = event.target,
274
+ emitted = false;
275
+
276
+ context.move = function( event ) {
277
+ if ( !start || event.isDefaultPrevented() ) {
278
+ return;
279
+ }
280
+
281
+ stop = $.event.special.swipe.stop( event );
282
+ if ( !emitted ) {
283
+ emitted = $.event.special.swipe.handleSwipe( start, stop, thisObject, origTarget );
284
+ if ( emitted ) {
285
+
286
+ // Reset the context to make way for the next swipe event
287
+ $.event.special.swipe.eventInProgress = false;
288
+ }
289
+ }
290
+ // prevent scrolling
291
+ if ( Math.abs( start.coords[ 0 ] - stop.coords[ 0 ] ) > $.event.special.swipe.scrollSupressionThreshold ) {
292
+ event.preventDefault();
293
+ }
294
+ };
295
+
296
+ context.stop = function() {
297
+ emitted = true;
298
+
299
+ // Reset the context to make way for the next swipe event
300
+ $.event.special.swipe.eventInProgress = false;
301
+ $document.off( touchMoveEvent, context.move );
302
+ context.move = null;
303
+ };
304
+
305
+ $document.on( touchMoveEvent, context.move )
306
+ .one( touchStopEvent, context.stop );
307
+ };
308
+ $this.on( touchStartEvent, context.start );
309
+ },
310
+
311
+ teardown: function() {
312
+ var events, context;
313
+
314
+ events = $.data( this, "mobile-events" );
315
+ if ( events ) {
316
+ context = events.swipe;
317
+ delete events.swipe;
318
+ events.length--;
319
+ if ( events.length === 0 ) {
320
+ $.removeData( this, "mobile-events" );
321
+ }
322
+ }
323
+
324
+ if ( context ) {
325
+ if ( context.start ) {
326
+ $( this ).off( touchStartEvent, context.start );
327
+ }
328
+ if ( context.move ) {
329
+ $document.off( touchMoveEvent, context.move );
330
+ }
331
+ if ( context.stop ) {
332
+ $document.off( touchStopEvent, context.stop );
333
+ }
334
+ }
335
+ }
336
+ };
337
+ $.each({
338
+ swipeleft: "swipe.left",
339
+ swiperight: "swipe.right"
340
+ }, function( event, sourceEvent ) {
341
+
342
+ $.event.special[ event ] = {
343
+ setup: function() {
344
+ $( this ).bind( sourceEvent, $.noop );
345
+ },
346
+ teardown: function() {
347
+ $( this ).unbind( sourceEvent );
348
+ }
349
+ };
350
+ });
351
+ })( jQuery, this );
352
+ */