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 _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var o=0;o<t.length;o++){var s=t[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,o,s){return o&&e(t.prototype,o),s&&e(t,s),t}}();!function(e){var t=function(){function t(o,s){_classCallCheck(this,t),this.$element=o,this.options=e.extend({},t.defaults,this.$element.data(),s),this.$lastTrigger=e(),this.$triggers=e(),this._init(),this._events(),Foundation.registerPlugin(this,"OffCanvas"),Foundation.Keyboard.register("OffCanvas",{ESCAPE:"close"})}return _createClass(t,[{key:"_init",value:function(){var t=this.$element.attr("id");if(this.$element.attr("aria-hidden","true"),this.$element.addClass("is-transition-"+this.options.transition),this.$triggers=e(document).find('[data-open="'+t+'"], [data-close="'+t+'"], [data-toggle="'+t+'"]').attr("aria-expanded","false").attr("aria-controls",t),this.options.contentOverlay===!0){var o=document.createElement("div"),s="fixed"===e(this.$element).css("position")?"is-overlay-fixed":"is-overlay-absolute";o.setAttribute("class","js-off-canvas-overlay "+s),this.$overlay=e(o),"is-overlay-fixed"===s?e("body").append(this.$overlay):this.$element.siblings("[data-off-canvas-content]").append(this.$overlay)}this.options.isRevealed=this.options.isRevealed||new RegExp(this.options.revealClass,"g").test(this.$element[0].className),this.options.isRevealed===!0&&(this.options.revealOn=this.options.revealOn||this.$element[0].className.match(/(reveal-for-medium|reveal-for-large)/g)[0].split("-")[2],this._setMQChecker()),!this.options.transitionTime==!0&&(this.options.transitionTime=1e3*parseFloat(window.getComputedStyle(e("[data-off-canvas]")[0]).transitionDuration))}},{key:"_events",value:function(){if(this.$element.off(".zf.trigger .zf.offcanvas").on({"open.zf.trigger":this.open.bind(this),"close.zf.trigger":this.close.bind(this),"toggle.zf.trigger":this.toggle.bind(this),"keydown.zf.offcanvas":this._handleKeyboard.bind(this)}),this.options.closeOnClick===!0){var t=this.options.contentOverlay?this.$overlay:e("[data-off-canvas-content]");t.on({"click.zf.offcanvas":this.close.bind(this)})}}},{key:"_setMQChecker",value:function(){var t=this;e(window).on("changed.zf.mediaquery",function(){Foundation.MediaQuery.atLeast(t.options.revealOn)?t.reveal(!0):t.reveal(!1)}).one("load.zf.offcanvas",function(){Foundation.MediaQuery.atLeast(t.options.revealOn)&&t.reveal(!0)})}},{key:"reveal",value:function(e){var t=this.$element.find("[data-close]");e?(this.close(),this.isRevealed=!0,this.$element.attr("aria-hidden","false"),this.$element.off("open.zf.trigger toggle.zf.trigger"),t.length&&t.hide()):(this.isRevealed=!1,this.$element.attr("aria-hidden","true"),this.$element.on({"open.zf.trigger":this.open.bind(this),"toggle.zf.trigger":this.toggle.bind(this)}),t.length&&t.show())}},{key:"_stopScrolling",value:function(e){return!1}},{key:"_recordScrollable",value:function(e){var t=this;t.scrollHeight!==t.clientHeight&&(0===t.scrollTop&&(t.scrollTop=1),t.scrollTop===t.scrollHeight-t.clientHeight&&(t.scrollTop=t.scrollHeight-t.clientHeight-1)),t.allowUp=t.scrollTop>0,t.allowDown=t.scrollTop<t.scrollHeight-t.clientHeight,t.lastY=e.originalEvent.pageY}},{key:"_stopScrollPropagation",value:function(e){var t=this,o=e.pageY<t.lastY,s=!o;t.lastY=e.pageY,o&&t.allowUp||s&&t.allowDown?e.stopPropagation():e.preventDefault()}},{key:"open",value:function(t,o){if(!this.$element.hasClass("is-open")&&!this.isRevealed){var s=this;o&&(this.$lastTrigger=o),"top"===this.options.forceTo?window.scrollTo(0,0):"bottom"===this.options.forceTo&&window.scrollTo(0,document.body.scrollHeight),s.$element.addClass("is-open"),this.$triggers.attr("aria-expanded","true"),this.$element.attr("aria-hidden","false").trigger("opened.zf.offcanvas"),this.options.contentScroll===!1&&(e("body").addClass("is-off-canvas-open").on("touchmove",this._stopScrolling),this.$element.on("touchstart",this._recordScrollable),this.$element.on("touchmove",this._stopScrollPropagation)),this.options.contentOverlay===!0&&this.$overlay.addClass("is-visible"),this.options.closeOnClick===!0&&this.options.contentOverlay===!0&&this.$overlay.addClass("is-closable"),this.options.autoFocus===!0&&this.$element.one(Foundation.transitionend(this.$element),function(){s.$element.find("a, button").eq(0).focus()}),this.options.trapFocus===!0&&(this.$element.siblings("[data-off-canvas-content]").attr("tabindex","-1"),Foundation.Keyboard.trapFocus(this.$element))}}},{key:"close",value:function(t){if(this.$element.hasClass("is-open")&&!this.isRevealed){var o=this;o.$element.removeClass("is-open"),this.$element.attr("aria-hidden","true").trigger("closed.zf.offcanvas"),this.options.contentScroll===!1&&(e("body").removeClass("is-off-canvas-open").off("touchmove",this._stopScrolling),this.$element.off("touchstart",this._recordScrollable),this.$element.off("touchmove",this._stopScrollPropagation)),this.options.contentOverlay===!0&&this.$overlay.removeClass("is-visible"),this.options.closeOnClick===!0&&this.options.contentOverlay===!0&&this.$overlay.removeClass("is-closable"),this.$triggers.attr("aria-expanded","false"),this.options.trapFocus===!0&&(this.$element.siblings("[data-off-canvas-content]").removeAttr("tabindex"),Foundation.Keyboard.releaseFocus(this.$element))}}},{key:"toggle",value:function(e,t){this.$element.hasClass("is-open")?this.close(e,t):this.open(e,t)}},{key:"_handleKeyboard",value:function(e){var t=this;Foundation.Keyboard.handleKey(e,"OffCanvas",{close:function(){return t.close(),t.$lastTrigger.focus(),!0},handled:function(){e.stopPropagation(),e.preventDefault()}})}},{key:"destroy",value:function(){this.close(),this.$element.off(".zf.trigger .zf.offcanvas"),this.$overlay.off(".zf.offcanvas"),Foundation.unregisterPlugin(this)}}]),t}();t.defaults={closeOnClick:!0,contentOverlay:!0,contentScroll:!0,transitionTime:0,transition:"push",forceTo:null,isRevealed:!1,revealOn:null,autoFocus:!0,revealClass:"reveal-for-",trapFocus:!1},Foundation.plugin(t,"OffCanvas")}(jQuery);
@@ -0,0 +1,566 @@
1
+ 'use strict';
2
+
3
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
4
+
5
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6
+
7
+ !function ($) {
8
+
9
+ /**
10
+ * Orbit module.
11
+ * @module foundation.orbit
12
+ * @requires foundation.util.keyboard
13
+ * @requires foundation.util.motion
14
+ * @requires foundation.util.timerAndImageLoader
15
+ * @requires foundation.util.touch
16
+ */
17
+
18
+ var Orbit = function () {
19
+ /**
20
+ * Creates a new instance of an orbit carousel.
21
+ * @class
22
+ * @param {jQuery} element - jQuery object to make into an Orbit Carousel.
23
+ * @param {Object} options - Overrides to the default plugin settings.
24
+ */
25
+ function Orbit(element, options) {
26
+ _classCallCheck(this, Orbit);
27
+
28
+ this.$element = element;
29
+ this.options = $.extend({}, Orbit.defaults, this.$element.data(), options);
30
+
31
+ this._init();
32
+
33
+ Foundation.registerPlugin(this, 'Orbit');
34
+ Foundation.Keyboard.register('Orbit', {
35
+ 'ltr': {
36
+ 'ARROW_RIGHT': 'next',
37
+ 'ARROW_LEFT': 'previous'
38
+ },
39
+ 'rtl': {
40
+ 'ARROW_LEFT': 'next',
41
+ 'ARROW_RIGHT': 'previous'
42
+ }
43
+ });
44
+ }
45
+
46
+ /**
47
+ * Initializes the plugin by creating jQuery collections, setting attributes, and starting the animation.
48
+ * @function
49
+ * @private
50
+ */
51
+
52
+
53
+ _createClass(Orbit, [{
54
+ key: '_init',
55
+ value: function _init() {
56
+ // @TODO: consider discussion on PR #9278 about DOM pollution by changeSlide
57
+ this._reset();
58
+
59
+ this.$wrapper = this.$element.find('.' + this.options.containerClass);
60
+ this.$slides = this.$element.find('.' + this.options.slideClass);
61
+
62
+ var $images = this.$element.find('img'),
63
+ initActive = this.$slides.filter('.is-active'),
64
+ id = this.$element[0].id || Foundation.GetYoDigits(6, 'orbit');
65
+
66
+ this.$element.attr({
67
+ 'data-resize': id,
68
+ 'id': id
69
+ });
70
+
71
+ if (!initActive.length) {
72
+ this.$slides.eq(0).addClass('is-active');
73
+ }
74
+
75
+ if (!this.options.useMUI) {
76
+ this.$slides.addClass('no-motionui');
77
+ }
78
+
79
+ if ($images.length) {
80
+ Foundation.onImagesLoaded($images, this._prepareForOrbit.bind(this));
81
+ } else {
82
+ this._prepareForOrbit(); //hehe
83
+ }
84
+
85
+ if (this.options.bullets) {
86
+ this._loadBullets();
87
+ }
88
+
89
+ this._events();
90
+
91
+ if (this.options.autoPlay && this.$slides.length > 1) {
92
+ this.geoSync();
93
+ }
94
+
95
+ if (this.options.accessible) {
96
+ // allow wrapper to be focusable to enable arrow navigation
97
+ this.$wrapper.attr('tabindex', 0);
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Creates a jQuery collection of bullets, if they are being used.
103
+ * @function
104
+ * @private
105
+ */
106
+
107
+ }, {
108
+ key: '_loadBullets',
109
+ value: function _loadBullets() {
110
+ this.$bullets = this.$element.find('.' + this.options.boxOfBullets).find('button');
111
+ }
112
+
113
+ /**
114
+ * Sets a `timer` object on the orbit, and starts the counter for the next slide.
115
+ * @function
116
+ */
117
+
118
+ }, {
119
+ key: 'geoSync',
120
+ value: function geoSync() {
121
+ var _this = this;
122
+ this.timer = new Foundation.Timer(this.$element, {
123
+ duration: this.options.timerDelay,
124
+ infinite: false
125
+ }, function () {
126
+ _this.changeSlide(true);
127
+ });
128
+ this.timer.start();
129
+ }
130
+
131
+ /**
132
+ * Sets wrapper and slide heights for the orbit.
133
+ * @function
134
+ * @private
135
+ */
136
+
137
+ }, {
138
+ key: '_prepareForOrbit',
139
+ value: function _prepareForOrbit() {
140
+ var _this = this;
141
+ this._setWrapperHeight();
142
+ }
143
+
144
+ /**
145
+ * Calulates the height of each slide in the collection, and uses the tallest one for the wrapper height.
146
+ * @function
147
+ * @private
148
+ * @param {Function} cb - a callback function to fire when complete.
149
+ */
150
+
151
+ }, {
152
+ key: '_setWrapperHeight',
153
+ value: function _setWrapperHeight(cb) {
154
+ //rewrite this to `for` loop
155
+ var max = 0,
156
+ temp,
157
+ counter = 0,
158
+ _this = this;
159
+
160
+ this.$slides.each(function () {
161
+ temp = this.getBoundingClientRect().height;
162
+ $(this).attr('data-slide', counter);
163
+
164
+ if (_this.$slides.filter('.is-active')[0] !== _this.$slides.eq(counter)[0]) {
165
+ //if not the active slide, set css position and display property
166
+ $(this).css({ 'position': 'relative', 'display': 'none' });
167
+ }
168
+ max = temp > max ? temp : max;
169
+ counter++;
170
+ });
171
+
172
+ if (counter === this.$slides.length) {
173
+ this.$wrapper.css({ 'height': max }); //only change the wrapper height property once.
174
+ if (cb) {
175
+ cb(max);
176
+ } //fire callback with max height dimension.
177
+ }
178
+ }
179
+
180
+ /**
181
+ * Sets the max-height of each slide.
182
+ * @function
183
+ * @private
184
+ */
185
+
186
+ }, {
187
+ key: '_setSlideHeight',
188
+ value: function _setSlideHeight(height) {
189
+ this.$slides.each(function () {
190
+ $(this).css('max-height', height);
191
+ });
192
+ }
193
+
194
+ /**
195
+ * Adds event listeners to basically everything within the element.
196
+ * @function
197
+ * @private
198
+ */
199
+
200
+ }, {
201
+ key: '_events',
202
+ value: function _events() {
203
+ var _this = this;
204
+
205
+ //***************************************
206
+ //**Now using custom event - thanks to:**
207
+ //** Yohai Ararat of Toronto **
208
+ //***************************************
209
+ //
210
+ this.$element.off('.resizeme.zf.trigger').on({
211
+ 'resizeme.zf.trigger': this._prepareForOrbit.bind(this)
212
+ });
213
+ if (this.$slides.length > 1) {
214
+
215
+ if (this.options.swipe) {
216
+ this.$slides.off('swipeleft.zf.orbit swiperight.zf.orbit').on('swipeleft.zf.orbit', function (e) {
217
+ e.preventDefault();
218
+ _this.changeSlide(true);
219
+ }).on('swiperight.zf.orbit', function (e) {
220
+ e.preventDefault();
221
+ _this.changeSlide(false);
222
+ });
223
+ }
224
+ //***************************************
225
+
226
+ if (this.options.autoPlay) {
227
+ this.$slides.on('click.zf.orbit', function () {
228
+ _this.$element.data('clickedOn', _this.$element.data('clickedOn') ? false : true);
229
+ _this.timer[_this.$element.data('clickedOn') ? 'pause' : 'start']();
230
+ });
231
+
232
+ if (this.options.pauseOnHover) {
233
+ this.$element.on('mouseenter.zf.orbit', function () {
234
+ _this.timer.pause();
235
+ }).on('mouseleave.zf.orbit', function () {
236
+ if (!_this.$element.data('clickedOn')) {
237
+ _this.timer.start();
238
+ }
239
+ });
240
+ }
241
+ }
242
+
243
+ if (this.options.navButtons) {
244
+ var $controls = this.$element.find('.' + this.options.nextClass + ', .' + this.options.prevClass);
245
+ $controls.attr('tabindex', 0)
246
+ //also need to handle enter/return and spacebar key presses
247
+ .on('click.zf.orbit touchend.zf.orbit', function (e) {
248
+ e.preventDefault();
249
+ _this.changeSlide($(this).hasClass(_this.options.nextClass));
250
+ });
251
+ }
252
+
253
+ if (this.options.bullets) {
254
+ this.$bullets.on('click.zf.orbit touchend.zf.orbit', function () {
255
+ if (/is-active/g.test(this.className)) {
256
+ return false;
257
+ } //if this is active, kick out of function.
258
+ var idx = $(this).data('slide'),
259
+ ltr = idx > _this.$slides.filter('.is-active').data('slide'),
260
+ $slide = _this.$slides.eq(idx);
261
+
262
+ _this.changeSlide(ltr, $slide, idx);
263
+ });
264
+ }
265
+
266
+ if (this.options.accessible) {
267
+ this.$wrapper.add(this.$bullets).on('keydown.zf.orbit', function (e) {
268
+ // handle keyboard event with keyboard util
269
+ Foundation.Keyboard.handleKey(e, 'Orbit', {
270
+ next: function () {
271
+ _this.changeSlide(true);
272
+ },
273
+ previous: function () {
274
+ _this.changeSlide(false);
275
+ },
276
+ handled: function () {
277
+ // if bullet is focused, make sure focus moves
278
+ if ($(e.target).is(_this.$bullets)) {
279
+ _this.$bullets.filter('.is-active').focus();
280
+ }
281
+ }
282
+ });
283
+ });
284
+ }
285
+ }
286
+ }
287
+
288
+ /**
289
+ * Resets Orbit so it can be reinitialized
290
+ */
291
+
292
+ }, {
293
+ key: '_reset',
294
+ value: function _reset() {
295
+ // Don't do anything if there are no slides (first run)
296
+ if (typeof this.$slides == 'undefined') {
297
+ return;
298
+ }
299
+
300
+ if (this.$slides.length > 1) {
301
+ // Remove old events
302
+ this.$element.off('.zf.orbit').find('*').off('.zf.orbit');
303
+
304
+ // Restart timer if autoPlay is enabled
305
+ if (this.options.autoPlay) {
306
+ this.timer.restart();
307
+ }
308
+
309
+ // Reset all sliddes
310
+ this.$slides.each(function (el) {
311
+ $(el).removeClass('is-active is-active is-in').removeAttr('aria-live').hide();
312
+ });
313
+
314
+ // Show the first slide
315
+ this.$slides.first().addClass('is-active').show();
316
+
317
+ // Triggers when the slide has finished animating
318
+ this.$element.trigger('slidechange.zf.orbit', [this.$slides.first()]);
319
+
320
+ // Select first bullet if bullets are present
321
+ if (this.options.bullets) {
322
+ this._updateBullets(0);
323
+ }
324
+ }
325
+ }
326
+
327
+ /**
328
+ * Changes the current slide to a new one.
329
+ * @function
330
+ * @param {Boolean} isLTR - flag if the slide should move left to right.
331
+ * @param {jQuery} chosenSlide - the jQuery element of the slide to show next, if one is selected.
332
+ * @param {Number} idx - the index of the new slide in its collection, if one chosen.
333
+ * @fires Orbit#slidechange
334
+ */
335
+
336
+ }, {
337
+ key: 'changeSlide',
338
+ value: function changeSlide(isLTR, chosenSlide, idx) {
339
+ if (!this.$slides) {
340
+ return;
341
+ } // Don't freak out if we're in the middle of cleanup
342
+ var $curSlide = this.$slides.filter('.is-active').eq(0);
343
+
344
+ if (/mui/g.test($curSlide[0].className)) {
345
+ return false;
346
+ } //if the slide is currently animating, kick out of the function
347
+
348
+ var $firstSlide = this.$slides.first(),
349
+ $lastSlide = this.$slides.last(),
350
+ dirIn = isLTR ? 'Right' : 'Left',
351
+ dirOut = isLTR ? 'Left' : 'Right',
352
+ _this = this,
353
+ $newSlide;
354
+
355
+ if (!chosenSlide) {
356
+ //most of the time, this will be auto played or clicked from the navButtons.
357
+ $newSlide = isLTR ? //if wrapping enabled, check to see if there is a `next` or `prev` sibling, if not, select the first or last slide to fill in. if wrapping not enabled, attempt to select `next` or `prev`, if there's nothing there, the function will kick out on next step. CRAZY NESTED TERNARIES!!!!!
358
+ this.options.infiniteWrap ? $curSlide.next('.' + this.options.slideClass).length ? $curSlide.next('.' + this.options.slideClass) : $firstSlide : $curSlide.next('.' + this.options.slideClass) : //pick next slide if moving left to right
359
+ this.options.infiniteWrap ? $curSlide.prev('.' + this.options.slideClass).length ? $curSlide.prev('.' + this.options.slideClass) : $lastSlide : $curSlide.prev('.' + this.options.slideClass); //pick prev slide if moving right to left
360
+ } else {
361
+ $newSlide = chosenSlide;
362
+ }
363
+
364
+ if ($newSlide.length) {
365
+ /**
366
+ * Triggers before the next slide starts animating in and only if a next slide has been found.
367
+ * @event Orbit#beforeslidechange
368
+ */
369
+ this.$element.trigger('beforeslidechange.zf.orbit', [$curSlide, $newSlide]);
370
+
371
+ if (this.options.bullets) {
372
+ idx = idx || this.$slides.index($newSlide); //grab index to update bullets
373
+ this._updateBullets(idx);
374
+ }
375
+
376
+ if (this.options.useMUI && !this.$element.is(':hidden')) {
377
+ Foundation.Motion.animateIn($newSlide.addClass('is-active').css({ 'position': 'absolute', 'top': 0 }), this.options['animInFrom' + dirIn], function () {
378
+ $newSlide.css({ 'position': 'relative', 'display': 'block' }).attr('aria-live', 'polite');
379
+ });
380
+
381
+ Foundation.Motion.animateOut($curSlide.removeClass('is-active'), this.options['animOutTo' + dirOut], function () {
382
+ $curSlide.removeAttr('aria-live');
383
+ if (_this.options.autoPlay && !_this.timer.isPaused) {
384
+ _this.timer.restart();
385
+ }
386
+ //do stuff?
387
+ });
388
+ } else {
389
+ $curSlide.removeClass('is-active is-in').removeAttr('aria-live').hide();
390
+ $newSlide.addClass('is-active is-in').attr('aria-live', 'polite').show();
391
+ if (this.options.autoPlay && !this.timer.isPaused) {
392
+ this.timer.restart();
393
+ }
394
+ }
395
+ /**
396
+ * Triggers when the slide has finished animating in.
397
+ * @event Orbit#slidechange
398
+ */
399
+ this.$element.trigger('slidechange.zf.orbit', [$newSlide]);
400
+ }
401
+ }
402
+
403
+ /**
404
+ * Updates the active state of the bullets, if displayed.
405
+ * @function
406
+ * @private
407
+ * @param {Number} idx - the index of the current slide.
408
+ */
409
+
410
+ }, {
411
+ key: '_updateBullets',
412
+ value: function _updateBullets(idx) {
413
+ var $oldBullet = this.$element.find('.' + this.options.boxOfBullets).find('.is-active').removeClass('is-active').blur(),
414
+ span = $oldBullet.find('span:last').detach(),
415
+ $newBullet = this.$bullets.eq(idx).addClass('is-active').append(span);
416
+ }
417
+
418
+ /**
419
+ * Destroys the carousel and hides the element.
420
+ * @function
421
+ */
422
+
423
+ }, {
424
+ key: 'destroy',
425
+ value: function destroy() {
426
+ this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide();
427
+ Foundation.unregisterPlugin(this);
428
+ }
429
+ }]);
430
+
431
+ return Orbit;
432
+ }();
433
+
434
+ Orbit.defaults = {
435
+ /**
436
+ * Tells the JS to look for and loadBullets.
437
+ * @option
438
+ * @type {boolean}
439
+ * @default true
440
+ */
441
+ bullets: true,
442
+ /**
443
+ * Tells the JS to apply event listeners to nav buttons
444
+ * @option
445
+ * @type {boolean}
446
+ * @default true
447
+ */
448
+ navButtons: true,
449
+ /**
450
+ * motion-ui animation class to apply
451
+ * @option
452
+ * @type {string}
453
+ * @default 'slide-in-right'
454
+ */
455
+ animInFromRight: 'slide-in-right',
456
+ /**
457
+ * motion-ui animation class to apply
458
+ * @option
459
+ * @type {string}
460
+ * @default 'slide-out-right'
461
+ */
462
+ animOutToRight: 'slide-out-right',
463
+ /**
464
+ * motion-ui animation class to apply
465
+ * @option
466
+ * @type {string}
467
+ * @default 'slide-in-left'
468
+ *
469
+ */
470
+ animInFromLeft: 'slide-in-left',
471
+ /**
472
+ * motion-ui animation class to apply
473
+ * @option
474
+ * @type {string}
475
+ * @default 'slide-out-left'
476
+ */
477
+ animOutToLeft: 'slide-out-left',
478
+ /**
479
+ * Allows Orbit to automatically animate on page load.
480
+ * @option
481
+ * @type {boolean}
482
+ * @default true
483
+ */
484
+ autoPlay: true,
485
+ /**
486
+ * Amount of time, in ms, between slide transitions
487
+ * @option
488
+ * @type {number}
489
+ * @default 5000
490
+ */
491
+ timerDelay: 5000,
492
+ /**
493
+ * Allows Orbit to infinitely loop through the slides
494
+ * @option
495
+ * @type {boolean}
496
+ * @default true
497
+ */
498
+ infiniteWrap: true,
499
+ /**
500
+ * Allows the Orbit slides to bind to swipe events for mobile, requires an additional util library
501
+ * @option
502
+ * @type {boolean}
503
+ * @default true
504
+ */
505
+ swipe: true,
506
+ /**
507
+ * Allows the timing function to pause animation on hover.
508
+ * @option
509
+ * @type {boolean}
510
+ * @default true
511
+ */
512
+ pauseOnHover: true,
513
+ /**
514
+ * Allows Orbit to bind keyboard events to the slider, to animate frames with arrow keys
515
+ * @option
516
+ * @type {boolean}
517
+ * @default true
518
+ */
519
+ accessible: true,
520
+ /**
521
+ * Class applied to the container of Orbit
522
+ * @option
523
+ * @type {string}
524
+ * @default 'orbit-container'
525
+ */
526
+ containerClass: 'orbit-container',
527
+ /**
528
+ * Class applied to individual slides.
529
+ * @option
530
+ * @type {string}
531
+ * @default 'orbit-slide'
532
+ */
533
+ slideClass: 'orbit-slide',
534
+ /**
535
+ * Class applied to the bullet container. You're welcome.
536
+ * @option
537
+ * @type {string}
538
+ * @default 'orbit-bullets'
539
+ */
540
+ boxOfBullets: 'orbit-bullets',
541
+ /**
542
+ * Class applied to the `next` navigation button.
543
+ * @option
544
+ * @type {string}
545
+ * @default 'orbit-next'
546
+ */
547
+ nextClass: 'orbit-next',
548
+ /**
549
+ * Class applied to the `previous` navigation button.
550
+ * @option
551
+ * @type {string}
552
+ * @default 'orbit-previous'
553
+ */
554
+ prevClass: 'orbit-previous',
555
+ /**
556
+ * Boolean to flag the js to use motion ui classes or not. Default to true for backwards compatability.
557
+ * @option
558
+ * @type {boolean}
559
+ * @default true
560
+ */
561
+ useMUI: true
562
+ };
563
+
564
+ // Window exports
565
+ Foundation.plugin(Orbit, 'Orbit');
566
+ }(jQuery);