├── .gitignore ├── README.md ├── acf-json └── group_5504bb5d9b343.json ├── composer.json ├── functions.php ├── gulpfile.js ├── index.php ├── lib └── helpers.php ├── modules ├── carousel │ ├── _flickity.scss │ ├── carousel.js │ ├── carousel.php │ └── carousel.scss ├── hero │ ├── hero.php │ └── hero.scss ├── post │ └── post.php └── text-columns │ ├── text-columns.php │ └── text-columns.scss ├── package.json ├── scripts ├── main.min.js ├── main.min.js.map └── src │ ├── lib │ └── page-modules.js │ └── main.js ├── style.css ├── styles ├── main.min.css ├── main.min.css.map └── src │ ├── _typography.scss │ ├── _variables.scss │ └── main.scss └── tasks ├── browserify.js └── sass.js /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # modular 2 | 3 | A starter theme for creating flexible modular WordPress sites using Advanced Custom Fields. 4 | 5 | Requires ACF v5 (or v4 with the flexible content and repeater field add-ons) 6 | 7 | ## Features 8 | 9 | - Flexible page layouts using ACF's flexible content field 10 | - Gulp workflow and opinionated file structure for developing highly modular themes 11 | 12 | ## How to Use 13 | 14 | The starter theme includes a single page template, `index.php`. This template checks for a flexible content field active on the current page with the field name "`modules`". If the page has a modules field, it will loop through the selected field layouts for that page. For each layout, we include the template partial from the appropriate `modules` subfolder. 15 | 16 | Each module has a PHP template plus an optional SCSS stylesheet partial and/or JavaScript module. An ACF flexible content layout (with the same name as the module folder) is also used to create an interface for populating content into a module and placing it on a page. 17 | 18 | If you're using ACF 5.0 or newer you can use the sync feature to get started quickly with the included Page Modules flexible content field, which has layouts for the starter modules. Make sure you set the permissions on the `acf-json` folder to allow ACF to save changes to the theme file. 19 | 20 | Gulp is used to compile CSS from SCSS (as well as add vendor prefixes with Autoprefixer) and to package modular JavaScript code using Browserify. If you have Node and Gulp installed, you can run `npm install` to pull the project dependencies, then `gulp build` or `gulp dev` to run the compile tasks for production or development respectively. The `dev` task includes a `watch` setup for updating assets as you save changes and triggering livereload in the browser. 21 | 22 | ## How it Works 23 | 24 | The theme structure is designed to allow flexible creation of new modules that can be added to a page in any order using the ACF user interface. By using a flexible content field, and organizing and naming our module code to match the field layouts, we can create highly modular themes. 25 | 26 | A module can contain three parts: A __PHP template__, a __stylesheet partial (SCSS)__, and a __JavaScript module (CJS/Node-style)__. 27 | 28 | ### PHP 29 | 30 | The name of the module folder and template file should precisely match the name of the ACF field layout. For example, the "Text Columns" layout has the field name `text_columns` in ACF and the template is located at `modules/text-columns/text-columns.php`. The module's template is included within ACF's flexible content loop, so you can use `get_sub_field` and other ACF functions to populate variables with content added to that module. 31 | 32 | ### SCSS 33 | 34 | The main SCSS stylesheets are located in `styles/src/`. There is a `main.scss` file which includes global partials as well as any module styles. For module-specific styles, you can create a stylesheet in the module folder and `@import` it using just the module name. The Gulp SASS task config (`tasks/sass.js`) includes a function to add all of the module directories to SASS's import paths automatically. It's also configured to add source maps when running from the `gulp dev` task. 35 | 36 | ### JS 37 | 38 | The main script is located at `scripts/src/main.js`. The starter script includes a single function called on load, which checks the page for modules with a `data-module` attribute. This attribute is used in the template to indicate if a module includes an accompanying JS file, and should be set to the same name as the module folder and script file. 39 | 40 | For each JS-enabled module, the script is included using Browserify (which is configured to expose the module scripts using Gulp in `tasks/browserify.js`). Module scripts are expected to export a function (using CommonJS syntax) which takes the module's DOM element as its first parameter. An example of this can be seen in the `carousel` starter module, which includes a script to initialize the "Flickity" slider plugin on the calling element. -------------------------------------------------------------------------------- /acf-json/group_5504bb5d9b343.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": "group_5504bb5d9b343", 3 | "title": "Page Modules", 4 | "fields": [ 5 | { 6 | "key": "field_5504bb62a6c8f", 7 | "label": "Modules", 8 | "name": "modules", 9 | "type": "flexible_content", 10 | "instructions": "", 11 | "required": 0, 12 | "conditional_logic": 0, 13 | "wrapper": { 14 | "width": "", 15 | "class": "", 16 | "id": "" 17 | }, 18 | "button_label": "Add Module", 19 | "min": "", 20 | "max": "", 21 | "layouts": [ 22 | { 23 | "key": "5504bb6d8b506", 24 | "name": "hero", 25 | "label": "Hero", 26 | "display": "block", 27 | "sub_fields": [ 28 | { 29 | "key": "field_5504bb7ea6c90", 30 | "label": "Background Image", 31 | "name": "background_image", 32 | "type": "image", 33 | "instructions": "", 34 | "required": 0, 35 | "conditional_logic": 0, 36 | "wrapper": { 37 | "width": "", 38 | "class": "", 39 | "id": "" 40 | }, 41 | "return_format": "array", 42 | "preview_size": "thumbnail", 43 | "library": "all", 44 | "min_width": "", 45 | "min_height": "", 46 | "min_size": "", 47 | "max_width": "", 48 | "max_height": "", 49 | "max_size": "", 50 | "mime_types": "" 51 | }, 52 | { 53 | "key": "field_5504bb87a6c91", 54 | "label": "Content", 55 | "name": "content", 56 | "type": "wysiwyg", 57 | "instructions": "", 58 | "required": 0, 59 | "conditional_logic": 0, 60 | "wrapper": { 61 | "width": "", 62 | "class": "", 63 | "id": "" 64 | }, 65 | "default_value": "", 66 | "tabs": "all", 67 | "toolbar": "full", 68 | "media_upload": 1 69 | } 70 | ], 71 | "min": "", 72 | "max": "" 73 | }, 74 | { 75 | "key": "5504bbf5a6c95", 76 | "name": "carousel", 77 | "label": "Carousel", 78 | "display": "table", 79 | "sub_fields": [ 80 | { 81 | "key": "field_5504bbfca6c96", 82 | "label": "Slides", 83 | "name": "slides", 84 | "type": "repeater", 85 | "instructions": "", 86 | "required": 0, 87 | "conditional_logic": 0, 88 | "wrapper": { 89 | "width": "", 90 | "class": "", 91 | "id": "" 92 | }, 93 | "min": 1, 94 | "max": "", 95 | "layout": "block", 96 | "button_label": "Add Slide", 97 | "sub_fields": [ 98 | { 99 | "key": "field_5504bc0da6c97", 100 | "label": "Content", 101 | "name": "content", 102 | "type": "wysiwyg", 103 | "instructions": "", 104 | "required": 0, 105 | "conditional_logic": 0, 106 | "wrapper": { 107 | "width": "", 108 | "class": "", 109 | "id": "" 110 | }, 111 | "default_value": "", 112 | "tabs": "all", 113 | "toolbar": "full", 114 | "media_upload": 1 115 | } 116 | ] 117 | } 118 | ], 119 | "min": "", 120 | "max": "" 121 | }, 122 | { 123 | "key": "5504d162446b7", 124 | "name": "text_columns", 125 | "label": "Text Columns", 126 | "display": "table", 127 | "sub_fields": [ 128 | { 129 | "key": "field_5504d16b446b8", 130 | "label": "Columns", 131 | "name": "columns", 132 | "type": "repeater", 133 | "instructions": "", 134 | "required": 0, 135 | "conditional_logic": 0, 136 | "wrapper": { 137 | "width": "", 138 | "class": "", 139 | "id": "" 140 | }, 141 | "min": 1, 142 | "max": 3, 143 | "layout": "block", 144 | "button_label": "Add Column", 145 | "sub_fields": [ 146 | { 147 | "key": "field_5504d183446b9", 148 | "label": "Content", 149 | "name": "content", 150 | "type": "wysiwyg", 151 | "instructions": "", 152 | "required": 0, 153 | "conditional_logic": 0, 154 | "wrapper": { 155 | "width": "", 156 | "class": "", 157 | "id": "" 158 | }, 159 | "default_value": "", 160 | "tabs": "all", 161 | "toolbar": "full", 162 | "media_upload": 1 163 | } 164 | ] 165 | } 166 | ], 167 | "min": "", 168 | "max": "" 169 | }, 170 | { 171 | "key": "55e11c6fdb6bd", 172 | "name": "post", 173 | "label": "Post", 174 | "display": "block", 175 | "sub_fields": [ 176 | { 177 | "key": "field_55e11d12db6c0", 178 | "label": "Post", 179 | "name": "module_post", 180 | "type": "post_object", 181 | "instructions": "", 182 | "required": 0, 183 | "conditional_logic": 0, 184 | "wrapper": { 185 | "width": "", 186 | "class": "", 187 | "id": "" 188 | }, 189 | "post_type": [ 190 | "post" 191 | ], 192 | "taxonomy": [], 193 | "allow_null": 0, 194 | "multiple": 0, 195 | "return_format": "object", 196 | "ui": 1 197 | }, 198 | { 199 | "key": "field_55e11ca9db6bf", 200 | "label": "Header", 201 | "name": "show_post_header", 202 | "type": "true_false", 203 | "instructions": "Show the header, including title and post date.", 204 | "required": 0, 205 | "conditional_logic": 0, 206 | "wrapper": { 207 | "width": "", 208 | "class": "", 209 | "id": "" 210 | }, 211 | "message": "Show post header", 212 | "default_value": 0 213 | }, 214 | { 215 | "key": "field_55e11c87db6be", 216 | "label": "Content Length", 217 | "name": "show_full_content", 218 | "type": "true_false", 219 | "instructions": "Display the full text instead of an excerpt.", 220 | "required": 0, 221 | "conditional_logic": 0, 222 | "wrapper": { 223 | "width": "", 224 | "class": "", 225 | "id": "" 226 | }, 227 | "message": "Show full message", 228 | "default_value": 0 229 | } 230 | ], 231 | "min": "", 232 | "max": "" 233 | } 234 | ] 235 | } 236 | ], 237 | "location": [ 238 | [ 239 | { 240 | "param": "post_type", 241 | "operator": "==", 242 | "value": "page" 243 | } 244 | ] 245 | ], 246 | "menu_order": 0, 247 | "position": "normal", 248 | "style": "seamless", 249 | "label_placement": "top", 250 | "instruction_placement": "label", 251 | "hide_on_screen": [ 252 | "the_content" 253 | ], 254 | "active": 1, 255 | "description": "", 256 | "modified": 1445816921 257 | } -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "modular", 3 | "authors": [], 4 | "require": {} 5 | } 6 | -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | version; 15 | 16 | wp_enqueue_style( 'main', 17 | get_template_directory_uri().'/styles/main.min.css', 18 | array(), 19 | $theme_ver 20 | ); 21 | 22 | wp_enqueue_script( 'main', 23 | get_template_directory_uri().'/scripts/main.min.js', 24 | array( 'jquery' ), 25 | $theme_ver, 26 | true 27 | ); 28 | 29 | } ); -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var livereload = require('gulp-livereload'); 3 | 4 | require('./tasks/sass'); 5 | require('./tasks/browserify'); 6 | 7 | /** 8 | * Defines the "build" task for Gulp. 9 | */ 10 | gulp.task('build', ['sass', 'browserify']); 11 | 12 | /** 13 | * Defines the default (development) task for Gulp. 14 | */ 15 | gulp.task('default', ['sass', 'watchify'], function() { 16 | livereload.listen(); 17 | 18 | // Watch stylesheets 19 | gulp.watch(['./**/*.scss'], ['sass']); 20 | 21 | // Watchify handles the scripts 22 | 23 | // When compile tasks finish, trigger livereload 24 | gulp.watch(['./styles/*.css', './scripts/*.js'], function(event) { 25 | livereload.changed(event.path); 26 | }); 27 | }); -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | > 9 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /lib/helpers.php: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 |
11 | 12 | 19 | 20 |
21 | 22 | 28 | -------------------------------------------------------------------------------- /modules/carousel/carousel.scss: -------------------------------------------------------------------------------- 1 | @import "flickity"; -------------------------------------------------------------------------------- /modules/hero/hero.php: -------------------------------------------------------------------------------- 1 | 7 | 8 |
9 | 14 |
-------------------------------------------------------------------------------- /modules/hero/hero.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ScottPolhemus/modular/987e8afb1f41460d8edd87cab9c0b97351c34187/modules/hero/hero.scss -------------------------------------------------------------------------------- /modules/post/post.php: -------------------------------------------------------------------------------- 1 | 12 |
13 | 15 |
16 |

17 |

by

18 |

19 | 22 |
23 | 34 |
35 |
36 | -------------------------------------------------------------------------------- /modules/text-columns/text-columns.php: -------------------------------------------------------------------------------- 1 |
2 | 7 | 8 |
9 | 13 |
14 | 15 | 19 |
-------------------------------------------------------------------------------- /modules/text-columns/text-columns.scss: -------------------------------------------------------------------------------- 1 | section.text-columns { 2 | @media (min-width: $break-mobile-min) { 3 | display: table; 4 | width: 100%; 5 | table-layout: fixed; 6 | 7 | > .column { 8 | display: table-cell; 9 | vertical-align: top; 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "modular", 3 | "version": "0.0.0", 4 | "description": "A starter theme for creating flexible modular WordPress sites using Advanced Custom Fields", 5 | "author": "Scott Polhemus ", 6 | "devDependencies": { 7 | "autoprefixer": "^6.1.0", 8 | "browserify": "^11.2.0", 9 | "browserify-shim": "^3.8.11", 10 | "glob": "^5.0.15", 11 | "gulp": "^3.9.0", 12 | "gulp-livereload": "^3.8.1", 13 | "gulp-postcss": "^6.0.1", 14 | "gulp-rename": "^1.2.2", 15 | "gulp-sass": "^2.1.0", 16 | "gulp-sourcemaps": "^1.6.0", 17 | "gulp-util": "^3.0.7", 18 | "minifyify": "^7.1.0", 19 | "pretty-hrtime": "^1.0.1", 20 | "watchify": "^3.6.0" 21 | }, 22 | "dependencies": { 23 | "flickity": "^1.1.1" 24 | }, 25 | "browserify-shim": { 26 | "jquery": "global:jQuery" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /scripts/main.min.js: -------------------------------------------------------------------------------- 1 | require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;or;r++)if(t=n[r]+e,"string"==typeof o[t])return t}}var n="Webkit Moz ms Ms O".split(" "),o=document.documentElement.style;"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof exports?module.exports=t:e.getStyleProperty=t}(window); 7 | },{}],3:[function(require,module,exports){ 8 | !function(e){"use strict";function t(e,t){return e[i](t)}function n(e){if(!e.parentNode){var t=document.createDocumentFragment();t.appendChild(e)}}function r(e,t){n(e);for(var r=e.parentNode.querySelectorAll(t),o=0,c=r.length;c>o;o++)if(r[o]===e)return!0;return!1}function o(e,r){return n(e),t(e,r)}var c,i=function(){if(e.matches)return"matches";if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],n=0,r=t.length;r>n;n++){var o=t[n],c=o+"MatchesSelector";if(e[c])return c}}();if(i){var u=document.createElement("div"),f=t(u,"div");c=f?t:o}else c=r;"function"==typeof define&&define.amd?define(function(){return c}):"object"==typeof exports?module.exports=c:window.matchesSelector=c}(Element.prototype); 9 | },{}],4:[function(require,module,exports){ 10 | !function(e){"use strict";function t(e){"function"==typeof e&&(t.isReady?e():o.push(e))}function n(e){var n="readystatechange"===e.type&&"complete"!==d.readyState;if(!t.isReady&&!n){t.isReady=!0;for(var i=0,a=o.length;a>i;i++){var r=o[i];r()}}}function i(i){return i.bind(d,"DOMContentLoaded",n),i.bind(d,"readystatechange",n),i.bind(e,"load",n),t}var d=e.document,o=[];t.isReady=!1,"function"==typeof define&&define.amd?(t.isReady="function"==typeof requirejs,define(["eventie/eventie"],i)):"object"==typeof exports?module.exports=i(require("eventie")):e.docReady=i(e.eventie)}(window); 11 | },{"eventie":5}],5:[function(require,module,exports){ 12 | !function(e){"use strict";function n(n){var t=e.event;return t.target=t.target||t.srcElement||n,t}var t=document.documentElement,o=function(){};t.addEventListener?o=function(e,n,t){e.addEventListener(n,t,!1)}:t.attachEvent&&(o=function(e,t,o){e[t+o]=o.handleEvent?function(){var t=n(e);o.handleEvent.call(o,t)}:function(){var t=n(e);o.call(e,t)},e.attachEvent("on"+t,e[t+o])});var c=function(){};t.removeEventListener?c=function(e,n,t){e.removeEventListener(n,t,!1)}:t.detachEvent&&(c=function(e,n,t){e.detachEvent("on"+n,e[n+t]);try{delete e[n+t]}catch(o){e[n+t]=void 0}});var i={bind:o,unbind:c};"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i:e.eventie=i}(window); 13 | },{}],6:[function(require,module,exports){ 14 | !function(e,t){"use strict";"function"==typeof define&&define.amd?define(["doc-ready/doc-ready","matches-selector/matches-selector"],function(n,r){return t(e,n,r)}):"object"==typeof exports?module.exports=t(e,require("doc-ready"),require("desandro-matches-selector")):e.fizzyUIUtils=t(e,e.docReady,e.matchesSelector)}(window,function(e,t,n){"use strict";var r={};r.extend=function(e,t){for(var n in t)e[n]=t[n];return e},r.modulo=function(e,t){return(e%t+t)%t};var o=Object.prototype.toString;r.isArray=function(e){return"[object Array]"==o.call(e)},r.makeArray=function(e){var t=[];if(r.isArray(e))t=e;else if(e&&"number"==typeof e.length)for(var n=0,o=e.length;o>n;n++)t.push(e[n]);else t.push(e);return t},r.indexOf=Array.prototype.indexOf?function(e,t){return e.indexOf(t)}:function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},r.removeFrom=function(e,t){var n=r.indexOf(e,t);-1!=n&&e.splice(n,1)},r.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(e){return e instanceof HTMLElement}:function(e){return e&&"object"==typeof e&&1==e.nodeType&&"string"==typeof e.nodeName},r.setText=function(){function e(e,n){t=t||(void 0!==document.documentElement.textContent?"textContent":"innerText"),e[t]=n}var t;return e}(),r.getParent=function(e,t){for(;e!=document.body;)if(e=e.parentNode,n(e,t))return e},r.getQueryElement=function(e){return"string"==typeof e?document.querySelector(e):e},r.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},r.filterFindElements=function(e,t){e=r.makeArray(e);for(var o=[],i=0,u=e.length;u>i;i++){var c=e[i];if(r.isElement(c))if(t){n(c,t)&&o.push(c);for(var a=c.querySelectorAll(t),f=0,s=a.length;s>f;f++)o.push(a[f])}else o.push(c)}return o},r.debounceMethod=function(e,t,n){var r=e.prototype[t],o=t+"Timeout";e.prototype[t]=function(){var e=this[o];e&&clearTimeout(e);var t=arguments,i=this;this[o]=setTimeout(function(){r.apply(i,t),delete i[o]},n||100)}},r.toDashed=function(e){return e.replace(/(.)([A-Z])/g,function(e,t,n){return t+"-"+n}).toLowerCase()};var i=e.console;return r.htmlInit=function(n,o){t(function(){for(var t=r.toDashed(o),u=document.querySelectorAll(".js-"+t),c="data-"+t+"-options",a=0,f=u.length;f>a;a++){var s,d=u[a],l=d.getAttribute(c);try{s=l&&JSON.parse(l)}catch(p){i&&i.error("Error parsing "+c+" on "+d.nodeName.toLowerCase()+(d.id?"#"+d.id:"")+": "+p);continue}var y=new n(d,s),m=e.jQuery;m&&m.data(d,o,y)}})},r}); 15 | },{"desandro-matches-selector":3,"doc-ready":4}],7:[function(require,module,exports){ 16 | !function(e,t){"use strict";"function"==typeof define&&define.amd?define(["./flickity","fizzy-ui-utils/utils"],function(i,l){return t(e,i,l)}):"object"==typeof exports?module.exports=t(e,require("./flickity"),require("fizzy-ui-utils")):t(e,e.Flickity,e.fizzyUIUtils)}(window,function(e,t,i){"use strict";function l(e){for(var t=document.createDocumentFragment(),i=0,l=e.length;l>i;i++){var s=e[i];t.appendChild(s.element)}return t}return t.prototype.insert=function(e,t){var i=this._makeCells(e);if(i&&i.length){var s=this.cells.length;t=void 0===t?s:t;var n=l(i),h=t==s;if(h)this.slider.appendChild(n);else{var c=this.cells[t].element;this.slider.insertBefore(n,c)}if(0===t)this.cells=i.concat(this.cells);else if(h)this.cells=this.cells.concat(i);else{var o=this.cells.splice(t,s-t);this.cells=this.cells.concat(i).concat(o)}this._sizeCells(i);var r=t>this.selectedIndex?0:i.length;this._cellAddedRemoved(t,r)}},t.prototype.append=function(e){this.insert(e,this.cells.length)},t.prototype.prepend=function(e){this.insert(e,0)},t.prototype.remove=function(e){var t,l,s,n=this.getCells(e),h=0;for(t=0,l=n.length;l>t;t++){s=n[t];var c=i.indexOf(this.cells,s)t;t++)s=n[t],s.remove(),i.removeFrom(this.cells,s);n.length&&this._cellAddedRemoved(0,h)},t.prototype._cellAddedRemoved=function(e,t){t=t||0,this.selectedIndex+=t,this.selectedIndex=Math.max(0,Math.min(this.cells.length-1,this.selectedIndex)),this.emitEvent("cellAddedRemoved",[e,t]),this.cellChange(e,!0)},t.prototype.cellSizeChange=function(e){var t=this.getCell(e);if(t){t.getSize();var l=i.indexOf(this.cells,t);this.cellChange(l)}},t.prototype.cellChange=function(e,t){var i=this.slideableWidth;this._positionCells(e),this._getWrapShiftCells(),this.setGallerySize(),this.options.freeScroll?(this.x+=i-this.slideableWidth,this.positionSlider()):(t&&this.positionSliderAtSelected(),this.select(this.selectedIndex))},t}); 17 | },{"./flickity":11,"fizzy-ui-utils":6}],8:[function(require,module,exports){ 18 | !function(t,i){"use strict";"function"==typeof define&&define.amd?define(["get-style-property/get-style-property","fizzy-ui-utils/utils"],function(e,s){return i(t,e,s)}):"object"==typeof exports?module.exports=i(t,require("desandro-get-style-property"),require("fizzy-ui-utils")):(t.Flickity=t.Flickity||{},t.Flickity.animatePrototype=i(t,t.getStyleProperty,t.fizzyUIUtils))}(window,function(t,i,e){"use strict";for(var s,n=0,r="webkit moz ms o".split(" "),o=t.requestAnimationFrame,h=t.cancelAnimationFrame,l=0;l1&&(t=e.modulo(t,this.slideableWidth),t-=this.slideableWidth,this.shiftWrapCells(t)),t+=this.cursorPosition,t=this.options.rightToLeft&&c?-t:t;var i=this.getPositionValue(t);c?this.slider.style[c]=u&&this.isAnimating?"translate3d("+i+",0,0)":"translateX("+i+")":this.slider.style[this.originSide]=i},a.positionSliderAtSelected=function(){if(this.cells.length){var t=this.cells[this.selectedIndex];this.x=-t.target,this.positionSlider()}},a.getPositionValue=function(t){return this.options.percentPosition?.01*Math.round(t/this.size.innerWidth*1e4)+"%":Math.round(t)+"px"},a.settle=function(t){this.isPointerDown||Math.round(100*this.x)!=Math.round(100*t)||this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,u&&this.positionSlider(),this.dispatchEvent("settle"))},a.shiftWrapCells=function(t){var i=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,i,-1);var e=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,e,1)},a._shiftCells=function(t,i,e){for(var s=0,n=t.length;n>s;s++){var r=t[s],o=i>0?e:0;r.wrapShift(o),i-=r.size.outerWidth}},a._unshiftCells=function(t){if(t&&t.length)for(var i=0,e=t.length;e>i;i++)t[i].wrapShift(0)},a.integratePhysics=function(){this.velocity+=this.accel,this.x+=this.velocity,this.velocity*=this.getFrictionFactor(),this.accel=0},a.applyForce=function(t){this.accel+=t},a.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]},a.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())},a.applyDragForce=function(){if(this.isPointerDown){var t=this.dragX-this.x,i=t-this.velocity;this.applyForce(i)}},a.applySelectedAttraction=function(){var t=this.cells.length;if(!this.isPointerDown&&!this.isFreeScrolling&&t){var i=this.cells[this.selectedIndex],e=this.options.wrapAround&&t>1?this.slideableWidth*Math.floor(this.selectedIndex/t):0,s=-1*(i.target+e)-this.x,n=s*this.options.selectedAttraction;this.applyForce(n)}},a}); 19 | },{"desandro-get-style-property":2,"fizzy-ui-utils":6}],9:[function(require,module,exports){ 20 | !function(t,e){"use strict";"function"==typeof define&&define.amd?define(["get-size/get-size"],function(i){return e(t,i)}):"object"==typeof exports?module.exports=e(t,require("get-size")):(t.Flickity=t.Flickity||{},t.Flickity.Cell=e(t,t.getSize))}(window,function(t,e){"use strict";function i(t,e){this.element=t,this.parent=e,this.create()}var n="attachEvent"in t;return i.prototype.create=function(){this.element.style.position="absolute",n&&this.element.setAttribute("unselectable","on"),this.x=0,this.shift=0},i.prototype.destroy=function(){this.element.style.position="";var t=this.parent.originSide;this.element.style[t]=""},i.prototype.getSize=function(){this.size=e(this.element)},i.prototype.setPosition=function(t){this.x=t,this.setDefaultTarget(),this.renderPosition(t)},i.prototype.setDefaultTarget=function(){var t="left"==this.parent.originSide?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign},i.prototype.renderPosition=function(t){var e=this.parent.originSide;this.element.style[e]=this.parent.getPositionValue(t)},i.prototype.wrapShift=function(t){this.shift=t,this.renderPosition(this.x+this.parent.slideableWidth*t)},i.prototype.remove=function(){this.element.parentNode.removeChild(this.element)},i}); 21 | },{"get-size":17}],10:[function(require,module,exports){ 22 | !function(t,e){"use strict";"function"==typeof define&&define.amd?define(["classie/classie","eventie/eventie","./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(i,o,r,n,s){return e(t,i,o,r,n,s)}):"object"==typeof exports?module.exports=e(t,require("desandro-classie"),require("eventie"),require("./flickity"),require("unidragger"),require("fizzy-ui-utils")):t.Flickity=e(t,t.classie,t.eventie,t.Flickity,t.Unidragger,t.fizzyUIUtils)}(window,function(t,e,i,o,r,n){"use strict";function s(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function a(e){var i=r.getPointerPoint(e);return i.y-t.pageYOffset}n.extend(o.defaults,{draggable:!0,touchVerticalScroll:!0}),o.createMethods.push("_createDrag"),n.extend(o.prototype,r.prototype),o.prototype._createDrag=function(){this.on("activate",this.bindDrag),this.on("uiChange",this._uiChangeDrag),this.on("childUIPointerDown",this._childUIPointerDownDrag),this.on("deactivate",this.unbindDrag)},o.prototype.bindDrag=function(){this.options.draggable&&!this.isDragBound&&(e.add(this.element,"is-draggable"),this.handles=[this.viewport],this.bindHandles(),this.isDragBound=!0)},o.prototype.unbindDrag=function(){this.isDragBound&&(e.remove(this.element,"is-draggable"),this.unbindHandles(),delete this.isDragBound)},o.prototype._uiChangeDrag=function(){delete this.isFreeScrolling},o.prototype._childUIPointerDownDrag=function(t){s(t),this.pointerDownFocus(t)},o.prototype.pointerDown=function(o,n){if("INPUT"==o.target.nodeName&&"range"==o.target.type)return this.isPointerDown=!1,void delete this.pointerIdentifier;this._dragPointerDown(o,n);var s=document.activeElement;s&&s.blur&&s!=this.element&&s!=document.body&&s.blur(),this.pointerDownFocus(o),this.dragX=this.x,e.add(this.viewport,"is-pointer-down"),this._bindPostStartEvents(o),this.pointerDownScroll=r.getScrollPosition(),i.bind(t,"scroll",this),this.dispatchEvent("pointerDown",o,[n])};var h={touchstart:!0,MSPointerDown:!0},l={INPUT:!0,SELECT:!0};o.prototype.pointerDownFocus=function(t){!this.options.accessibility||h[t.type]||l[t.target.nodeName]||this.element.focus()},o.prototype.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.touchVerticalScrollMove(t,e,i),this._dragMove(t,e,i),this.dispatchEvent("pointerMove",t,[e,i])},o.prototype.hasDragStarted=function(t){return!this.isTouchScrolling&&Math.abs(t.x)>3},o.prototype.pointerUp=function(t,i){delete this.isTouchScrolling,e.remove(this.viewport,"is-pointer-down"),this.dispatchEvent("pointerUp",t,[i]),this._dragPointerUp(t,i)};var c={touchmove:!0,MSPointerMove:!0};return o.prototype.touchVerticalScrollMove=function(e,i,o){var r=this.options.touchVerticalScroll,n="withDrag"==r?!r:this.isDragging||!r;!n&&c[e.type]&&!this.isTouchScrolling&&Math.abs(o.y)>10&&(this.startScrollY=t.pageYOffset,this.pointerWindowStartY=a(i),this.isTouchScrolling=!0)},o.prototype.dragStart=function(t,e){this.dragStartPosition=this.x,this.startAnimation(),this.dispatchEvent("dragStart",t,[e])},o.prototype.dragMove=function(t,e,i){s(t),this.previousDragX=this.dragX;var o=this.options.rightToLeft?-1:1,r=this.dragStartPosition+i.x*o;if(!this.options.wrapAround&&this.cells.length){var n=Math.max(-this.cells[0].target,this.dragStartPosition);r=r>n?.5*(r+n):r;var a=Math.min(-this.getLastCell().target,this.dragStartPosition);r=a>r?.5*(r+a):r}this.dragX=r,this.dragMoveTime=new Date,this.dispatchEvent("dragMove",t,[e,i])},o.prototype.dragEnd=function(t,e){this.options.freeScroll&&(this.isFreeScrolling=!0);var i=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var o=this.getRestingPosition();this.isFreeScrolling=-o>this.cells[0].target&&-o=t}:function(t,e){return e>t};n(e,r)&&(o+=i,r=e,e=this.getCellDistance(-t,o),null!==e);)e=Math.abs(e);return{distance:r,index:o-i}},o.prototype.getCellDistance=function(t,e){var i=this.cells.length,o=this.options.wrapAround&&i>1,r=o?n.modulo(e,i):e,s=this.cells[r];if(!s)return null;var a=o?this.slideableWidth*Math.floor(e/i):0;return t-(s.target+a)},o.prototype.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;var t=this.getCellDistance(-this.dragX,this.selectedIndex),e=this.previousDragX-this.dragX;return t>0&&e>0?1:0>t&&0>e?-1:0},o.prototype.staticClick=function(t,e){var i=this.getParentCell(t.target),o=i&&i.element,r=i&&n.indexOf(this.cells,i);this.dispatchEvent("staticClick",t,[e,o,r])},o}); 23 | },{"./flickity":11,"desandro-classie":1,"eventie":5,"fizzy-ui-utils":6,"unidragger":19}],11:[function(require,module,exports){ 24 | !function(t,e){"use strict";if("function"==typeof define&&define.amd)define(["classie/classie","eventEmitter/EventEmitter","eventie/eventie","get-size/get-size","fizzy-ui-utils/utils","./cell","./animate"],function(i,s,l,n,o,r,h){return e(t,i,s,l,n,o,r,h)});else if("object"==typeof exports)module.exports=e(t,require("desandro-classie"),require("wolfy87-eventemitter"),require("eventie"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./animate"));else{var i=t.Flickity;t.Flickity=e(t,t.classie,t.EventEmitter,t.eventie,t.getSize,t.fizzyUIUtils,i.Cell,i.animatePrototype)}}(window,function(t,e,i,s,l,n,o,r){"use strict";function h(t,e){for(t=n.makeArray(t);t.length;)e.appendChild(t.shift())}function c(t,e){var i=n.getQueryElement(t);return i?(this.element=i,a&&(this.$element=a(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e),void this._create()):void(p&&p.error("Bad element for Flickity: "+(i||t)))}var a=t.jQuery,d=t.getComputedStyle,p=t.console,f=0,u={};c.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},c.createMethods=[],n.extend(c.prototype,i.prototype),c.prototype._create=function(){var e=this.guid=++f;this.element.flickityGUID=e,u[e]=this,this.selectedIndex=this.options.initialIndex||0,this.restingFrames=0,this.x=0,this.velocity=0,this.accel=0,this.originSide=this.options.rightToLeft?"right":"left",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",c.setUnselectable(this.viewport),this._createSlider(),(this.options.resize||this.options.watchCSS)&&(s.bind(t,"resize",this),this.isResizeBound=!0);for(var i=0,l=c.createMethods.length;l>i;i++){var n=c.createMethods[i];this[n]()}this.options.watchCSS?this.watchCSS():this.activate()},c.prototype.option=function(t){n.extend(this.options,t)},c.prototype.activate=function(){if(!this.isActive){this.isActive=!0,e.add(this.element,"flickity-enabled"),this.options.rightToLeft&&e.add(this.element,"flickity-rtl"),this.getSize();var t=this._filterFindCellElements(this.element.children);h(t,this.slider),this.viewport.appendChild(this.slider),this.element.appendChild(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,s.bind(this.element,"keydown",this)),this.emit("activate"),this.positionSliderAtSelected(),this.select(this.selectedIndex)}},c.prototype._createSlider=function(){var t=document.createElement("div");t.className="flickity-slider",t.style[this.originSide]=0,this.slider=t},c.prototype._filterFindCellElements=function(t){return n.filterFindElements(t,this.options.cellSelector)},c.prototype.reloadCells=function(){this.cells=this._makeCells(this.slider.children),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize()},c.prototype._makeCells=function(t){for(var e=this._filterFindCellElements(t),i=[],s=0,l=e.length;l>s;s++){var n=e[s],r=new o(n,this);i.push(r)}return i},c.prototype.getLastCell=function(){return this.cells[this.cells.length-1]},c.prototype.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},c.prototype._positionCells=function(t){t=t||0,this.maxCellHeight=t?this.maxCellHeight||0:0;var e=0;if(t>0){var i=this.cells[t-1];e=i.x+i.size.outerWidth}for(var s,l=this.cells.length,n=t;l>n;n++)s=this.cells[n],s.setPosition(e),e+=s.size.outerWidth,this.maxCellHeight=Math.max(s.size.outerHeight,this.maxCellHeight);this.slideableWidth=e,this._containCells()},c.prototype._sizeCells=function(t){for(var e=0,i=t.length;i>e;e++){var s=t[e];s.getSize()}},c.prototype._init=c.prototype.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},c.prototype.getSize=function(){this.size=l(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};var v={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};c.prototype.setCellAlign=function(){var t=v[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign},c.prototype.setGallerySize=function(){this.options.setGallerySize&&(this.viewport.style.height=this.maxCellHeight+"px")},c.prototype._getWrapShiftCells=function(){if(this.options.wrapAround){this._unshiftCells(this.beforeShiftCells),this._unshiftCells(this.afterShiftCells);var t=this.cursorPosition,e=this.cells.length-1;this.beforeShiftCells=this._getGapCells(t,e,-1),t=this.size.innerWidth-this.cursorPosition,this.afterShiftCells=this._getGapCells(t,0,1)}},c.prototype._getGapCells=function(t,e,i){for(var s=[];t>0;){var l=this.cells[e];if(!l)break;s.push(l),e+=i,t-=l.size.outerWidth}return s},c.prototype._containCells=function(){if(this.options.contain&&!this.options.wrapAround&&this.cells.length)for(var t=this.options.rightToLeft?"marginRight":"marginLeft",e=this.options.rightToLeft?"marginLeft":"marginRight",i=this.cells[0].size[t],s=this.getLastCell(),l=this.slideableWidth-s.size[e],n=l-this.size.innerWidth*(1-this.cellAlign),o=lr;r++){var c=this.cells[r];c.setDefaultTarget(),o?c.target=l*this.cellAlign:(c.target=Math.max(c.target,this.cursorPosition+i),c.target=Math.min(c.target,n))}},c.prototype.dispatchEvent=function(t,e,i){var s=[e].concat(i);if(this.emitEvent(t,s),a&&this.$element)if(e){var l=a.Event(e);l.type=t,this.$element.trigger(l,i)}else this.$element.trigger(t,i)},c.prototype.select=function(t,e){if(this.isActive){var i=this.cells.length;this.options.wrapAround&&i>1&&(0>t?this.x-=this.slideableWidth:t>=i&&(this.x+=this.slideableWidth)),(this.options.wrapAround||e)&&(t=n.modulo(t,i)),this.cells[t]&&(this.selectedIndex=t,this.setSelectedCell(),this.startAnimation(),this.dispatchEvent("cellSelect"))}},c.prototype.previous=function(t){this.select(this.selectedIndex-1,t)},c.prototype.next=function(t){this.select(this.selectedIndex+1,t)},c.prototype.setSelectedCell=function(){this._removeSelectedCellClass(),this.selectedCell=this.cells[this.selectedIndex],this.selectedElement=this.selectedCell.element,e.add(this.selectedElement,"is-selected")},c.prototype._removeSelectedCellClass=function(){this.selectedCell&&e.remove(this.selectedCell.element,"is-selected")},c.prototype.getCell=function(t){for(var e=0,i=this.cells.length;i>e;e++){var s=this.cells[e];if(s.element==t)return s}},c.prototype.getCells=function(t){t=n.makeArray(t);for(var e=[],i=0,s=t.length;s>i;i++){var l=t[i],o=this.getCell(l);o&&e.push(o)}return e},c.prototype.getCellElements=function(){for(var t=[],e=0,i=this.cells.length;i>e;e++)t.push(this.cells[e].element);return t},c.prototype.getParentCell=function(t){var e=this.getCell(t);return e?e:(t=n.getParent(t,".flickity-slider > *"),this.getCell(t))},c.prototype.getAdjacentCellElements=function(t,e){if(!t)return[this.selectedElement];e=void 0===e?this.selectedIndex:e;var i=this.cells.length;if(1+2*t>=i)return this.getCellElements();for(var s=[],l=e-t;e+t>=l;l++){var o=this.options.wrapAround?n.modulo(l,i):l,r=this.cells[o];r&&s.push(r.element)}return s},c.prototype.uiChange=function(){this.emit("uiChange")},c.prototype.childUIPointerDown=function(t){this.emitEvent("childUIPointerDown",[t])},c.prototype.onresize=function(){this.watchCSS(),this.resize()},n.debounceMethod(c,"onresize",150),c.prototype.resize=function(){this.isActive&&(this.getSize(),this.options.wrapAround&&(this.x=n.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.positionSliderAtSelected())};var m=c.supportsConditionalCSS=function(){var t;return function(){if(void 0!==t)return t;if(!d)return void(t=!1);var e=document.createElement("style"),i=document.createTextNode('body:after { content: "foo"; display: none; }');e.appendChild(i),document.head.appendChild(e);var s=d(document.body,":after").content;return t=-1!=s.indexOf("foo"),document.head.removeChild(e),t}}();c.prototype.watchCSS=function(){var t=this.options.watchCSS;if(t){var e=m();if(!e){var i="fallbackOn"==t?"activate":"deactivate";return void this[i]()}var s=d(this.element,":after").content;-1!=s.indexOf("flickity")?this.activate():this.deactivate()}},c.prototype.onkeydown=function(t){if(this.options.accessibility&&(!document.activeElement||document.activeElement==this.element))if(37==t.keyCode){var e=this.options.rightToLeft?"next":"previous";this.uiChange(),this[e]()}else if(39==t.keyCode){var i=this.options.rightToLeft?"previous":"next";this.uiChange(),this[i]()}},c.prototype.deactivate=function(){if(this.isActive){e.remove(this.element,"flickity-enabled"),e.remove(this.element,"flickity-rtl");for(var t=0,i=this.cells.length;i>t;t++){var l=this.cells[t];l.destroy()}this._removeSelectedCellClass(),this.element.removeChild(this.viewport),h(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),s.unbind(this.element,"keydown",this)),this.isActive=!1,this.emit("deactivate")}},c.prototype.destroy=function(){this.deactivate(),this.isResizeBound&&s.unbind(t,"resize",this),this.emit("destroy"),a&&this.$element&&a.removeData(this.element,"flickity"),delete this.element.flickityGUID,delete u[this.guid]},n.extend(c.prototype,r);var g="attachEvent"in t;return c.setUnselectable=function(t){g&&t.setAttribute("unselectable","on")},c.data=function(t){t=n.getQueryElement(t);var e=t&&t.flickityGUID;return e&&u[e]},n.htmlInit(c,"flickity"),a&&a.bridget&&a.bridget("flickity",c),c.Cell=o,c}); 25 | },{"./animate":8,"./cell":9,"desandro-classie":1,"eventie":5,"fizzy-ui-utils":6,"get-size":17,"wolfy87-eventemitter":21}],12:[function(require,module,exports){ 26 | !function(e,r){"use strict";"function"==typeof define&&define.amd?define(["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],r):"object"==typeof exports&&(module.exports=r(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload")))}(window,function(e){return e}); 27 | },{"./add-remove-cell":7,"./drag":10,"./flickity":11,"./lazyload":13,"./page-dots":14,"./player":15,"./prev-next-button":16}],13:[function(require,module,exports){ 28 | !function(t,i){"use strict";"function"==typeof define&&define.amd?define(["classie/classie","eventie/eventie","./flickity","fizzy-ui-utils/utils"],function(e,o,l,a){return i(t,e,o,l,a)}):"object"==typeof exports?module.exports=i(t,require("desandro-classie"),require("eventie"),require("./flickity"),require("fizzy-ui-utils")):i(t,t.classie,t.eventie,t.Flickity,t.fizzyUIUtils)}(window,function(t,i,e,o,l){"use strict";function a(t){if("IMG"==t.nodeName&&t.getAttribute("data-flickity-lazyload"))return[t];var i=t.querySelectorAll("img[data-flickity-lazyload]");return l.makeArray(i)}function n(t,i){this.img=t,this.flickity=i,this.load()}return o.createMethods.push("_createLazyload"),o.prototype._createLazyload=function(){this.on("cellSelect",this.lazyLoad)},o.prototype.lazyLoad=function(){var t=this.options.lazyLoad;if(t){for(var i="number"==typeof t?t:0,e=this.getAdjacentCellElements(i),o=[],l=0,r=e.length;r>l;l++){var s=e[l],c=a(s);o=o.concat(c)}for(l=0,r=o.length;r>l;l++){var d=o[l];new n(d,this)}}},n.prototype.handleEvent=l.handleEvent,n.prototype.load=function(){e.bind(this.img,"load",this),e.bind(this.img,"error",this),this.img.src=this.img.getAttribute("data-flickity-lazyload"),this.img.removeAttribute("data-flickity-lazyload")},n.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")},n.prototype.onerror=function(){this.complete(event,"flickity-lazyerror")},n.prototype.complete=function(t,o){e.unbind(this.img,"load",this),e.unbind(this.img,"error",this);var l=this.flickity.getParentCell(this.img),a=l&&l.element;this.flickity.cellSizeChange(a),i.add(this.img,o),this.flickity.dispatchEvent("lazyLoad",t,a)},o.LazyLoader=n,o}); 29 | },{"./flickity":11,"desandro-classie":1,"eventie":5,"fizzy-ui-utils":6}],14:[function(require,module,exports){ 30 | !function(t,e){"use strict";"function"==typeof define&&define.amd?define(["eventie/eventie","./flickity","tap-listener/tap-listener","fizzy-ui-utils/utils"],function(o,i,s,n){return e(t,o,i,s,n)}):"object"==typeof exports?module.exports=e(t,require("eventie"),require("./flickity"),require("tap-listener"),require("fizzy-ui-utils")):e(t,t.eventie,t.Flickity,t.TapListener,t.fizzyUIUtils)}(window,function(t,e,o,i,s){"use strict";function n(t){this.parent=t,this._create()}return n.prototype=new i,n.prototype._create=function(){this.holder=document.createElement("ol"),this.holder.className="flickity-page-dots",o.setUnselectable(this.holder),this.dots=[];var t=this;this.onCellSelect=function(){t.updateSelected()},this.parent.on("cellSelect",this.onCellSelect),this.on("tap",this.onTap),this.on("pointerDown",function(e,o){t.parent.childUIPointerDown(o)})},n.prototype.activate=function(){this.setDots(),this.updateSelected(),this.bindTap(this.holder),this.parent.element.appendChild(this.holder)},n.prototype.deactivate=function(){this.parent.element.removeChild(this.holder),i.prototype.destroy.call(this)},n.prototype.setDots=function(){var t=this.parent.cells.length-this.dots.length;t>0?this.addDots(t):0>t&&this.removeDots(-t)},n.prototype.addDots=function(t){for(var e=document.createDocumentFragment(),o=[];t;){var i=document.createElement("li");i.className="dot",e.appendChild(i),o.push(i),t--}this.holder.appendChild(e),this.dots=this.dots.concat(o)},n.prototype.removeDots=function(t){for(var e=this.dots.splice(this.dots.length-t,t),o=0,i=e.length;i>o;o++){var s=e[o];this.holder.removeChild(s)}},n.prototype.updateSelected=function(){this.selectedDot&&(this.selectedDot.className="dot"),this.dots.length&&(this.selectedDot=this.dots[this.parent.selectedIndex],this.selectedDot.className="dot is-selected")},n.prototype.onTap=function(t){var e=t.target;if("LI"==e.nodeName){this.parent.uiChange();var o=s.indexOf(this.dots,e);this.parent.select(o)}},n.prototype.destroy=function(){this.deactivate()},o.PageDots=n,s.extend(o.defaults,{pageDots:!0}),o.createMethods.push("_createPageDots"),o.prototype._createPageDots=function(){this.options.pageDots&&(this.pageDots=new n(this),this.on("activate",this.activatePageDots),this.on("cellAddedRemoved",this.onCellAddedRemovedPageDots),this.on("deactivate",this.deactivatePageDots))},o.prototype.activatePageDots=function(){this.pageDots.activate()},o.prototype.onCellAddedRemovedPageDots=function(){this.pageDots.setDots()},o.prototype.deactivatePageDots=function(){this.pageDots.deactivate()},o.PageDots=n,o}); 31 | },{"./flickity":11,"eventie":5,"fizzy-ui-utils":6,"tap-listener":18}],15:[function(require,module,exports){ 32 | !function(t,e){"use strict";"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie","./flickity"],function(t,i,n){return e(t,i,n)}):"object"==typeof exports?module.exports=e(require("wolfy87-eventemitter"),require("eventie"),require("./flickity")):e(t.EventEmitter,t.eventie,t.Flickity)}(window,function(t,e,i){"use strict";function n(t){if(this.isPlaying=!1,this.parent=t,o){var e=this;this.onVisibilityChange=function(){e.visibilityChange()}}}var s,o;return"hidden"in document?(s="hidden",o="visibilitychange"):"webkitHidden"in document&&(s="webkitHidden",o="webkitvisibilitychange"),n.prototype=new t,n.prototype.play=function(){this.isPlaying=!0,delete this.isPaused,o&&document.addEventListener(o,this.onVisibilityChange,!1),this.tick()},n.prototype.tick=function(){if(this.isPlaying&&!this.isPaused){this.tickTime=new Date;var t=this.parent.options.autoPlay;t="number"==typeof t?t:3e3;var e=this;this.timeout=setTimeout(function(){e.parent.next(!0),e.tick()},t)}},n.prototype.stop=function(){this.isPlaying=!1,delete this.isPaused,this.clear(),o&&document.removeEventListener(o,this.onVisibilityChange,!1)},n.prototype.clear=function(){clearTimeout(this.timeout)},n.prototype.pause=function(){this.isPlaying&&(this.isPaused=!0,this.clear())},n.prototype.unpause=function(){this.isPaused&&this.play()},n.prototype.visibilityChange=function(){var t=document[s];this[t?"pause":"unpause"]()},i.createMethods.push("_createPlayer"),i.prototype._createPlayer=function(){this.player=new n(this),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)},i.prototype.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),e.bind(this.element,"mouseenter",this),this.isMouseenterBound=!0)},i.prototype.stopPlayer=function(){this.player.stop()},i.prototype.deactivatePlayer=function(){this.player.stop(),this.isMouseenterBound&&(e.unbind(this.element,"mouseenter",this),delete this.isMouseenterBound)},i.prototype.onmouseenter=function(){this.player.pause(),e.bind(this.element,"mouseleave",this)},i.prototype.onmouseleave=function(){this.player.unpause(),e.unbind(this.element,"mouseleave",this)},i.Player=n,i}); 33 | },{"./flickity":11,"eventie":5,"wolfy87-eventemitter":21}],16:[function(require,module,exports){ 34 | !function(t,e){"use strict";"function"==typeof define&&define.amd?define(["eventie/eventie","./flickity","tap-listener/tap-listener","fizzy-ui-utils/utils"],function(i,n,s,r){return e(t,i,n,s,r)}):"object"==typeof exports?module.exports=e(t,require("eventie"),require("./flickity"),require("tap-listener"),require("fizzy-ui-utils")):e(t,t.eventie,t.Flickity,t.TapListener,t.fizzyUIUtils)}(window,function(t,e,i,n,s){"use strict";function r(t,e){this.direction=t,this.parent=e,this._create()}function o(t){return"string"==typeof t?t:"M "+t.x0+",50 L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50 L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}var a="http://www.w3.org/2000/svg",h=function(){function t(){if(void 0!==e)return e;var t=document.createElement("div");return t.innerHTML="",e=(t.firstChild&&t.firstChild.namespaceURI)==a}var e;return t}();return r.prototype=new n,r.prototype._create=function(){this.isEnabled=!0,this.isPrevious=-1==this.direction;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");if(e.className="flickity-prev-next-button",e.className+=this.isPrevious?" previous":" next",e.setAttribute("type","button"),i.setUnselectable(e),h()){var n=this.createSVG();e.appendChild(n)}else this.setArrowText(),e.className+=" no-svg";var s=this;this.onCellSelect=function(){s.update()},this.parent.on("cellSelect",this.onCellSelect),this.on("tap",this.onTap),this.on("pointerDown",function(t,e){s.parent.childUIPointerDown(e)})},r.prototype.activate=function(){this.update(),this.bindTap(this.element),e.bind(this.element,"click",this),this.parent.element.appendChild(this.element)},r.prototype.deactivate=function(){this.parent.element.removeChild(this.element),n.prototype.destroy.call(this),e.unbind(this.element,"click",this)},r.prototype.createSVG=function(){var t=document.createElementNS(a,"svg");t.setAttribute("viewBox","0 0 100 100");var e=document.createElementNS(a,"path"),i=o(this.parent.options.arrowShape);return e.setAttribute("d",i),e.setAttribute("class","arrow"),this.isLeft||e.setAttribute("transform","translate(100, 100) rotate(180) "),t.appendChild(e),t},r.prototype.setArrowText=function(){var t=this.parent.options,e=this.isLeft?t.leftArrowText:t.rightArrowText;s.setText(this.element,e)},r.prototype.onTap=function(){if(this.isEnabled){this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()}},r.prototype.handleEvent=s.handleEvent,r.prototype.onclick=function(){var t=document.activeElement;t&&t==this.element&&this.onTap()},r.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},r.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},r.prototype.update=function(){var t=this.parent.cells;if(this.parent.options.wrapAround&&t.length>1)return void this.enable();var e=t.length?t.length-1:0,i=this.isPrevious?0:e,n=this.parent.selectedIndex==i?"disable":"enable";this[n]()},r.prototype.destroy=function(){this.deactivate()},s.extend(i.defaults,{prevNextButtons:!0,leftArrowText:"‹",rightArrowText:"›",arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),i.createMethods.push("_createPrevNextButtons"),i.prototype._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new r(-1,this),this.nextButton=new r(1,this),this.on("activate",this.activatePrevNextButtons))},i.prototype.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},i.prototype.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},i.PrevNextButton=r,i}); 35 | },{"./flickity":11,"eventie":5,"fizzy-ui-utils":6,"tap-listener":18}],17:[function(require,module,exports){ 36 | !function(t,e){"use strict";function r(t){var e=parseFloat(t),r=-1===t.indexOf("%")&&!isNaN(e);return r&&e}function i(){}function n(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,r=f.length;r>e;e++){var i=f[e];t[i]=0}return t}function o(e){function i(){if(!p){p=!0;var i=t.getComputedStyle;if(a=function(){var t=i?function(t){return i(t,null)}:function(t){return t.currentStyle};return function(e){var r=t(e);return r||d("Style returned "+r+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),r}}(),u=e("boxSizing")){var n=document.createElement("div");n.style.width="200px",n.style.padding="1px 2px 3px 4px",n.style.borderStyle="solid",n.style.borderWidth="1px 2px 3px 4px",n.style[u]="border-box";var o=document.body||document.documentElement;o.appendChild(n);var f=a(n);g=200===r(f.width),o.removeChild(n)}}}function o(t){if(i(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var e=a(t);if("none"===e.display)return n();var o={};o.width=t.offsetWidth,o.height=t.offsetHeight;for(var d=o.isBorderBox=!(!u||!e[u]||"border-box"!==e[u]),p=0,l=f.length;l>p;p++){var y=f[p],c=e[y];c=h(t,c);var m=parseFloat(c);o[y]=isNaN(m)?0:m}var s=o.paddingLeft+o.paddingRight,v=o.paddingTop+o.paddingBottom,b=o.marginLeft+o.marginRight,x=o.marginTop+o.marginBottom,W=o.borderLeftWidth+o.borderRightWidth,S=o.borderTopWidth+o.borderBottomWidth,w=d&&g,B=r(e.width);B!==!1&&(o.width=B+(w?0:s+W));var L=r(e.height);return L!==!1&&(o.height=L+(w?0:v+S)),o.innerWidth=o.width-(s+W),o.innerHeight=o.height-(v+S),o.outerWidth=o.width+b,o.outerHeight=o.height+x,o}}function h(e,r){if(t.getComputedStyle||-1===r.indexOf("%"))return r;var i=e.style,n=i.left,o=e.runtimeStyle,d=o&&o.left;return d&&(o.left=e.currentStyle.left),i.left=r,r=i.pixelLeft,i.left=n,d&&(o.left=d),r}var a,u,g,p=!1;return o}var d="undefined"==typeof console?i:function(t){console.error(t)},f=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define(["get-style-property/get-style-property"],o):"object"==typeof exports?module.exports=o(require("desandro-get-style-property")):t.getSize=o(t.getStyleProperty)}(window); 37 | },{"desandro-get-style-property":2}],18:[function(require,module,exports){ 38 | !function(t,e){"use strict";"function"==typeof define&&define.amd?define(["unipointer/unipointer"],function(n){return e(t,n)}):"object"==typeof exports?module.exports=e(t,require("unipointer")):t.TapListener=e(t,t.Unipointer)}(window,function(t,e){"use strict";function n(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function o(t){this.bindTap(t)}o.prototype=new e,o.prototype.bindTap=function(t){t&&(this.unbindTap(),this.tapElement=t,this._bindStartEvent(t,!0))},o.prototype.unbindTap=function(){this.tapElement&&(this._bindStartEvent(this.tapElement,!0),delete this.tapElement)};var i=o.prototype.pointerDown;o.prototype.pointerDown=function(t){"touchstart"==t.type&&n(t),i.apply(this,arguments)};var p=void 0!==t.pageYOffset;return o.prototype.pointerUp=function(n,o){var i=e.getPointerPoint(o),r=this.tapElement.getBoundingClientRect(),u=p?t.pageXOffset:document.body.scrollLeft,s=p?t.pageYOffset:document.body.scrollTop,a=i.x>=r.left+u&&i.x<=r.right+u&&i.y>=r.top+s&&i.y<=r.bottom+s;a&&this.emitEvent("tap",[n,o])},o.prototype.destroy=function(){this.pointerDone(),this.unbindTap()},o}); 39 | },{"unipointer":20}],19:[function(require,module,exports){ 40 | !function(t,n){"use strict";"function"==typeof define&&define.amd?define(["eventie/eventie","unipointer/unipointer"],function(e,i){return n(t,e,i)}):"object"==typeof exports?module.exports=n(t,require("eventie"),require("unipointer")):t.Unidragger=n(t,t.eventie,t.Unipointer)}(window,function(t,n,e){"use strict";function i(){}function o(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function r(){}function s(){return!1}r.prototype=new e,r.prototype.bindHandles=function(){this._bindHandles(!0)},r.prototype.unbindHandles=function(){this._bindHandles(!1)};var a=t.navigator;r.prototype._bindHandles=function(t){t=void 0===t?!0:!!t;var e;e=a.pointerEnabled?function(n){n.style.touchAction=t?"none":""}:a.msPointerEnabled?function(n){n.style.msTouchAction=t?"none":""}:function(){t&&c(s)};for(var i=t?"bind":"unbind",o=0,r=this.handles.length;r>o;o++){var s=this.handles[o];this._bindStartEvent(s,t),e(s),n[i](s,"click",this)}};var p="attachEvent"in document.documentElement,c=p?function(t){"IMG"==t.nodeName&&(t.ondragstart=s);for(var n=t.querySelectorAll("img"),e=0,i=n.length;i>e;e++){var o=n[e];o.ondragstart=s}}:i;r.prototype.pointerDown=function(e,i){if("INPUT"==e.target.nodeName&&"range"==e.target.type)return this.isPointerDown=!1,void delete this.pointerIdentifier;this._dragPointerDown(e,i);var o=document.activeElement;o&&o.blur&&o.blur(),this._bindPostStartEvents(e),this.pointerDownScroll=r.getScrollPosition(),n.bind(t,"scroll",this),this.emitEvent("pointerDown",[e,i])},r.prototype._dragPointerDown=function(t,n){this.pointerDownPoint=e.getPointerPoint(n);var i="touchstart"==t.type,r=t.target.nodeName;i||"SELECT"==r||o(t)},r.prototype.pointerMove=function(t,n){var e=this._dragPointerMove(t,n);this.emitEvent("pointerMove",[t,n,e]),this._dragMove(t,n,e)},r.prototype._dragPointerMove=function(t,n){var i=e.getPointerPoint(n),o={x:i.x-this.pointerDownPoint.x,y:i.y-this.pointerDownPoint.y};return!this.isDragging&&this.hasDragStarted(o)&&this._dragStart(t,n),o},r.prototype.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3},r.prototype.pointerUp=function(t,n){this.emitEvent("pointerUp",[t,n]),this._dragPointerUp(t,n)},r.prototype._dragPointerUp=function(t,n){this.isDragging?this._dragEnd(t,n):this._staticClick(t,n)},e.prototype.pointerDone=function(){n.unbind(t,"scroll",this)},r.prototype._dragStart=function(t,n){this.isDragging=!0,this.dragStartPoint=r.getPointerPoint(n),this.isPreventingClicks=!0,this.dragStart(t,n)},r.prototype.dragStart=function(t,n){this.emitEvent("dragStart",[t,n])},r.prototype._dragMove=function(t,n,e){this.isDragging&&this.dragMove(t,n,e)},r.prototype.dragMove=function(t,n,e){o(t),this.emitEvent("dragMove",[t,n,e])},r.prototype._dragEnd=function(t,n){this.isDragging=!1;var e=this;setTimeout(function(){delete e.isPreventingClicks}),this.dragEnd(t,n)},r.prototype.dragEnd=function(t,n){this.emitEvent("dragEnd",[t,n])},r.prototype.pointerDone=function(){n.unbind(t,"scroll",this),delete this.pointerDownScroll},r.prototype.onclick=function(t){this.isPreventingClicks&&o(t)},r.prototype._staticClick=function(t,n){if(!this.isIgnoringMouseUp||"mouseup"!=t.type){var e=t.target.nodeName;if(("INPUT"==e||"TEXTAREA"==e)&&t.target.focus(),this.staticClick(t,n),"mouseup"!=t.type){this.isIgnoringMouseUp=!0;var i=this;setTimeout(function(){delete i.isIgnoringMouseUp},400)}}},r.prototype.staticClick=function(t,n){this.emitEvent("staticClick",[t,n])},r.prototype.onscroll=function(){var t=r.getScrollPosition(),n=this.pointerDownScroll.x-t.x,e=this.pointerDownScroll.y-t.y;(Math.abs(n)>3||Math.abs(e)>3)&&this._pointerDone()},r.getPointerPoint=function(t){return{x:void 0!==t.pageX?t.pageX:t.clientX,y:void 0!==t.pageY?t.pageY:t.clientY}};var u=void 0!==t.pageYOffset;return r.getScrollPosition=function(){return{x:u?t.pageXOffset:document.body.scrollLeft,y:u?t.pageYOffset:document.body.scrollTop}},r.getPointerPoint=e.getPointerPoint,r}); 41 | },{"eventie":5,"unipointer":20}],20:[function(require,module,exports){ 42 | !function(t,n){"use strict";"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(o,e){return n(t,o,e)}):"object"==typeof exports?module.exports=n(t,require("wolfy87-eventemitter"),require("eventie")):t.Unipointer=n(t,t.EventEmitter,t.eventie)}(window,function(t,n,o){"use strict";function e(){}function i(){}i.prototype=new n,i.prototype.bindStartEvent=function(t){this._bindStartEvent(t,!0)},i.prototype.unbindStartEvent=function(t){this._bindStartEvent(t,!1)},i.prototype._bindStartEvent=function(n,e){e=void 0===e?!0:!!e;var i=e?"bind":"unbind";t.navigator.pointerEnabled?o[i](n,"pointerdown",this):t.navigator.msPointerEnabled?o[i](n,"MSPointerDown",this):(o[i](n,"mousedown",this),o[i](n,"touchstart",this))},i.prototype.handleEvent=function(t){var n="on"+t.type;this[n]&&this[n](t)},i.prototype.getTouch=function(t){for(var n=0,o=t.length;o>n;n++){var e=t[n];if(e.identifier==this.pointerIdentifier)return e}},i.prototype.onmousedown=function(t){var n=t.button;n&&0!==n&&1!==n||this._pointerDown(t,t)},i.prototype.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])},i.prototype.onMSPointerDown=i.prototype.onpointerdown=function(t){this._pointerDown(t,t)},i.prototype._pointerDown=function(t,n){this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==n.pointerId?n.pointerId:n.identifier,this.pointerDown(t,n))},i.prototype.pointerDown=function(t,n){this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,n])};var r={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"],MSPointerDown:["MSPointerMove","MSPointerUp","MSPointerCancel"]};return i.prototype._bindPostStartEvents=function(n){if(n){for(var e=r[n.type],i=n.preventDefault?t:document,p=0,s=e.length;s>p;p++){var u=e[p];o.bind(i,u,this)}this._boundPointerEvents={events:e,node:i}}},i.prototype._unbindPostStartEvents=function(){var t=this._boundPointerEvents;if(t&&t.events){for(var n=0,e=t.events.length;e>n;n++){var i=t.events[n];o.unbind(t.node,i,this)}delete this._boundPointerEvents}},i.prototype.onmousemove=function(t){this._pointerMove(t,t)},i.prototype.onMSPointerMove=i.prototype.onpointermove=function(t){t.pointerId==this.pointerIdentifier&&this._pointerMove(t,t)},i.prototype.ontouchmove=function(t){var n=this.getTouch(t.changedTouches);n&&this._pointerMove(t,n)},i.prototype._pointerMove=function(t,n){this.pointerMove(t,n)},i.prototype.pointerMove=function(t,n){this.emitEvent("pointerMove",[t,n])},i.prototype.onmouseup=function(t){this._pointerUp(t,t)},i.prototype.onMSPointerUp=i.prototype.onpointerup=function(t){t.pointerId==this.pointerIdentifier&&this._pointerUp(t,t)},i.prototype.ontouchend=function(t){var n=this.getTouch(t.changedTouches);n&&this._pointerUp(t,n)},i.prototype._pointerUp=function(t,n){this._pointerDone(),this.pointerUp(t,n)},i.prototype.pointerUp=function(t,n){this.emitEvent("pointerUp",[t,n])},i.prototype._pointerDone=function(){this.isPointerDown=!1,delete this.pointerIdentifier,this._unbindPostStartEvents(),this.pointerDone()},i.prototype.pointerDone=e,i.prototype.onMSPointerCancel=i.prototype.onpointercancel=function(t){t.pointerId==this.pointerIdentifier&&this._pointerCancel(t,t)},i.prototype.ontouchcancel=function(t){var n=this.getTouch(t.changedTouches);n&&this._pointerCancel(t,n)},i.prototype._pointerCancel=function(t,n){this._pointerDone(),this.pointerCancel(t,n)},i.prototype.pointerCancel=function(t,n){this.emitEvent("pointerCancel",[t,n])},i.getPointerPoint=function(t){return{x:void 0!==t.pageX?t.pageX:t.clientX,y:void 0!==t.pageY?t.pageY:t.clientY}},i}); 43 | },{"eventie":5,"wolfy87-eventemitter":21}],21:[function(require,module,exports){ 44 | (function(){"use strict";function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var r=e.prototype,i=this,s=i.EventEmitter;r.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp){t={};for(n in r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n])}else t=r[e]||(r[e]=[]);return t},r.flattenListeners=function(e){var t,n=[];for(t=0;t.column{display:table-cell;vertical-align:top}} 4 | 5 | /*# sourceMappingURL=main.min.css.map */ 6 | -------------------------------------------------------------------------------- /styles/main.min.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["../../modules/carousel/_flickity.scss","../../modules/text-columns/text-columns.scss"],"names":[],"mappings":"AAAA;;iDAEiD,kBAG/C,iBAAmB,CACpB,wBAEyB,YAAc,CAAI,mBAG1C,gBACA,kBACA,WAAa,CACd,iBAGC,kBACA,WACA,WAAa,CACd,+BAKC,wCACQ,gCACR,yBACG,sBACC,qBACI,gBAAkB,CAC3B,kDAGC,YACA,oBACA,WAAa,CACd,kEAGC,wBACA,eAAiB,CAClB,2BAKC,kBACA,QACA,WACA,YACA,YACA,kBACA,iBACA,kCACA,eAEA,mCACI,+BACI,0BAAqB,CAC9B,iCAEkC,gBAAkB,CAAI,iCAGvD,aACA,yBAA2B,CAC5B,kCAGC,yBACA,WAAa,CACd,oCAEqC,SAAW,CAAI,gCACnB,UAAY,CAAI,kDAGhD,UACA,UAAY,CACb,8CAEC,WACA,SAAW,CACZ,oCAGC,yBACA,YACA,WAAa,CACd,+BAGC,kBACA,SACA,QACA,UACA,UAAY,CACb,kCAGC,SAAW,CACZ,kCAIC,WACA,cAAgB,CACjB,oBAKC,kBACA,WACA,aACA,UACA,SACA,gBACA,kBACA,aAAe,CAChB,kCAEmC,aAAe,CAAI,yBAGrD,qBACA,WACA,YACA,aACA,gBACA,kBACA,yBACA,aACA,cAAgB,CACjB,qCAGC,0BACA,SAAW,CACZ,0BC5ID,qBAEI,cACA,WACA,kBAAoB,CAJxB,6BAOM,mBACA,kBAAoB,CACrB,CAAA","file":"main.min.css","sourceRoot":"./src/"} -------------------------------------------------------------------------------- /styles/src/_typography.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ScottPolhemus/modular/987e8afb1f41460d8edd87cab9c0b97351c34187/styles/src/_typography.scss -------------------------------------------------------------------------------- /styles/src/_variables.scss: -------------------------------------------------------------------------------- 1 | $break-mobile-min: 600px; 2 | $break-mobile-max: ($break-mobile-min - 1); -------------------------------------------------------------------------------- /styles/src/main.scss: -------------------------------------------------------------------------------- 1 | // Imports from src directory 2 | @import "variables"; 3 | @import "typography"; 4 | 5 | // Imports from module folders (Paths are expanded within Gulp task) 6 | @import "modules/hero"; 7 | @import "modules/carousel"; 8 | @import "modules/text-columns"; -------------------------------------------------------------------------------- /tasks/browserify.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var browserify = require('browserify'); 3 | var watchify = require('watchify'); 4 | var shim = require('browserify-shim'); 5 | var fs = require('fs'); 6 | var path = require('path'); 7 | var glob = require('glob'); 8 | 9 | /** Defines the "browserify" task for Gulp. */ 10 | gulp.task('browserify', function(callback) { 11 | return browserifyTask(false, callback); 12 | }); 13 | 14 | /** Defines the "watchify" task for Gulp. */ 15 | gulp.task('watchify', function(callback) { 16 | return browserifyTask(true, callback); 17 | }); 18 | 19 | /** 20 | * Runs the Browserify or Watchify bundler. 21 | * @param {boolean} dev - "True" to configure the task for development. 22 | * @param {function} cb - Async callback function. 23 | */ 24 | function browserifyTask(dev, cb) { 25 | var bundleOpts = { 26 | entries: ['./scripts/src/main.js'], 27 | output: './scripts/main.min.js', 28 | require: getModuleScripts(), 29 | transform: [shim], 30 | debug: true 31 | }; 32 | 33 | var b = browserify(bundleOpts); 34 | 35 | var outputFile = path.basename(bundleOpts.output); 36 | 37 | if(bundleOpts.require) { 38 | b.require(bundleOpts.require); 39 | } 40 | 41 | // Minify plugin w/ source map options 42 | b.plugin('minifyify', { 43 | map: outputFile+'.map', 44 | output: bundleOpts.output+'.map', 45 | compressPath: function(p) { 46 | // Add relative path to project root 47 | return path.join('../', p); 48 | } 49 | }); 50 | 51 | // Re-usable function to start the bundle as configured 52 | function bundle() { 53 | bundleLogger.start('main.min.js'); 54 | 55 | var bundle = b.bundle() 56 | .on('error', function (err) { console.error(err.message); }) 57 | .on('end', function() { 58 | bundleLogger.end('main.min.js'); 59 | 60 | if(cb) { 61 | cb(); 62 | cb = false; // Only trigger callback once 63 | } 64 | }) 65 | .pipe(fs.createWriteStream(bundleOpts.output)); 66 | } 67 | 68 | // Use watchify for development mode 69 | if(dev) { 70 | b = watchify(b); 71 | b.on('update', bundle); 72 | } 73 | 74 | return bundle(); 75 | } 76 | 77 | /** 78 | * Provides an array of module scripts for browserify to include. 79 | * Makes module scripts available to require as "modules/[name]". 80 | */ 81 | function getModuleScripts() { 82 | var moduleFiles = glob.sync('./modules/**/*.js'); 83 | var modules = []; 84 | 85 | for(var i = 0; i < moduleFiles.length; i++) { 86 | var name = path.basename(moduleFiles[i], '.js'); 87 | var dirname = path.basename(path.dirname(moduleFiles[i])); 88 | 89 | if(name === dirname) { 90 | modules.push({ 91 | file: './'+moduleFiles[i], 92 | expose: 'modules/'+name 93 | }); 94 | } 95 | } 96 | 97 | return modules; 98 | } 99 | 100 | // bundleLogger 101 | 102 | var gutil = require('gulp-util'); 103 | var prettyHrtime = require('pretty-hrtime'); 104 | var startTime; 105 | 106 | /** Some logging functions for Browserify, originally from gulp-starter. */ 107 | var bundleLogger = { 108 | start: function(filepath) { 109 | startTime = process.hrtime(); 110 | gutil.log('Bundling', gutil.colors.green(filepath), '...'); 111 | }, 112 | 113 | end: function(filepath) { 114 | var taskTime = process.hrtime(startTime); 115 | var prettyTime = prettyHrtime(taskTime); 116 | gutil.log('Bundled', gutil.colors.green(filepath), 'in', gutil.colors.magenta(prettyTime)); 117 | } 118 | }; -------------------------------------------------------------------------------- /tasks/sass.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var sass = require('gulp-sass'); 3 | var rename = require('gulp-rename'); 4 | var sourcemaps = require('gulp-sourcemaps'); 5 | var postcss = require('gulp-postcss'); 6 | var autoprefixer = require('autoprefixer'); 7 | var glob = require('glob'); 8 | 9 | /** Defines the "sass" task for Gulp. */ 10 | gulp.task('sass', function() { 11 | var sassOpts = { 12 | outputStyle: 'compressed', 13 | importer: moduleStylesImporter 14 | }; 15 | 16 | return gulp.src('./styles/src/*.scss') 17 | .pipe(sourcemaps.init()) 18 | .pipe(sass(sassOpts).on('error', sass.logError)) 19 | .pipe(postcss([autoprefixer()])) 20 | .pipe(rename({ 21 | suffix: '.min' 22 | })) 23 | .pipe(sourcemaps.write('./', { 24 | sourceRoot: './src/', 25 | includeContent: false 26 | })) 27 | .pipe(gulp.dest('./styles')); 28 | }); 29 | 30 | /** 31 | * Custom importer for node-sass. 32 | * Makes module partials available to import as "modules/[name]". 33 | */ 34 | function moduleStylesImporter(url, prev) { 35 | if(url.indexOf('modules/') === 0) { 36 | var files = glob.sync('./'+url+'/*.scss'); 37 | 38 | if(files.length > 0) { 39 | return { 40 | file: files[0] 41 | }; 42 | } 43 | } 44 | 45 | return prev; 46 | } --------------------------------------------------------------------------------