vendor: 13,118 bytes, lines 1-512
1/******/ (() => { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3 4/***/ 9741: 5/***/ ((module, exports, __webpack_require__) => { 6 7var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 8 * matchesSelector v2.0.2 9 * matchesSelector( element, '.selector' ) 10 * MIT license 11 */ 12 13/*jshint browser: true, strict: true, undef: true, unused: true */ 14 15( function( window, factory ) { 16 /*global define: false, module: false */ 17 'use strict'; 18 // universal module definition 19 if ( true ) { 20 // AMD 21 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 22 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 23 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : 24 __WEBPACK_AMD_DEFINE_FACTORY__), 25 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 26 } else {} 27 28}( window, function factory() { 29 'use strict'; 30 31 var matchesMethod = ( function() { 32 var ElemProto = window.Element.prototype; 33 // check for the standard method name first 34 if ( ElemProto.matches ) { 35 return 'matches'; 36 } 37 // check un-prefixed 38 if ( ElemProto.matchesSelector ) { 39 return 'matchesSelector'; 40 } 41 // check vendor prefixes 42 var prefixes = [ 'webkit', 'moz', 'ms', 'o' ]; 43 44 for ( var i=0; i < prefixes.length; i++ ) { 45 var prefix = prefixes[i]; 46 var method = prefix + 'MatchesSelector'; 47 if ( ElemProto[ method ] ) { 48 return method; 49 } 50 } 51 })(); 52 53 return function matchesSelector( elem, selector ) { 54 return elem[ matchesMethod ]( selector ); 55 }; 56 57})); 58 59 60/***/ }), 61 62/***/ 7158: 63/***/ (function(module, exports, __webpack_require__) { 64 65var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 66 * EvEmitter v1.1.0 67 * Lil' event emitter 68 * MIT License 69 */ 70 71/* jshint unused: true, undef: true, strict: true */ 72 73( function( global, factory ) { 74 // universal module definition 75 /* jshint strict: false */ /* globals define, module, window */ 76 if ( true ) { 77 // AMD - RequireJS 78 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 79 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 80 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : 81 __WEBPACK_AMD_DEFINE_FACTORY__), 82 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 83 } else {} 84 85}( typeof window != 'undefined' ? window : this, function() { 86 87"use strict"; 88 89function EvEmitter() {} 90 91var proto = EvEmitter.prototype; 92 93proto.on = function( eventName, listener ) { 94 if ( !eventName || !listener ) { 95 return; 96 } 97 // set events hash 98 var events = this._events = this._events || {}; 99 // set listeners array 100 var listeners = events[ eventName ] = events[ eventName ] || []; 101 // only add once 102 if ( listeners.indexOf( listener ) == -1 ) { 103 listeners.push( listener ); 104 } 105 106 return this; 107}; 108 109proto.once = function( eventName, listener ) { 110 if ( !eventName || !listener ) { 111 return; 112 } 113 // add event 114 this.on( eventName, listener ); 115 // set once flag 116 // set onceEvents hash 117 var onceEvents = this._onceEvents = this._onceEvents || {}; 118 // set onceListeners object 119 var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; 120 // set flag 121 onceListeners[ listener ] = true; 122 123 return this; 124}; 125 126proto.off = function( eventName, listener ) { 127 var listeners = this._events && this._events[ eventName ]; 128 if ( !listeners || !listeners.length ) { 129 return; 130 } 131 var index = listeners.indexOf( listener ); 132 if ( index != -1 ) { 133 listeners.splice( index, 1 ); 134 } 135 136 return this; 137}; 138 139proto.emitEvent = function( eventName, args ) { 140 var listeners = this._events && this._events[ eventName ]; 141 if ( !listeners || !listeners.length ) { 142 return; 143 } 144 // copy over to avoid interference if .off() in listener 145 listeners = listeners.slice(0); 146 args = args || []; 147 // once stuff 148 var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; 149 150 for ( var i=0; i < listeners.length; i++ ) { 151 var listener = listeners[i] 152 var isOnce = onceListeners && onceListeners[ listener ]; 153 if ( isOnce ) { 154 // remove listener 155 // remove before trigger to prevent recursion 156 this.off( eventName, listener ); 157 // unset once flag 158 delete onceListeners[ listener ]; 159 } 160 // trigger listener 161 listener.apply( this, args ); 162 } 163 164 return this; 165}; 166 167proto.allOff = function() { 168 delete this._events; 169 delete this._onceEvents; 170}; 171 172return EvEmitter; 173 174})); 175 176 177/***/ }), 178 179/***/ 9047: 180/***/ ((module, exports, __webpack_require__) => { 181 182var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 183 * Fizzy UI utils v2.0.7 184 * MIT license 185 */ 186 187/*jshint browser: true, undef: true, unused: true, strict: true */ 188 189( function( window, factory ) { 190 // universal module definition 191 /*jshint strict: false */ /*globals define, module, require */ 192 193 if ( true ) { 194 // AMD 195 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 196 __webpack_require__(9741) 197 ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( matchesSelector ) { 198 return factory( window, matchesSelector ); 199 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 200 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 201 } else {} 202 203}( window, function factory( window, matchesSelector ) { 204 205'use strict'; 206 207var utils = {}; 208 209// ----- extend ----- // 210 211// extends objects 212utils.extend = function( a, b ) { 213 for ( var prop in b ) { 214 a[ prop ] = b[ prop ]; 215 } 216 return a; 217}; 218 219// ----- modulo ----- // 220 221utils.modulo = function( num, div ) { 222 return ( ( num % div ) + div ) % div; 223}; 224 225// ----- makeArray ----- // 226 227var arraySlice = Array.prototype.slice; 228 229// turn element or nodeList into an array 230utils.makeArray = function( obj ) { 231 if ( Array.isArray( obj ) ) { 232 // use object if already an array 233 return obj; 234 } 235 // return empty array if undefined or null. #6 236 if ( obj === null || obj === undefined ) { 237 return []; 238 } 239 240 var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; 241 if ( isArrayLike ) { 242 // convert nodeList to array 243 return arraySlice.call( obj ); 244 } 245 246 // array of single index 247 return [ obj ]; 248}; 249 250// ----- removeFrom ----- // 251 252utils.removeFrom = function( ary, obj ) { 253 var index = ary.indexOf( obj ); 254 if ( index != -1 ) { 255 ary.splice( index, 1 ); 256 } 257}; 258 259// ----- getParent ----- // 260 261utils.getParent = function( elem, selector ) { 262 while ( elem.parentNode && elem != document.body ) { 263 elem = elem.parentNode; 264 if ( matchesSelector( elem, selector ) ) { 265 return elem; 266 } 267 } 268}; 269 270// ----- getQueryElement ----- // 271 272// use element as selector string 273utils.getQueryElement = function( elem ) { 274 if ( typeof elem == 'string' ) { 275 return document.querySelector( elem ); 276 } 277 return elem; 278}; 279 280// ----- handleEvent ----- // 281 282// enable .ontype to trigger from .addEventListener( elem, 'type' ) 283utils.handleEvent = function( event ) { 284 var method = 'on' + event.type; 285 if ( this[ method ] ) { 286 this[ method ]( event ); 287 } 288}; 289 290// ----- filterFindElements ----- // 291 292utils.filterFindElements = function( elems, selector ) { 293 // make array of elems 294 elems = utils.makeArray( elems ); 295 var ffElems = []; 296 297 elems.forEach( function( elem ) { 298 // check that elem is an actual element 299 if ( !( elem instanceof HTMLElement ) ) { 300 return; 301 } 302 // add elem if no selector 303 if ( !selector ) { 304 ffElems.push( elem ); 305 return; 306 } 307 // filter & find items if we have a selector 308 // filter 309 if ( matchesSelector( elem, selector ) ) { 310 ffElems.push( elem ); 311 } 312 // find children 313 var childElems = elem.querySelectorAll( selector ); 314 // concat childElems to filterFound array 315 for ( var i=0; i < childElems.length; i++ ) { 316 ffElems.push( childElems[i] ); 317 } 318 }); 319 320 return ffElems; 321}; 322 323// ----- debounceMethod ----- // 324 325utils.debounceMethod = function( _class, methodName, threshold ) { 326 threshold = threshold || 100; 327 // original method 328 var method = _class.prototype[ methodName ]; 329 var timeoutName = methodName + 'Timeout'; 330 331 _class.prototype[ methodName ] = function() { 332 var timeout = this[ timeoutName ]; 333 clearTimeout( timeout ); 334 335 var args = arguments; 336 var _this = this; 337 this[ timeoutName ] = setTimeout( function() { 338 method.apply( _this, args ); 339 delete _this[ timeoutName ]; 340 }, threshold ); 341 }; 342}; 343 344// ----- docReady ----- // 345 346utils.docReady = function( callback ) { 347 var readyState = document.readyState; 348 if ( readyState == 'complete' || readyState == 'interactive' ) { 349 // do async to allow for other scripts to run. metafizzy/flickity#441 350 setTimeout( callback ); 351 } else { 352 document.addEventListener( 'DOMContentLoaded', callback ); 353 } 354}; 355 356// ----- htmlInit ----- // 357 358// http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/ 359utils.toDashed = function( str ) { 360 return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) { 361 return $1 + '-' + $2; 362 }).toLowerCase(); 363}; 364 365var console = window.console; 366/** 367 * allow user to initialize classes via [data-namespace] or .js-namespace class 368 * htmlInit( Widget, 'widgetName' ) 369 * options are parsed from data-namespace-options 370 */ 371utils.htmlInit = function( WidgetClass, namespace ) { 372 utils.docReady( function() { 373 var dashedNamespace = utils.toDashed( namespace ); 374 var dataAttr = 'data-' + dashedNamespace; 375 var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' ); 376 var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace ); 377 var elems = utils.makeArray( dataAttrElems ) 378 .concat( utils.makeArray( jsDashElems ) ); 379 var dataOptionsAttr = dataAttr + '-options'; 380 var jQuery = window.jQuery; 381 382 elems.forEach( function( elem ) { 383 var attr = elem.getAttribute( dataAttr ) || 384 elem.getAttribute( dataOptionsAttr ); 385 var options; 386 try { 387 options = attr && JSON.parse( attr ); 388 } catch ( error ) { 389 // log error, do not initialize 390 if ( console ) { 391 console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className + 392 ': ' + error ); 393 } 394 return; 395 } 396 // initialize 397 var instance = new WidgetClass( elem, options ); 398 // make available via $().data('namespace') 399 if ( jQuery ) { 400 jQuery.data( elem, namespace, instance ); 401 } 402 }); 403 404 }); 405}; 406 407// ----- ----- // 408 409return utils; 410 411})); 412 413 414/***/ }), 415 416/***/ 6131: 417/***/ ((module, exports, __webpack_require__) => { 418 419var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 420 * getSize v2.0.3 421 * measure size of elements 422 * MIT license 423 */ 424 425/* jshint browser: true, strict: true, undef: true, unused: true */ 426/* globals console: false */ 427 428( function( window, factory ) { 429 /* jshint strict: false */ /* globals define, module */ 430 if ( true ) { 431 // AMD 432 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 433 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 434 (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : 435 __WEBPACK_AMD_DEFINE_FACTORY__), 436 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 437 } else {} 438 439})( window, function factory() { 440'use strict'; 441 442// -------------------------- helpers -------------------------- // 443 444// get a number from a string, not a percentage 445function getStyleSize( value ) { 446 var num = parseFloat( value ); 447 // not a percent like '100%', and a number 448 var isValid = value.indexOf('%') == -1 && !isNaN( num ); 449 return isValid && num; 450} 451 452function noop() {} 453 454var logError = typeof console == 'undefined' ? noop : 455 function( message ) { 456 console.error( message ); 457 }; 458 459// -------------------------- measurements -------------------------- // 460 461var measurements = [ 462 'paddingLeft', 463 'paddingRight', 464 'paddingTop', 465 'paddingBottom', 466 'marginLeft', 467 'marginRight', 468 'marginTop', 469 'marginBottom', 470 'borderLeftWidth', 471 'borderRightWidth', 472 'borderTopWidth', 473 'borderBottomWidth' 474]; 475 476var measurementsLength = measurements.length; 477 478function getZeroSize() { 479 var size = { 480 width: 0, 481 height: 0, 482 innerWidth: 0, 483 innerHeight: 0, 484 outerWidth: 0, 485 outerHeight: 0 486 }; 487 for ( var i=0; i < measurementsLength; i++ ) { 488 var measurement = measurements[i]; 489 size[ measurement ] = 0; 490 } 491 return size; 492} 493 494// -------------------------- getStyle -------------------------- // 495 496/** 497 * getStyle, get style of element, check for Firefox bug 498 * https://bugzilla.mozilla.org/show_bug.cgi?id=548397 499 */ 500function getStyle( elem ) { 501 var style = getComputedStyle( elem ); 502 if ( !style ) { 503 logError( 'Style returned ' + style + 504 '. Are you running this code in a hidden iframe on Firefox? ' + 505 'See https://bit.ly/getsizebug1' ); 506 } 507 return style; 508} 509 510// -------------------------- setup -------------------------- // 511 512var isSetup = false;
vendor: 4,529 bytes, lines 513-666
513 514var isBoxSizeOuter; 515 516/** 517 * setup 518 * check isBoxSizerOuter 519 * do on first getSize() rather than on page load for Firefox bug 520 */ 521function setup() { 522 // setup once 523 if ( isSetup ) { 524 return; 525 } 526 isSetup = true; 527 528 // -------------------------- box sizing -------------------------- // 529 530 /** 531 * Chrome & Safari measure the outer-width on style.width on border-box elems 532 * IE11 & Firefox<29 measures the inner-width 533 */ 534 var div = document.createElement('div'); 535 div.style.width = '200px'; 536 div.style.padding = '1px 2px 3px 4px'; 537 div.style.borderStyle = 'solid'; 538 div.style.borderWidth = '1px 2px 3px 4px'; 539 div.style.boxSizing = 'border-box'; 540 541 var body = document.body || document.documentElement; 542 body.appendChild( div ); 543 var style = getStyle( div ); 544 // round value for browser zoom. desandro/masonry#928 545 isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200; 546 getSize.isBoxSizeOuter = isBoxSizeOuter; 547 548 body.removeChild( div ); 549} 550 551// -------------------------- getSize -------------------------- // 552 553function getSize( elem ) { 554 setup(); 555 556 // use querySeletor if elem is string 557 if ( typeof elem == 'string' ) { 558 elem = document.querySelector( elem ); 559 } 560 561 // do not proceed on non-objects 562 if ( !elem || typeof elem != 'object' || !elem.nodeType ) { 563 return; 564 } 565 566 var style = getStyle( elem ); 567 568 // if hidden, everything is 0 569 if ( style.display == 'none' ) { 570 return getZeroSize(); 571 } 572 573 var size = {}; 574 size.width = elem.offsetWidth; 575 size.height = elem.offsetHeight; 576 577 var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box'; 578 579 // get all measurements 580 for ( var i=0; i < measurementsLength; i++ ) { 581 var measurement = measurements[i]; 582 var value = style[ measurement ]; 583 var num = parseFloat( value ); 584 // any 'auto', 'medium' value will be 0 585 size[ measurement ] = !isNaN( num ) ? num : 0; 586 } 587 588 var paddingWidth = size.paddingLeft + size.paddingRight; 589 var paddingHeight = size.paddingTop + size.paddingBottom; 590 var marginWidth = size.marginLeft + size.marginRight; 591 var marginHeight = size.marginTop + size.marginBottom; 592 var borderWidth = size.borderLeftWidth + size.borderRightWidth; 593 var borderHeight = size.borderTopWidth + size.borderBottomWidth; 594 595 var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter; 596 597 // overwrite width and height if we can get it from style 598 var styleWidth = getStyleSize( style.width ); 599 if ( styleWidth !== false ) { 600 size.width = styleWidth + 601 // add padding and border unless it's already including it 602 ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth ); 603 } 604 605 var styleHeight = getStyleSize( style.height ); 606 if ( styleHeight !== false ) { 607 size.height = styleHeight + 608 // add padding and border unless it's already including it 609 ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight ); 610 } 611 612 size.innerWidth = size.width - ( paddingWidth + borderWidth ); 613 size.innerHeight = size.height - ( paddingHeight + borderHeight ); 614 615 size.outerWidth = size.width + marginWidth; 616 size.outerHeight = size.height + marginHeight; 617 618 return size; 619} 620 621return getSize; 622 623}); 624 625 626/***/ }), 627 628/***/ 3391: 629/***/ ((module, exports, __webpack_require__) => { 630 631var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 632 * Isotope v3.0.6 633 * 634 * Licensed GPLv3 for open source use 635 * or Isotope Commercial License for commercial use 636 * 637 * https://isotope.metafizzy.co 638 * Copyright 2010-2018 Metafizzy 639 */ 640 641( function( window, factory ) { 642 // universal module definition 643 /* jshint strict: false */ /*globals define, module, require */ 644 if ( true ) { 645 // AMD 646 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 647 __webpack_require__(1794), 648 __webpack_require__(6131), 649 __webpack_require__(9741), 650 __webpack_require__(9047), 651 __webpack_require__(5568), 652 __webpack_require__(1835), 653 // include default layout modes 654 __webpack_require__(666), 655 __webpack_require__(8947), 656 __webpack_require__(3157) 657 ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( Outlayer, getSize, matchesSelector, utils, Item, LayoutMode ) { 658 return factory( window, Outlayer, getSize, matchesSelector, utils, Item, LayoutMode ); 659 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 660 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 661 } else {} 662 663}( window, function factory( window, Outlayer, getSize, matchesSelector, utils, 664 Item, LayoutMode ) { 665 666'use strict';
vendor: 15,771 bytes, lines 666-1226
666 667 668// -------------------------- vars -------------------------- // 669 670var jQuery = window.jQuery; 671 672// -------------------------- helpers -------------------------- // 673 674var trim = String.prototype.trim ? 675 function( str ) { 676 return str.trim(); 677 } : 678 function( str ) { 679 return str.replace( /^\s+|\s+$/g, '' ); 680 }; 681 682// -------------------------- isotopeDefinition -------------------------- // 683 684 // create an Outlayer layout class 685 var Isotope = Outlayer.create( 'isotope', { 686 layoutMode: 'masonry', 687 isJQueryFiltering: true, 688 sortAscending: true 689 }); 690 691 Isotope.Item = Item; 692 Isotope.LayoutMode = LayoutMode; 693 694 var proto = Isotope.prototype; 695 696 proto._create = function() { 697 this.itemGUID = 0; 698 // functions that sort items 699 this._sorters = {}; 700 this._getSorters(); 701 // call super 702 Outlayer.prototype._create.call( this ); 703 704 // create layout modes 705 this.modes = {}; 706 // start filteredItems with all items 707 this.filteredItems = this.items; 708 // keep of track of sortBys 709 this.sortHistory = [ 'original-order' ]; 710 // create from registered layout modes 711 for ( var name in LayoutMode.modes ) { 712 this._initLayoutMode( name ); 713 } 714 }; 715 716 proto.reloadItems = function() { 717 // reset item ID counter 718 this.itemGUID = 0; 719 // call super 720 Outlayer.prototype.reloadItems.call( this ); 721 }; 722 723 proto._itemize = function() { 724 var items = Outlayer.prototype._itemize.apply( this, arguments ); 725 // assign ID for original-order 726 for ( var i=0; i < items.length; i++ ) { 727 var item = items[i]; 728 item.id = this.itemGUID++; 729 } 730 this._updateItemsSortData( items ); 731 return items; 732 }; 733 734 735 // -------------------------- layout -------------------------- // 736 737 proto._initLayoutMode = function( name ) { 738 var Mode = LayoutMode.modes[ name ]; 739 // set mode options 740 // HACK extend initial options, back-fill in default options 741 var initialOpts = this.options[ name ] || {}; 742 this.options[ name ] = Mode.options ? 743 utils.extend( Mode.options, initialOpts ) : initialOpts; 744 // init layout mode instance 745 this.modes[ name ] = new Mode( this ); 746 }; 747 748 749 proto.layout = function() { 750 // if first time doing layout, do all magic 751 if ( !this._isLayoutInited && this._getOption('initLayout') ) { 752 this.arrange(); 753 return; 754 } 755 this._layout(); 756 }; 757 758 // private method to be used in layout() & magic() 759 proto._layout = function() { 760 // don't animate first layout 761 var isInstant = this._getIsInstant(); 762 // layout flow 763 this._resetLayout(); 764 this._manageStamps(); 765 this.layoutItems( this.filteredItems, isInstant ); 766 767 // flag for initalized 768 this._isLayoutInited = true; 769 }; 770 771 // filter + sort + layout 772 proto.arrange = function( opts ) { 773 // set any options pass 774 this.option( opts ); 775 this._getIsInstant(); 776 // filter, sort, and layout 777 778 // filter 779 var filtered = this._filter( this.items ); 780 this.filteredItems = filtered.matches; 781 782 this._bindArrangeComplete(); 783 784 if ( this._isInstant ) { 785 this._noTransition( this._hideReveal, [ filtered ] ); 786 } else { 787 this._hideReveal( filtered ); 788 } 789 790 this._sort(); 791 this._layout(); 792 }; 793 // alias to _init for main plugin method 794 proto._init = proto.arrange; 795 796 proto._hideReveal = function( filtered ) { 797 this.reveal( filtered.needReveal ); 798 this.hide( filtered.needHide ); 799 }; 800 801 // HACK 802 // Don't animate/transition first layout 803 // Or don't animate/transition other layouts 804 proto._getIsInstant = function() { 805 var isLayoutInstant = this._getOption('layoutInstant'); 806 var isInstant = isLayoutInstant !== undefined ? isLayoutInstant : 807 !this._isLayoutInited; 808 this._isInstant = isInstant; 809 return isInstant; 810 }; 811 812 // listen for layoutComplete, hideComplete and revealComplete 813 // to trigger arrangeComplete 814 proto._bindArrangeComplete = function() { 815 // listen for 3 events to trigger arrangeComplete 816 var isLayoutComplete, isHideComplete, isRevealComplete; 817 var _this = this; 818 function arrangeParallelCallback() { 819 if ( isLayoutComplete && isHideComplete && isRevealComplete ) { 820 _this.dispatchEvent( 'arrangeComplete', null, [ _this.filteredItems ] ); 821 } 822 } 823 this.once( 'layoutComplete', function() { 824 isLayoutComplete = true; 825 arrangeParallelCallback(); 826 }); 827 this.once( 'hideComplete', function() { 828 isHideComplete = true; 829 arrangeParallelCallback(); 830 }); 831 this.once( 'revealComplete', function() { 832 isRevealComplete = true; 833 arrangeParallelCallback(); 834 }); 835 }; 836 837 // -------------------------- filter -------------------------- // 838 839 proto._filter = function( items ) { 840 var filter = this.options.filter; 841 filter = filter || '*'; 842 var matches = []; 843 var hiddenMatched = []; 844 var visibleUnmatched = []; 845 846 var test = this._getFilterTest( filter ); 847 848 // test each item 849 for ( var i=0; i < items.length; i++ ) { 850 var item = items[i]; 851 if ( item.isIgnored ) { 852 continue; 853 } 854 // add item to either matched or unmatched group 855 var isMatched = test( item ); 856 // item.isFilterMatched = isMatched; 857 // add to matches if its a match 858 if ( isMatched ) { 859 matches.push( item ); 860 } 861 // add to additional group if item needs to be hidden or revealed 862 if ( isMatched && item.isHidden ) { 863 hiddenMatched.push( item ); 864 } else if ( !isMatched && !item.isHidden ) { 865 visibleUnmatched.push( item ); 866 } 867 } 868 869 // return collections of items to be manipulated 870 return { 871 matches: matches, 872 needReveal: hiddenMatched, 873 needHide: visibleUnmatched 874 }; 875 }; 876 877 // get a jQuery, function, or a matchesSelector test given the filter 878 proto._getFilterTest = function( filter ) { 879 if ( jQuery && this.options.isJQueryFiltering ) { 880 // use jQuery 881 return function( item ) { 882 return jQuery( item.element ).is( filter ); 883 }; 884 } 885 if ( typeof filter == 'function' ) { 886 // use filter as function 887 return function( item ) { 888 return filter( item.element ); 889 }; 890 } 891 // default, use filter as selector string 892 return function( item ) { 893 return matchesSelector( item.element, filter ); 894 }; 895 }; 896 897 // -------------------------- sorting -------------------------- // 898 899 /** 900 * @params {Array} elems 901 * @public 902 */ 903 proto.updateSortData = function( elems ) { 904 // get items 905 var items; 906 if ( elems ) { 907 elems = utils.makeArray( elems ); 908 items = this.getItems( elems ); 909 } else { 910 // update all items if no elems provided 911 items = this.items; 912 } 913 914 this._getSorters(); 915 this._updateItemsSortData( items ); 916 }; 917 918 proto._getSorters = function() { 919 var getSortData = this.options.getSortData; 920 for ( var key in getSortData ) { 921 var sorter = getSortData[ key ]; 922 this._sorters[ key ] = mungeSorter( sorter ); 923 } 924 }; 925 926 /** 927 * @params {Array} items - of Isotope.Items 928 * @private 929 */ 930 proto._updateItemsSortData = function( items ) { 931 // do not update if no items 932 var len = items && items.length; 933 934 for ( var i=0; len && i < len; i++ ) { 935 var item = items[i]; 936 item.updateSortData(); 937 } 938 }; 939 940 // ----- munge sorter ----- // 941 942 // encapsulate this, as we just need mungeSorter 943 // other functions in here are just for munging 944 var mungeSorter = ( function() { 945 // add a magic layer to sorters for convienent shorthands 946 // `.foo-bar` will use the text of .foo-bar querySelector 947 // `[foo-bar]` will use attribute 948 // you can also add parser 949 // `.foo-bar parseInt` will parse that as a number 950 function mungeSorter( sorter ) { 951 // if not a string, return function or whatever it is 952 if ( typeof sorter != 'string' ) { 953 return sorter; 954 } 955 // parse the sorter string 956 var args = trim( sorter ).split(' '); 957 var query = args[0]; 958 // check if query looks like [an-attribute] 959 var attrMatch = query.match( /^\[(.+)\]$/ ); 960 var attr = attrMatch && attrMatch[1]; 961 var getValue = getValueGetter( attr, query ); 962 // use second argument as a parser 963 var parser = Isotope.sortDataParsers[ args[1] ]; 964 // parse the value, if there was a parser 965 sorter = parser ? function( elem ) { 966 return elem && parser( getValue( elem ) ); 967 } : 968 // otherwise just return value 969 function( elem ) { 970 return elem && getValue( elem ); 971 }; 972 973 return sorter; 974 } 975 976 // get an attribute getter, or get text of the querySelector 977 function getValueGetter( attr, query ) { 978 // if query looks like [foo-bar], get attribute 979 if ( attr ) { 980 return function getAttribute( elem ) { 981 return elem.getAttribute( attr ); 982 }; 983 } 984 985 // otherwise, assume its a querySelector, and get its text 986 return function getChildText( elem ) { 987 var child = elem.querySelector( query ); 988 return child && child.textContent; 989 }; 990 } 991 992 return mungeSorter; 993 })(); 994 995 // parsers used in getSortData shortcut strings 996 Isotope.sortDataParsers = { 997 'parseInt': function( val ) { 998 return parseInt( val, 10 ); 999 }, 1000 'parseFloat': function( val ) { 1001 return parseFloat( val ); 1002 } 1003 }; 1004 1005 // ----- sort method ----- // 1006 1007 // sort filteredItem order 1008 proto._sort = function() { 1009 if ( !this.options.sortBy ) { 1010 return; 1011 } 1012 // keep track of sortBy History 1013 var sortBys = utils.makeArray( this.options.sortBy ); 1014 if ( !this._getIsSameSortBy( sortBys ) ) { 1015 // concat all sortBy and sortHistory, add to front, oldest goes in last 1016 this.sortHistory = sortBys.concat( this.sortHistory ); 1017 } 1018 // sort magic 1019 var itemSorter = getItemSorter( this.sortHistory, this.options.sortAscending ); 1020 this.filteredItems.sort( itemSorter ); 1021 }; 1022 1023 // check if sortBys is same as start of sortHistory 1024 proto._getIsSameSortBy = function( sortBys ) { 1025 for ( var i=0; i < sortBys.length; i++ ) { 1026 if ( sortBys[i] != this.sortHistory[i] ) { 1027 return false; 1028 } 1029 } 1030 return true; 1031 }; 1032 1033 // returns a function used for sorting 1034 function getItemSorter( sortBys, sortAsc ) { 1035 return function sorter( itemA, itemB ) { 1036 // cycle through all sortKeys 1037 for ( var i = 0; i < sortBys.length; i++ ) { 1038 var sortBy = sortBys[i]; 1039 var a = itemA.sortData[ sortBy ]; 1040 var b = itemB.sortData[ sortBy ]; 1041 if ( a > b || a < b ) { 1042 // if sortAsc is an object, use the value given the sortBy key 1043 var isAscending = sortAsc[ sortBy ] !== undefined ? sortAsc[ sortBy ] : sortAsc; 1044 var direction = isAscending ? 1 : -1; 1045 return ( a > b ? 1 : -1 ) * direction; 1046 } 1047 } 1048 return 0; 1049 }; 1050 } 1051 1052 // -------------------------- methods -------------------------- // 1053 1054 // get layout mode 1055 proto._mode = function() { 1056 var layoutMode = this.options.layoutMode; 1057 var mode = this.modes[ layoutMode ]; 1058 if ( !mode ) { 1059 // TODO console.error 1060 throw new Error( 'No layout mode: ' + layoutMode ); 1061 } 1062 // HACK sync mode's options 1063 // any options set after init for layout mode need to be synced 1064 mode.options = this.options[ layoutMode ]; 1065 return mode; 1066 }; 1067 1068 proto._resetLayout = function() { 1069 // trigger original reset layout 1070 Outlayer.prototype._resetLayout.call( this ); 1071 this._mode()._resetLayout(); 1072 }; 1073 1074 proto._getItemLayoutPosition = function( item ) { 1075 return this._mode()._getItemLayoutPosition( item ); 1076 }; 1077 1078 proto._manageStamp = function( stamp ) { 1079 this._mode()._manageStamp( stamp ); 1080 }; 1081 1082 proto._getContainerSize = function() { 1083 return this._mode()._getContainerSize(); 1084 }; 1085 1086 proto.needsResizeLayout = function() { 1087 return this._mode().needsResizeLayout(); 1088 }; 1089 1090 // -------------------------- adding & removing -------------------------- // 1091 1092 // HEADS UP overwrites default Outlayer appended 1093 proto.appended = function( elems ) { 1094 var items = this.addItems( elems ); 1095 if ( !items.length ) { 1096 return; 1097 } 1098 // filter, layout, reveal new items 1099 var filteredItems = this._filterRevealAdded( items ); 1100 // add to filteredItems 1101 this.filteredItems = this.filteredItems.concat( filteredItems ); 1102 }; 1103 1104 // HEADS UP overwrites default Outlayer prepended 1105 proto.prepended = function( elems ) { 1106 var items = this._itemize( elems ); 1107 if ( !items.length ) { 1108 return; 1109 } 1110 // start new layout 1111 this._resetLayout(); 1112 this._manageStamps(); 1113 // filter, layout, reveal new items 1114 var filteredItems = this._filterRevealAdded( items ); 1115 // layout previous items 1116 this.layoutItems( this.filteredItems ); 1117 // add to items and filteredItems 1118 this.filteredItems = filteredItems.concat( this.filteredItems ); 1119 this.items = items.concat( this.items ); 1120 }; 1121 1122 proto._filterRevealAdded = function( items ) { 1123 var filtered = this._filter( items ); 1124 this.hide( filtered.needHide ); 1125 // reveal all new items 1126 this.reveal( filtered.matches ); 1127 // layout new items, no transition 1128 this.layoutItems( filtered.matches, true ); 1129 return filtered.matches; 1130 }; 1131 1132 /** 1133 * Filter, sort, and layout newly-appended item elements 1134 * @param {Array or NodeList or Element} elems 1135 */ 1136 proto.insert = function( elems ) { 1137 var items = this.addItems( elems ); 1138 if ( !items.length ) { 1139 return; 1140 } 1141 // append item elements 1142 var i, item; 1143 var len = items.length; 1144 for ( i=0; i < len; i++ ) { 1145 item = items[i]; 1146 this.element.appendChild( item.element ); 1147 } 1148 // filter new stuff 1149 var filteredInsertItems = this._filter( items ).matches; 1150 // set flag 1151 for ( i=0; i < len; i++ ) { 1152 items[i].isLayoutInstant = true; 1153 } 1154 this.arrange(); 1155 // reset flag 1156 for ( i=0; i < len; i++ ) { 1157 delete items[i].isLayoutInstant; 1158 } 1159 this.reveal( filteredInsertItems ); 1160 }; 1161 1162 var _remove = proto.remove; 1163 proto.remove = function( elems ) { 1164 elems = utils.makeArray( elems ); 1165 var removeItems = this.getItems( elems ); 1166 // do regular thing 1167 _remove.call( this, elems ); 1168 // bail if no items to remove 1169 var len = removeItems && removeItems.length; 1170 // remove elems from filteredItems 1171 for ( var i=0; len && i < len; i++ ) { 1172 var item = removeItems[i]; 1173 // remove item from collection 1174 utils.removeFrom( this.filteredItems, item ); 1175 } 1176 }; 1177 1178 proto.shuffle = function() { 1179 // update random sortData 1180 for ( var i=0; i < this.items.length; i++ ) { 1181 var item = this.items[i]; 1182 item.sortData.random = Math.random(); 1183 } 1184 this.options.sortBy = 'random'; 1185 this._sort(); 1186 this._layout(); 1187 }; 1188 1189 /** 1190 * trigger fn without transition 1191 * kind of hacky to have this in the first place 1192 * @param {Function} fn 1193 * @param {Array} args 1194 * @returns ret 1195 * @private 1196 */ 1197 proto._noTransition = function( fn, args ) { 1198 // save transitionDuration before disabling 1199 var transitionDuration = this.options.transitionDuration; 1200 // disable transition 1201 this.options.transitionDuration = 0; 1202 // do it 1203 var returnValue = fn.apply( this, args ); 1204 // re-enable transition for reveal 1205 this.options.transitionDuration = transitionDuration; 1206 return returnValue; 1207 }; 1208 1209 // ----- helper methods ----- // 1210 1211 /** 1212 * getter method for getting filtered item elements 1213 * @returns {Array} elems - collection of item elements 1214 */ 1215 proto.getFilteredItemElements = function() { 1216 return this.filteredItems.map( function( item ) { 1217 return item.element; 1218 }); 1219 }; 1220 1221 // ----- ----- // 1222 1223 return Isotope; 1224 1225})); 1226
1227 1228/***/ }), 1229 1230/***/ 5568: 1231/***/ ((module, exports, __webpack_require__) => { 1232 1233var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 1234 * Isotope Item 1235**/ 1236 1237( function( window, factory ) { 1238 // universal module definition 1239 /* jshint strict: false */ /*globals define, module, require */ 1240 if ( true ) { 1241 // AMD 1242 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 1243 __webpack_require__(1794) 1244 ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 1245 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 1246 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
vendor: 5,528 bytes, lines 1247-1458
1247 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1248 } else {} 1249 1250}( window, function factory( Outlayer ) { 1251'use strict'; 1252 1253// -------------------------- Item -------------------------- // 1254 1255// sub-class Outlayer Item 1256function Item() { 1257 Outlayer.Item.apply( this, arguments ); 1258} 1259 1260var proto = Item.prototype = Object.create( Outlayer.Item.prototype ); 1261 1262var _create = proto._create; 1263proto._create = function() { 1264 // assign id, used for original-order sorting 1265 this.id = this.layout.itemGUID++; 1266 _create.call( this ); 1267 this.sortData = {}; 1268}; 1269 1270proto.updateSortData = function() { 1271 if ( this.isIgnored ) { 1272 return; 1273 } 1274 // default sorters 1275 this.sortData.id = this.id; 1276 // for backward compatibility 1277 this.sortData['original-order'] = this.id; 1278 this.sortData.random = Math.random(); 1279 // go thru getSortData obj and apply the sorters 1280 var getSortData = this.layout.options.getSortData; 1281 var sorters = this.layout._sorters; 1282 for ( var key in getSortData ) { 1283 var sorter = sorters[ key ]; 1284 this.sortData[ key ] = sorter( this.element, this ); 1285 } 1286}; 1287 1288var _destroy = proto.destroy; 1289proto.destroy = function() { 1290 // call super 1291 _destroy.apply( this, arguments ); 1292 // reset display, #741 1293 this.css({ 1294 display: '' 1295 }); 1296}; 1297 1298return Item; 1299 1300})); 1301 1302 1303/***/ }), 1304 1305/***/ 1835: 1306/***/ ((module, exports, __webpack_require__) => { 1307 1308var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 1309 * Isotope LayoutMode 1310 */ 1311 1312( function( window, factory ) { 1313 // universal module definition 1314 /* jshint strict: false */ /*globals define, module, require */ 1315 if ( true ) { 1316 // AMD 1317 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 1318 __webpack_require__(6131), 1319 __webpack_require__(1794) 1320 ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 1321 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 1322 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 1323 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1324 } else {} 1325 1326}( window, function factory( getSize, Outlayer ) { 1327 'use strict'; 1328 1329 // layout mode class 1330 function LayoutMode( isotope ) { 1331 this.isotope = isotope; 1332 // link properties 1333 if ( isotope ) { 1334 this.options = isotope.options[ this.namespace ]; 1335 this.element = isotope.element; 1336 this.items = isotope.filteredItems; 1337 this.size = isotope.size; 1338 } 1339 } 1340 1341 var proto = LayoutMode.prototype; 1342 1343 /** 1344 * some methods should just defer to default Outlayer method 1345 * and reference the Isotope instance as `this` 1346 **/ 1347 var facadeMethods = [ 1348 '_resetLayout', 1349 '_getItemLayoutPosition', 1350 '_manageStamp', 1351 '_getContainerSize', 1352 '_getElementOffset', 1353 'needsResizeLayout', 1354 '_getOption' 1355 ]; 1356 1357 facadeMethods.forEach( function( methodName ) { 1358 proto[ methodName ] = function() { 1359 return Outlayer.prototype[ methodName ].apply( this.isotope, arguments ); 1360 }; 1361 }); 1362 1363 // ----- ----- // 1364 1365 // for horizontal layout modes, check vertical size 1366 proto.needsVerticalResizeLayout = function() { 1367 // don't trigger if size did not change 1368 var size = getSize( this.isotope.element ); 1369 // check that this.size and size are there 1370 // IE8 triggers resize on body size change, so they might not be 1371 var hasSizes = this.isotope.size && size; 1372 return hasSizes && size.innerHeight != this.isotope.size.innerHeight; 1373 }; 1374 1375 // ----- measurements ----- // 1376 1377 proto._getMeasurement = function() { 1378 this.isotope._getMeasurement.apply( this, arguments ); 1379 }; 1380 1381 proto.getColumnWidth = function() { 1382 this.getSegmentSize( 'column', 'Width' ); 1383 }; 1384 1385 proto.getRowHeight = function() { 1386 this.getSegmentSize( 'row', 'Height' ); 1387 }; 1388 1389 /** 1390 * get columnWidth or rowHeight 1391 * segment: 'column' or 'row' 1392 * size 'Width' or 'Height' 1393 **/ 1394 proto.getSegmentSize = function( segment, size ) { 1395 var segmentName = segment + size; 1396 var outerSize = 'outer' + size; 1397 // columnWidth / outerWidth // rowHeight / outerHeight 1398 this._getMeasurement( segmentName, outerSize ); 1399 // got rowHeight or columnWidth, we can chill 1400 if ( this[ segmentName ] ) { 1401 return; 1402 } 1403 // fall back to item of first element 1404 var firstItemSize = this.getFirstItemSize(); 1405 this[ segmentName ] = firstItemSize && firstItemSize[ outerSize ] || 1406 // or size of container 1407 this.isotope.size[ 'inner' + size ]; 1408 }; 1409 1410 proto.getFirstItemSize = function() { 1411 var firstItem = this.isotope.filteredItems[0]; 1412 return firstItem && firstItem.element && getSize( firstItem.element ); 1413 }; 1414 1415 // ----- methods that should reference isotope ----- // 1416 1417 proto.layout = function() { 1418 this.isotope.layout.apply( this.isotope, arguments ); 1419 }; 1420 1421 proto.getSize = function() { 1422 this.isotope.getSize(); 1423 this.size = this.isotope.size; 1424 }; 1425 1426 // -------------------------- create -------------------------- // 1427 1428 LayoutMode.modes = {}; 1429 1430 LayoutMode.create = function( namespace, options ) { 1431 1432 function Mode() { 1433 LayoutMode.apply( this, arguments ); 1434 } 1435 1436 Mode.prototype = Object.create( proto ); 1437 Mode.prototype.constructor = Mode; 1438 1439 // default options 1440 if ( options ) { 1441 Mode.options = options; 1442 } 1443 1444 Mode.prototype.namespace = namespace; 1445 // register in Isotope 1446 LayoutMode.modes[ namespace ] = Mode; 1447 1448 return Mode; 1449 }; 1450 1451 return LayoutMode; 1452 1453})); 1454 1455 1456/***/ }), 1457 1458/***/ 8947:
1459/***/ ((module, exports, __webpack_require__) => { 1460 1461var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 1462 * fitRows layout mode 1463 */ 1464 1465( function( window, factory ) { 1466 // universal module definition 1467 /* jshint strict: false */ /*globals define, module, require */ 1468 if ( true ) { 1469 // AMD 1470 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 1471 __webpack_require__(1835) 1472 ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 1473 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 1474 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 1475 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1476 } else {} 1477 1478}( window, function factory( LayoutMode ) { 1479'use strict'; 1480 1481var FitRows = LayoutMode.create('fitRows'); 1482 1483var proto = FitRows.prototype; 1484 1485proto._resetLayout = function() { 1486 this.x = 0; 1487 this.y = 0; 1488 this.maxY = 0; 1489 this._getMeasurement( 'gutter', 'outerWidth' ); 1490}; 1491 1492proto._getItemLayoutPosition = function( item ) { 1493 item.getSize(); 1494 1495 var itemWidth = item.size.outerWidth + this.gutter; 1496 // if this element cannot fit in the current row 1497 var containerWidth = this.isotope.size.innerWidth + this.gutter; 1498 if ( this.x !== 0 && itemWidth + this.x > containerWidth ) { 1499 this.x = 0; 1500 this.y = this.maxY; 1501 } 1502 1503 var position = { 1504 x: this.x, 1505 y: this.y 1506 }; 1507 1508 this.maxY = Math.max( this.maxY, this.y + item.size.outerHeight ); 1509 this.x += itemWidth; 1510 1511 return position; 1512}; 1513 1514proto._getContainerSize = function() { 1515 return { height: this.maxY }; 1516}; 1517 1518return FitRows; 1519 1520})); 1521 1522 1523/***/ }), 1524 1525/***/ 666: 1526/***/ ((module, exports, __webpack_require__) => { 1527 1528var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 1529 * Masonry layout mode 1530 * sub-classes Masonry 1531 * https://masonry.desandro.com 1532 */ 1533 1534( function( window, factory ) { 1535 // universal module definition 1536 /* jshint strict: false */ /*globals define, module, require */ 1537 if ( true ) { 1538 // AMD 1539 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 1540 __webpack_require__(1835), 1541 __webpack_require__(8751) 1542 ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 1543 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 1544 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 1545 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1546 } else {} 1547 1548}( window, function factory( LayoutMode, Masonry ) { 1549'use strict'; 1550 1551// -------------------------- masonryDefinition -------------------------- // 1552 1553 // create an Outlayer layout class 1554 var MasonryMode = LayoutMode.create('masonry'); 1555 1556 var proto = MasonryMode.prototype; 1557 1558 var keepModeMethods = { 1559 _getElementOffset: true, 1560 layout: true, 1561 _getMeasurement: true 1562 }; 1563 1564 // inherit Masonry prototype 1565 for ( var method in Masonry.prototype ) { 1566 // do not inherit mode methods 1567 if ( !keepModeMethods[ method ] ) { 1568 proto[ method ] = Masonry.prototype[ method ]; 1569 } 1570 } 1571 1572 var measureColumns = proto.measureColumns; 1573 proto.measureColumns = function() { 1574 // set items, used if measuring first item 1575 this.items = this.isotope.filteredItems; 1576 measureColumns.call( this ); 1577 }; 1578 1579 // point to mode options for fitWidth 1580 var _getOption = proto._getOption; 1581 proto._getOption = function( option ) { 1582 if ( option == 'fitWidth' ) { 1583 return this.options.isFitWidth !== undefined ? 1584 this.options.isFitWidth : this.options.fitWidth; 1585 } 1586 return _getOption.apply( this.isotope, arguments ); 1587 }; 1588 1589 return MasonryMode; 1590 1591})); 1592 1593 1594/***/ }), 1595 1596/***/ 3157: 1597/***/ ((module, exports, __webpack_require__) => { 1598 1599var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 1600 * vertical layout mode 1601 */ 1602 1603( function( window, factory ) { 1604 // universal module definition 1605 /* jshint strict: false */ /*globals define, module, require */ 1606 if ( true ) { 1607 // AMD 1608 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 1609 __webpack_require__(1835) 1610 ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 1611 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 1612 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
1613 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1614 } else {} 1615 1616}( window, function factory( LayoutMode ) { 1617'use strict'; 1618 1619var Vertical = LayoutMode.create( 'vertical', { 1620 horizontalAlignment: 0 1621}); 1622 1623var proto = Vertical.prototype; 1624 1625proto._resetLayout = function() { 1626 this.y = 0; 1627}; 1628 1629proto._getItemLayoutPosition = function( item ) { 1630 item.getSize(); 1631 var x = ( this.isotope.size.innerWidth - item.size.outerWidth ) * 1632 this.options.horizontalAlignment; 1633 var y = this.y; 1634 this.y += item.size.outerHeight; 1635 return { x: x, y: y }; 1636}; 1637 1638proto._getContainerSize = function() { 1639 return { height: this.y }; 1640}; 1641 1642return Vertical; 1643 1644})); 1645 1646 1647/***/ }), 1648 1649/***/ 8751: 1650/***/ ((module, exports, __webpack_require__) => { 1651 1652var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 1653 * Masonry v4.2.2 1654 * Cascading grid layout library 1655 * https://masonry.desandro.com 1656 * MIT License 1657 * by David DeSandro 1658 */ 1659 1660( function( window, factory ) { 1661 // universal module definition 1662 /* jshint strict: false */ /*globals define, module, require */ 1663 if ( true ) { 1664 // AMD 1665 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 1666 __webpack_require__(1794), 1667 __webpack_require__(6131) 1668 ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 1669 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 1670 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 1671 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1672 } else {} 1673 1674}( window, function factory( Outlayer, getSize ) { 1675 1676'use strict'; 1677 1678// -------------------------- masonryDefinition -------------------------- // 1679 1680 // create an Outlayer layout class 1681 var Masonry = Outlayer.create('masonry'); 1682 // isFitWidth -> fitWidth
vendor: 7,246 bytes, lines 1683-1902
1683 Masonry.compatOptions.fitWidth = 'isFitWidth'; 1684 1685 var proto = Masonry.prototype; 1686 1687 proto._resetLayout = function() { 1688 this.getSize(); 1689 this._getMeasurement( 'columnWidth', 'outerWidth' ); 1690 this._getMeasurement( 'gutter', 'outerWidth' ); 1691 this.measureColumns(); 1692 1693 // reset column Y 1694 this.colYs = []; 1695 for ( var i=0; i < this.cols; i++ ) { 1696 this.colYs.push( 0 ); 1697 } 1698 1699 this.maxY = 0; 1700 this.horizontalColIndex = 0; 1701 }; 1702 1703 proto.measureColumns = function() { 1704 this.getContainerWidth(); 1705 // if columnWidth is 0, default to outerWidth of first item 1706 if ( !this.columnWidth ) { 1707 var firstItem = this.items[0]; 1708 var firstItemElem = firstItem && firstItem.element; 1709 // columnWidth fall back to item of first element 1710 this.columnWidth = firstItemElem && getSize( firstItemElem ).outerWidth || 1711 // if first elem has no width, default to size of container 1712 this.containerWidth; 1713 } 1714 1715 var columnWidth = this.columnWidth += this.gutter; 1716 1717 // calculate columns 1718 var containerWidth = this.containerWidth + this.gutter; 1719 var cols = containerWidth / columnWidth; 1720 // fix rounding errors, typically with gutters 1721 var excess = columnWidth - containerWidth % columnWidth; 1722 // if overshoot is less than a pixel, round up, otherwise floor it 1723 var mathMethod = excess && excess < 1 ? 'round' : 'floor'; 1724 cols = Math[ mathMethod ]( cols ); 1725 this.cols = Math.max( cols, 1 ); 1726 }; 1727 1728 proto.getContainerWidth = function() { 1729 // container is parent if fit width 1730 var isFitWidth = this._getOption('fitWidth'); 1731 var container = isFitWidth ? this.element.parentNode : this.element; 1732 // check that this.size and size are there 1733 // IE8 triggers resize on body size change, so they might not be 1734 var size = getSize( container ); 1735 this.containerWidth = size && size.innerWidth; 1736 }; 1737 1738 proto._getItemLayoutPosition = function( item ) { 1739 item.getSize(); 1740 // how many columns does this brick span 1741 var remainder = item.size.outerWidth % this.columnWidth; 1742 var mathMethod = remainder && remainder < 1 ? 'round' : 'ceil'; 1743 // round if off by 1 pixel, otherwise use ceil 1744 var colSpan = Math[ mathMethod ]( item.size.outerWidth / this.columnWidth ); 1745 colSpan = Math.min( colSpan, this.cols ); 1746 // use horizontal or top column position 1747 var colPosMethod = this.options.horizontalOrder ? 1748 '_getHorizontalColPosition' : '_getTopColPosition'; 1749 var colPosition = this[ colPosMethod ]( colSpan, item ); 1750 // position the brick 1751 var position = { 1752 x: this.columnWidth * colPosition.col, 1753 y: colPosition.y 1754 }; 1755 // apply setHeight to necessary columns 1756 var setHeight = colPosition.y + item.size.outerHeight; 1757 var setMax = colSpan + colPosition.col; 1758 for ( var i = colPosition.col; i < setMax; i++ ) { 1759 this.colYs[i] = setHeight; 1760 } 1761 1762 return position; 1763 }; 1764 1765 proto._getTopColPosition = function( colSpan ) { 1766 var colGroup = this._getTopColGroup( colSpan ); 1767 // get the minimum Y value from the columns 1768 var minimumY = Math.min.apply( Math, colGroup ); 1769 1770 return { 1771 col: colGroup.indexOf( minimumY ), 1772 y: minimumY, 1773 }; 1774 }; 1775 1776 /** 1777 * @param {Number} colSpan - number of columns the element spans 1778 * @returns {Array} colGroup 1779 */ 1780 proto._getTopColGroup = function( colSpan ) { 1781 if ( colSpan < 2 ) { 1782 // if brick spans only one column, use all the column Ys 1783 return this.colYs; 1784 } 1785 1786 var colGroup = []; 1787 // how many different places could this brick fit horizontally 1788 var groupCount = this.cols + 1 - colSpan; 1789 // for each group potential horizontal position 1790 for ( var i = 0; i < groupCount; i++ ) { 1791 colGroup[i] = this._getColGroupY( i, colSpan ); 1792 } 1793 return colGroup; 1794 }; 1795 1796 proto._getColGroupY = function( col, colSpan ) { 1797 if ( colSpan < 2 ) { 1798 return this.colYs[ col ]; 1799 } 1800 // make an array of colY values for that one group 1801 var groupColYs = this.colYs.slice( col, col + colSpan ); 1802 // and get the max value of the array 1803 return Math.max.apply( Math, groupColYs ); 1804 }; 1805 1806 // get column position based on horizontal index. #873 1807 proto._getHorizontalColPosition = function( colSpan, item ) { 1808 var col = this.horizontalColIndex % this.cols; 1809 var isOver = colSpan > 1 && col + colSpan > this.cols; 1810 // shift to next row if item can't fit on current row 1811 col = isOver ? 0 : col; 1812 // don't let zero-size items take up space 1813 var hasSize = item.size.outerWidth && item.size.outerHeight; 1814 this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex; 1815 1816 return { 1817 col: col, 1818 y: this._getColGroupY( col, colSpan ), 1819 }; 1820 }; 1821 1822 proto._manageStamp = function( stamp ) { 1823 var stampSize = getSize( stamp ); 1824 var offset = this._getElementOffset( stamp ); 1825 // get the columns that this stamp affects 1826 var isOriginLeft = this._getOption('originLeft'); 1827 var firstX = isOriginLeft ? offset.left : offset.right; 1828 var lastX = firstX + stampSize.outerWidth; 1829 var firstCol = Math.floor( firstX / this.columnWidth ); 1830 firstCol = Math.max( 0, firstCol ); 1831 var lastCol = Math.floor( lastX / this.columnWidth ); 1832 // lastCol should not go over if multiple of columnWidth #425 1833 lastCol -= lastX % this.columnWidth ? 0 : 1; 1834 lastCol = Math.min( this.cols - 1, lastCol ); 1835 // set colYs to bottom of the stamp 1836 1837 var isOriginTop = this._getOption('originTop'); 1838 var stampMaxY = ( isOriginTop ? offset.top : offset.bottom ) + 1839 stampSize.outerHeight; 1840 for ( var i = firstCol; i <= lastCol; i++ ) { 1841 this.colYs[i] = Math.max( stampMaxY, this.colYs[i] ); 1842 } 1843 }; 1844 1845 proto._getContainerSize = function() { 1846 this.maxY = Math.max.apply( Math, this.colYs ); 1847 var size = { 1848 height: this.maxY 1849 }; 1850 1851 if ( this._getOption('fitWidth') ) { 1852 size.width = this._getContainerFitWidth(); 1853 } 1854 1855 return size; 1856 }; 1857 1858 proto._getContainerFitWidth = function() { 1859 var unusedCols = 0; 1860 // count unused columns 1861 var i = this.cols; 1862 while ( --i ) { 1863 if ( this.colYs[i] !== 0 ) { 1864 break; 1865 } 1866 unusedCols++; 1867 } 1868 // fit container to columns that have been used 1869 return ( this.cols - unusedCols ) * this.columnWidth - this.gutter; 1870 }; 1871 1872 proto.needsResizeLayout = function() { 1873 var previousWidth = this.containerWidth; 1874 this.getContainerWidth(); 1875 return previousWidth != this.containerWidth; 1876 }; 1877 1878 return Masonry; 1879 1880})); 1881 1882 1883/***/ }), 1884 1885/***/ 652: 1886/***/ ((module, exports, __webpack_require__) => { 1887 1888var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 1889 * Outlayer Item 1890 */ 1891 1892( function( window, factory ) { 1893 // universal module definition 1894 /* jshint strict: false */ /* globals define, module, require */ 1895 if ( true ) { 1896 // AMD - RequireJS 1897 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 1898 __webpack_require__(7158), 1899 __webpack_require__(6131) 1900 ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 1901 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 1902 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
1903 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 1904 } else {
vendor: 13,868 bytes, lines 1904-2430
1904} 1905 1906}( window, function factory( EvEmitter, getSize ) { 1907'use strict'; 1908 1909// ----- helpers ----- // 1910 1911function isEmptyObj( obj ) { 1912 for ( var prop in obj ) { 1913 return false; 1914 } 1915 prop = null; 1916 return true; 1917} 1918 1919// -------------------------- CSS3 support -------------------------- // 1920 1921 1922var docElemStyle = document.documentElement.style; 1923 1924var transitionProperty = typeof docElemStyle.transition == 'string' ? 1925 'transition' : 'WebkitTransition'; 1926var transformProperty = typeof docElemStyle.transform == 'string' ? 1927 'transform' : 'WebkitTransform'; 1928 1929var transitionEndEvent = { 1930 WebkitTransition: 'webkitTransitionEnd', 1931 transition: 'transitionend' 1932}[ transitionProperty ]; 1933 1934// cache all vendor properties that could have vendor prefix 1935var vendorProperties = { 1936 transform: transformProperty, 1937 transition: transitionProperty, 1938 transitionDuration: transitionProperty + 'Duration', 1939 transitionProperty: transitionProperty + 'Property', 1940 transitionDelay: transitionProperty + 'Delay' 1941}; 1942 1943// -------------------------- Item -------------------------- // 1944 1945function Item( element, layout ) { 1946 if ( !element ) { 1947 return; 1948 } 1949 1950 this.element = element; 1951 // parent layout class, i.e. Masonry, Isotope, or Packery 1952 this.layout = layout; 1953 this.position = { 1954 x: 0, 1955 y: 0 1956 }; 1957 1958 this._create(); 1959} 1960 1961// inherit EvEmitter 1962var proto = Item.prototype = Object.create( EvEmitter.prototype ); 1963proto.constructor = Item; 1964 1965proto._create = function() { 1966 // transition objects 1967 this._transn = { 1968 ingProperties: {}, 1969 clean: {}, 1970 onEnd: {} 1971 }; 1972 1973 this.css({ 1974 position: 'absolute' 1975 }); 1976}; 1977 1978// trigger specified handler for event type 1979proto.handleEvent = function( event ) { 1980 var method = 'on' + event.type; 1981 if ( this[ method ] ) { 1982 this[ method ]( event ); 1983 } 1984}; 1985 1986proto.getSize = function() { 1987 this.size = getSize( this.element ); 1988}; 1989 1990/** 1991 * apply CSS styles to element 1992 * @param {Object} style 1993 */ 1994proto.css = function( style ) { 1995 var elemStyle = this.element.style; 1996 1997 for ( var prop in style ) { 1998 // use vendor property if available 1999 var supportedProp = vendorProperties[ prop ] || prop; 2000 elemStyle[ supportedProp ] = style[ prop ]; 2001 } 2002}; 2003 2004 // measure position, and sets it 2005proto.getPosition = function() { 2006 var style = getComputedStyle( this.element ); 2007 var isOriginLeft = this.layout._getOption('originLeft'); 2008 var isOriginTop = this.layout._getOption('originTop'); 2009 var xValue = style[ isOriginLeft ? 'left' : 'right' ]; 2010 var yValue = style[ isOriginTop ? 'top' : 'bottom' ]; 2011 var x = parseFloat( xValue ); 2012 var y = parseFloat( yValue ); 2013 // convert percent to pixels 2014 var layoutSize = this.layout.size; 2015 if ( xValue.indexOf('%') != -1 ) { 2016 x = ( x / 100 ) * layoutSize.width; 2017 } 2018 if ( yValue.indexOf('%') != -1 ) { 2019 y = ( y / 100 ) * layoutSize.height; 2020 } 2021 // clean up 'auto' or other non-integer values 2022 x = isNaN( x ) ? 0 : x; 2023 y = isNaN( y ) ? 0 : y; 2024 // remove padding from measurement 2025 x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight; 2026 y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom; 2027 2028 this.position.x = x; 2029 this.position.y = y; 2030}; 2031 2032// set settled position, apply padding 2033proto.layoutPosition = function() { 2034 var layoutSize = this.layout.size; 2035 var style = {}; 2036 var isOriginLeft = this.layout._getOption('originLeft'); 2037 var isOriginTop = this.layout._getOption('originTop'); 2038 2039 // x 2040 var xPadding = isOriginLeft ? 'paddingLeft' : 'paddingRight'; 2041 var xProperty = isOriginLeft ? 'left' : 'right'; 2042 var xResetProperty = isOriginLeft ? 'right' : 'left'; 2043 2044 var x = this.position.x + layoutSize[ xPadding ]; 2045 // set in percentage or pixels 2046 style[ xProperty ] = this.getXValue( x ); 2047 // reset other property 2048 style[ xResetProperty ] = ''; 2049 2050 // y 2051 var yPadding = isOriginTop ? 'paddingTop' : 'paddingBottom'; 2052 var yProperty = isOriginTop ? 'top' : 'bottom'; 2053 var yResetProperty = isOriginTop ? 'bottom' : 'top'; 2054 2055 var y = this.position.y + layoutSize[ yPadding ]; 2056 // set in percentage or pixels 2057 style[ yProperty ] = this.getYValue( y ); 2058 // reset other property 2059 style[ yResetProperty ] = ''; 2060 2061 this.css( style ); 2062 this.emitEvent( 'layout', [ this ] ); 2063}; 2064 2065proto.getXValue = function( x ) { 2066 var isHorizontal = this.layout._getOption('horizontal'); 2067 return this.layout.options.percentPosition && !isHorizontal ? 2068 ( ( x / this.layout.size.width ) * 100 ) + '%' : x + 'px'; 2069}; 2070 2071proto.getYValue = function( y ) { 2072 var isHorizontal = this.layout._getOption('horizontal'); 2073 return this.layout.options.percentPosition && isHorizontal ? 2074 ( ( y / this.layout.size.height ) * 100 ) + '%' : y + 'px'; 2075}; 2076 2077proto._transitionTo = function( x, y ) { 2078 this.getPosition(); 2079 // get current x & y from top/left 2080 var curX = this.position.x; 2081 var curY = this.position.y; 2082 2083 var didNotMove = x == this.position.x && y == this.position.y; 2084 2085 // save end position 2086 this.setPosition( x, y ); 2087 2088 // if did not move and not transitioning, just go to layout 2089 if ( didNotMove && !this.isTransitioning ) { 2090 this.layoutPosition(); 2091 return; 2092 } 2093 2094 var transX = x - curX; 2095 var transY = y - curY; 2096 var transitionStyle = {}; 2097 transitionStyle.transform = this.getTranslate( transX, transY ); 2098 2099 this.transition({ 2100 to: transitionStyle, 2101 onTransitionEnd: { 2102 transform: this.layoutPosition 2103 }, 2104 isCleaning: true 2105 }); 2106}; 2107 2108proto.getTranslate = function( x, y ) { 2109 // flip cooridinates if origin on right or bottom 2110 var isOriginLeft = this.layout._getOption('originLeft'); 2111 var isOriginTop = this.layout._getOption('originTop'); 2112 x = isOriginLeft ? x : -x; 2113 y = isOriginTop ? y : -y; 2114 return 'translate3d(' + x + 'px, ' + y + 'px, 0)'; 2115}; 2116 2117// non transition + transform support 2118proto.goTo = function( x, y ) { 2119 this.setPosition( x, y ); 2120 this.layoutPosition(); 2121}; 2122 2123proto.moveTo = proto._transitionTo; 2124 2125proto.setPosition = function( x, y ) { 2126 this.position.x = parseFloat( x ); 2127 this.position.y = parseFloat( y ); 2128}; 2129 2130// ----- transition ----- // 2131 2132/** 2133 * @param {Object} style - CSS 2134 * @param {Function} onTransitionEnd 2135 */ 2136 2137// non transition, just trigger callback 2138proto._nonTransition = function( args ) { 2139 this.css( args.to ); 2140 if ( args.isCleaning ) { 2141 this._removeStyles( args.to ); 2142 } 2143 for ( var prop in args.onTransitionEnd ) { 2144 args.onTransitionEnd[ prop ].call( this ); 2145 } 2146}; 2147 2148/** 2149 * proper transition 2150 * @param {Object} args - arguments 2151 * @param {Object} to - style to transition to 2152 * @param {Object} from - style to start transition from 2153 * @param {Boolean} isCleaning - removes transition styles after transition 2154 * @param {Function} onTransitionEnd - callback 2155 */ 2156proto.transition = function( args ) { 2157 // redirect to nonTransition if no transition duration 2158 if ( !parseFloat( this.layout.options.transitionDuration ) ) { 2159 this._nonTransition( args ); 2160 return; 2161 } 2162 2163 var _transition = this._transn; 2164 // keep track of onTransitionEnd callback by css property 2165 for ( var prop in args.onTransitionEnd ) { 2166 _transition.onEnd[ prop ] = args.onTransitionEnd[ prop ]; 2167 } 2168 // keep track of properties that are transitioning 2169 for ( prop in args.to ) { 2170 _transition.ingProperties[ prop ] = true; 2171 // keep track of properties to clean up when transition is done 2172 if ( args.isCleaning ) { 2173 _transition.clean[ prop ] = true; 2174 } 2175 } 2176 2177 // set from styles 2178 if ( args.from ) { 2179 this.css( args.from ); 2180 // force redraw. http://blog.alexmaccaw.com/css-transitions 2181 var h = this.element.offsetHeight; 2182 // hack for JSHint to hush about unused var 2183 h = null; 2184 } 2185 // enable transition 2186 this.enableTransition( args.to ); 2187 // set styles that are transitioning 2188 this.css( args.to ); 2189 2190 this.isTransitioning = true; 2191 2192}; 2193 2194// dash before all cap letters, including first for 2195// WebkitTransform => -webkit-transform 2196function toDashedAll( str ) { 2197 return str.replace( /([A-Z])/g, function( $1 ) { 2198 return '-' + $1.toLowerCase(); 2199 }); 2200} 2201 2202var transitionProps = 'opacity,' + toDashedAll( transformProperty ); 2203 2204proto.enableTransition = function(/* style */) { 2205 // HACK changing transitionProperty during a transition 2206 // will cause transition to jump 2207 if ( this.isTransitioning ) { 2208 return; 2209 } 2210 2211 // make `transition: foo, bar, baz` from style object 2212 // HACK un-comment this when enableTransition can work 2213 // while a transition is happening 2214 // var transitionValues = []; 2215 // for ( var prop in style ) { 2216 // // dash-ify camelCased properties like WebkitTransition 2217 // prop = vendorProperties[ prop ] || prop; 2218 // transitionValues.push( toDashedAll( prop ) ); 2219 // } 2220 // munge number to millisecond, to match stagger 2221 var duration = this.layout.options.transitionDuration; 2222 duration = typeof duration == 'number' ? duration + 'ms' : duration; 2223 // enable transition styles 2224 this.css({ 2225 transitionProperty: transitionProps, 2226 transitionDuration: duration, 2227 transitionDelay: this.staggerDelay || 0 2228 }); 2229 // listen for transition end event 2230 this.element.addEventListener( transitionEndEvent, this, false ); 2231}; 2232 2233// ----- events ----- // 2234 2235proto.onwebkitTransitionEnd = function( event ) { 2236 this.ontransitionend( event ); 2237}; 2238 2239proto.onotransitionend = function( event ) { 2240 this.ontransitionend( event ); 2241}; 2242 2243// properties that I munge to make my life easier 2244var dashedVendorProperties = { 2245 '-webkit-transform': 'transform' 2246}; 2247 2248proto.ontransitionend = function( event ) { 2249 // disregard bubbled events from children 2250 if ( event.target !== this.element ) { 2251 return; 2252 } 2253 var _transition = this._transn; 2254 // get property name of transitioned property, convert to prefix-free 2255 var propertyName = dashedVendorProperties[ event.propertyName ] || event.propertyName; 2256 2257 // remove property that has completed transitioning 2258 delete _transition.ingProperties[ propertyName ]; 2259 // check if any properties are still transitioning 2260 if ( isEmptyObj( _transition.ingProperties ) ) { 2261 // all properties have completed transitioning 2262 this.disableTransition(); 2263 } 2264 // clean style 2265 if ( propertyName in _transition.clean ) { 2266 // clean up style 2267 this.element.style[ event.propertyName ] = ''; 2268 delete _transition.clean[ propertyName ]; 2269 } 2270 // trigger onTransitionEnd callback 2271 if ( propertyName in _transition.onEnd ) { 2272 var onTransitionEnd = _transition.onEnd[ propertyName ]; 2273 onTransitionEnd.call( this ); 2274 delete _transition.onEnd[ propertyName ]; 2275 } 2276 2277 this.emitEvent( 'transitionEnd', [ this ] ); 2278}; 2279 2280proto.disableTransition = function() { 2281 this.removeTransitionStyles(); 2282 this.element.removeEventListener( transitionEndEvent, this, false ); 2283 this.isTransitioning = false; 2284}; 2285 2286/** 2287 * removes style property from element 2288 * @param {Object} style 2289**/ 2290proto._removeStyles = function( style ) { 2291 // clean up transition styles 2292 var cleanStyle = {}; 2293 for ( var prop in style ) { 2294 cleanStyle[ prop ] = ''; 2295 } 2296 this.css( cleanStyle ); 2297}; 2298 2299var cleanTransitionStyle = { 2300 transitionProperty: '', 2301 transitionDuration: '', 2302 transitionDelay: '' 2303}; 2304 2305proto.removeTransitionStyles = function() { 2306 // remove transition 2307 this.css( cleanTransitionStyle ); 2308}; 2309 2310// ----- stagger ----- // 2311 2312proto.stagger = function( delay ) { 2313 delay = isNaN( delay ) ? 0 : delay; 2314 this.staggerDelay = delay + 'ms'; 2315}; 2316 2317// ----- show/hide/remove ----- // 2318 2319// remove element from DOM 2320proto.removeElem = function() { 2321 this.element.parentNode.removeChild( this.element ); 2322 // remove display: none 2323 this.css({ display: '' }); 2324 this.emitEvent( 'remove', [ this ] ); 2325}; 2326 2327proto.remove = function() { 2328 // just remove element if no transition support or no transition 2329 if ( !transitionProperty || !parseFloat( this.layout.options.transitionDuration ) ) { 2330 this.removeElem(); 2331 return; 2332 } 2333 2334 // start transition 2335 this.once( 'transitionEnd', function() { 2336 this.removeElem(); 2337 }); 2338 this.hide(); 2339}; 2340 2341proto.reveal = function() { 2342 delete this.isHidden; 2343 // remove display: none 2344 this.css({ display: '' }); 2345 2346 var options = this.layout.options; 2347 2348 var onTransitionEnd = {}; 2349 var transitionEndProperty = this.getHideRevealTransitionEndProperty('visibleStyle'); 2350 onTransitionEnd[ transitionEndProperty ] = this.onRevealTransitionEnd; 2351 2352 this.transition({ 2353 from: options.hiddenStyle, 2354 to: options.visibleStyle, 2355 isCleaning: true, 2356 onTransitionEnd: onTransitionEnd 2357 }); 2358}; 2359 2360proto.onRevealTransitionEnd = function() { 2361 // check if still visible 2362 // during transition, item may have been hidden 2363 if ( !this.isHidden ) { 2364 this.emitEvent('reveal'); 2365 } 2366}; 2367 2368/** 2369 * get style property use for hide/reveal transition end 2370 * @param {String} styleProperty - hiddenStyle/visibleStyle 2371 * @returns {String} 2372 */ 2373proto.getHideRevealTransitionEndProperty = function( styleProperty ) { 2374 var optionStyle = this.layout.options[ styleProperty ]; 2375 // use opacity 2376 if ( optionStyle.opacity ) { 2377 return 'opacity'; 2378 } 2379 // get first property 2380 for ( var prop in optionStyle ) { 2381 return prop; 2382 } 2383}; 2384 2385proto.hide = function() { 2386 // set flag 2387 this.isHidden = true; 2388 // remove display: none 2389 this.css({ display: '' }); 2390 2391 var options = this.layout.options; 2392 2393 var onTransitionEnd = {}; 2394 var transitionEndProperty = this.getHideRevealTransitionEndProperty('hiddenStyle'); 2395 onTransitionEnd[ transitionEndProperty ] = this.onHideTransitionEnd; 2396 2397 this.transition({ 2398 from: options.visibleStyle, 2399 to: options.hiddenStyle, 2400 // keep hidden stuff hidden 2401 isCleaning: true, 2402 onTransitionEnd: onTransitionEnd 2403 }); 2404}; 2405 2406proto.onHideTransitionEnd = function() { 2407 // check if still hidden 2408 // during transition, item may have been un-hidden 2409 if ( this.isHidden ) { 2410 this.css({ display: 'none' }); 2411 this.emitEvent('hide'); 2412 } 2413}; 2414 2415proto.destroy = function() { 2416 this.css({ 2417 position: '', 2418 left: '', 2419 right: '', 2420 top: '', 2421 bottom: '', 2422 transition: '', 2423 transform: '' 2424 }); 2425}; 2426 2427return Item; 2428 2429})); 2430
2431 2432/***/ }), 2433 2434/***/ 1794: 2435/***/ ((module, exports, __webpack_require__) => { 2436 2437var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 2438 * Outlayer v2.1.1 2439 * the brains and guts of a layout library 2440 * MIT license 2441 */ 2442 2443( function( window, factory ) { 2444 'use strict'; 2445 // universal module definition 2446 /* jshint strict: false */ /* globals define, module, require */ 2447 if ( true ) { 2448 // AMD - RequireJS 2449 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 2450 __webpack_require__(7158), 2451 __webpack_require__(6131), 2452 __webpack_require__(9047), 2453 __webpack_require__(652) 2454 ], __WEBPACK_AMD_DEFINE_RESULT__ = (function( EvEmitter, getSize, utils, Item ) { 2455 return factory( window, EvEmitter, getSize, utils, Item); 2456 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 2457 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 2458 } else {
vendor: 21,005 bytes, lines 2458-3357
2458} 2459 2460}( window, function factory( window, EvEmitter, getSize, utils, Item ) { 2461'use strict'; 2462 2463// ----- vars ----- // 2464 2465var console = window.console; 2466var jQuery = window.jQuery; 2467var noop = function() {}; 2468 2469// -------------------------- Outlayer -------------------------- // 2470 2471// globally unique identifiers 2472var GUID = 0; 2473// internal store of all Outlayer intances 2474var instances = {}; 2475 2476 2477/** 2478 * @param {Element, String} element 2479 * @param {Object} options 2480 * @constructor 2481 */ 2482function Outlayer( element, options ) { 2483 var queryElement = utils.getQueryElement( element ); 2484 if ( !queryElement ) { 2485 if ( console ) { 2486 console.error( 'Bad element for ' + this.constructor.namespace + 2487 ': ' + ( queryElement || element ) ); 2488 } 2489 return; 2490 } 2491 this.element = queryElement; 2492 // add jQuery 2493 if ( jQuery ) { 2494 this.$element = jQuery( this.element ); 2495 } 2496 2497 // options 2498 this.options = utils.extend( {}, this.constructor.defaults ); 2499 this.option( options ); 2500 2501 // add id for Outlayer.getFromElement 2502 var id = ++GUID; 2503 this.element.outlayerGUID = id; // expando 2504 instances[ id ] = this; // associate via id 2505 2506 // kick it off 2507 this._create(); 2508 2509 var isInitLayout = this._getOption('initLayout'); 2510 if ( isInitLayout ) { 2511 this.layout(); 2512 } 2513} 2514 2515// settings are for internal use only 2516Outlayer.namespace = 'outlayer'; 2517Outlayer.Item = Item; 2518 2519// default options 2520Outlayer.defaults = { 2521 containerStyle: { 2522 position: 'relative' 2523 }, 2524 initLayout: true, 2525 originLeft: true, 2526 originTop: true, 2527 resize: true, 2528 resizeContainer: true, 2529 // item options 2530 transitionDuration: '0.4s', 2531 hiddenStyle: { 2532 opacity: 0, 2533 transform: 'scale(0.001)' 2534 }, 2535 visibleStyle: { 2536 opacity: 1, 2537 transform: 'scale(1)' 2538 } 2539}; 2540 2541var proto = Outlayer.prototype; 2542// inherit EvEmitter 2543utils.extend( proto, EvEmitter.prototype ); 2544 2545/** 2546 * set options 2547 * @param {Object} opts 2548 */ 2549proto.option = function( opts ) { 2550 utils.extend( this.options, opts ); 2551}; 2552 2553/** 2554 * get backwards compatible option value, check old name 2555 */ 2556proto._getOption = function( option ) { 2557 var oldOption = this.constructor.compatOptions[ option ]; 2558 return oldOption && this.options[ oldOption ] !== undefined ? 2559 this.options[ oldOption ] : this.options[ option ]; 2560}; 2561 2562Outlayer.compatOptions = { 2563 // currentName: oldName 2564 initLayout: 'isInitLayout', 2565 horizontal: 'isHorizontal', 2566 layoutInstant: 'isLayoutInstant', 2567 originLeft: 'isOriginLeft', 2568 originTop: 'isOriginTop', 2569 resize: 'isResizeBound', 2570 resizeContainer: 'isResizingContainer' 2571}; 2572 2573proto._create = function() { 2574 // get items from children 2575 this.reloadItems(); 2576 // elements that affect layout, but are not laid out 2577 this.stamps = []; 2578 this.stamp( this.options.stamp ); 2579 // set container style 2580 utils.extend( this.element.style, this.options.containerStyle ); 2581 2582 // bind resize method 2583 var canBindResize = this._getOption('resize'); 2584 if ( canBindResize ) { 2585 this.bindResize(); 2586 } 2587}; 2588 2589// goes through all children again and gets bricks in proper order 2590proto.reloadItems = function() { 2591 // collection of item elements 2592 this.items = this._itemize( this.element.children ); 2593}; 2594 2595 2596/** 2597 * turn elements into Outlayer.Items to be used in layout 2598 * @param {Array or NodeList or HTMLElement} elems 2599 * @returns {Array} items - collection of new Outlayer Items 2600 */ 2601proto._itemize = function( elems ) { 2602 2603 var itemElems = this._filterFindItemElements( elems ); 2604 var Item = this.constructor.Item; 2605 2606 // create new Outlayer Items for collection 2607 var items = []; 2608 for ( var i=0; i < itemElems.length; i++ ) { 2609 var elem = itemElems[i]; 2610 var item = new Item( elem, this ); 2611 items.push( item ); 2612 } 2613 2614 return items; 2615}; 2616 2617/** 2618 * get item elements to be used in layout 2619 * @param {Array or NodeList or HTMLElement} elems 2620 * @returns {Array} items - item elements 2621 */ 2622proto._filterFindItemElements = function( elems ) { 2623 return utils.filterFindElements( elems, this.options.itemSelector ); 2624}; 2625 2626/** 2627 * getter method for getting item elements 2628 * @returns {Array} elems - collection of item elements 2629 */ 2630proto.getItemElements = function() { 2631 return this.items.map( function( item ) { 2632 return item.element; 2633 }); 2634}; 2635 2636// ----- init & layout ----- // 2637 2638/** 2639 * lays out all items 2640 */ 2641proto.layout = function() { 2642 this._resetLayout(); 2643 this._manageStamps(); 2644 2645 // don't animate first layout 2646 var layoutInstant = this._getOption('layoutInstant'); 2647 var isInstant = layoutInstant !== undefined ? 2648 layoutInstant : !this._isLayoutInited; 2649 this.layoutItems( this.items, isInstant ); 2650 2651 // flag for initalized 2652 this._isLayoutInited = true; 2653}; 2654 2655// _init is alias for layout 2656proto._init = proto.layout; 2657 2658/** 2659 * logic before any new layout 2660 */ 2661proto._resetLayout = function() { 2662 this.getSize(); 2663}; 2664 2665 2666proto.getSize = function() { 2667 this.size = getSize( this.element ); 2668}; 2669 2670/** 2671 * get measurement from option, for columnWidth, rowHeight, gutter 2672 * if option is String -> get element from selector string, & get size of element 2673 * if option is Element -> get size of element 2674 * else use option as a number 2675 * 2676 * @param {String} measurement 2677 * @param {String} size - width or height 2678 * @private 2679 */ 2680proto._getMeasurement = function( measurement, size ) { 2681 var option = this.options[ measurement ]; 2682 var elem; 2683 if ( !option ) { 2684 // default to 0 2685 this[ measurement ] = 0; 2686 } else { 2687 // use option as an element 2688 if ( typeof option == 'string' ) { 2689 elem = this.element.querySelector( option ); 2690 } else if ( option instanceof HTMLElement ) { 2691 elem = option; 2692 } 2693 // use size of element, if element 2694 this[ measurement ] = elem ? getSize( elem )[ size ] : option; 2695 } 2696}; 2697 2698/** 2699 * layout a collection of item elements 2700 * @api public 2701 */ 2702proto.layoutItems = function( items, isInstant ) { 2703 items = this._getItemsForLayout( items ); 2704 2705 this._layoutItems( items, isInstant ); 2706 2707 this._postLayout(); 2708}; 2709 2710/** 2711 * get the items to be laid out 2712 * you may want to skip over some items 2713 * @param {Array} items 2714 * @returns {Array} items 2715 */ 2716proto._getItemsForLayout = function( items ) { 2717 return items.filter( function( item ) { 2718 return !item.isIgnored; 2719 }); 2720}; 2721 2722/** 2723 * layout items 2724 * @param {Array} items 2725 * @param {Boolean} isInstant 2726 */ 2727proto._layoutItems = function( items, isInstant ) { 2728 this._emitCompleteOnItems( 'layout', items ); 2729 2730 if ( !items || !items.length ) { 2731 // no items, emit event with empty array 2732 return; 2733 } 2734 2735 var queue = []; 2736 2737 items.forEach( function( item ) { 2738 // get x/y object from method 2739 var position = this._getItemLayoutPosition( item ); 2740 // enqueue 2741 position.item = item; 2742 position.isInstant = isInstant || item.isLayoutInstant; 2743 queue.push( position ); 2744 }, this ); 2745 2746 this._processLayoutQueue( queue ); 2747}; 2748 2749/** 2750 * get item layout position 2751 * @param {Outlayer.Item} item 2752 * @returns {Object} x and y position 2753 */ 2754proto._getItemLayoutPosition = function( /* item */ ) { 2755 return { 2756 x: 0, 2757 y: 0 2758 }; 2759}; 2760 2761/** 2762 * iterate over array and position each item 2763 * Reason being - separating this logic prevents 'layout invalidation' 2764 * thx @paul_irish 2765 * @param {Array} queue 2766 */ 2767proto._processLayoutQueue = function( queue ) { 2768 this.updateStagger(); 2769 queue.forEach( function( obj, i ) { 2770 this._positionItem( obj.item, obj.x, obj.y, obj.isInstant, i ); 2771 }, this ); 2772}; 2773 2774// set stagger from option in milliseconds number 2775proto.updateStagger = function() { 2776 var stagger = this.options.stagger; 2777 if ( stagger === null || stagger === undefined ) { 2778 this.stagger = 0; 2779 return; 2780 } 2781 this.stagger = getMilliseconds( stagger ); 2782 return this.stagger; 2783}; 2784 2785/** 2786 * Sets position of item in DOM 2787 * @param {Outlayer.Item} item 2788 * @param {Number} x - horizontal position 2789 * @param {Number} y - vertical position 2790 * @param {Boolean} isInstant - disables transitions 2791 */ 2792proto._positionItem = function( item, x, y, isInstant, i ) { 2793 if ( isInstant ) { 2794 // if not transition, just set CSS 2795 item.goTo( x, y ); 2796 } else { 2797 item.stagger( i * this.stagger ); 2798 item.moveTo( x, y ); 2799 } 2800}; 2801 2802/** 2803 * Any logic you want to do after each layout, 2804 * i.e. size the container 2805 */ 2806proto._postLayout = function() { 2807 this.resizeContainer(); 2808}; 2809 2810proto.resizeContainer = function() { 2811 var isResizingContainer = this._getOption('resizeContainer'); 2812 if ( !isResizingContainer ) { 2813 return; 2814 } 2815 var size = this._getContainerSize(); 2816 if ( size ) { 2817 this._setContainerMeasure( size.width, true ); 2818 this._setContainerMeasure( size.height, false ); 2819 } 2820}; 2821 2822/** 2823 * Sets width or height of container if returned 2824 * @returns {Object} size 2825 * @param {Number} width 2826 * @param {Number} height 2827 */ 2828proto._getContainerSize = noop; 2829 2830/** 2831 * @param {Number} measure - size of width or height 2832 * @param {Boolean} isWidth 2833 */ 2834proto._setContainerMeasure = function( measure, isWidth ) { 2835 if ( measure === undefined ) { 2836 return; 2837 } 2838 2839 var elemSize = this.size; 2840 // add padding and border width if border box 2841 if ( elemSize.isBorderBox ) { 2842 measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight + 2843 elemSize.borderLeftWidth + elemSize.borderRightWidth : 2844 elemSize.paddingBottom + elemSize.paddingTop + 2845 elemSize.borderTopWidth + elemSize.borderBottomWidth; 2846 } 2847 2848 measure = Math.max( measure, 0 ); 2849 this.element.style[ isWidth ? 'width' : 'height' ] = measure + 'px'; 2850}; 2851 2852/** 2853 * emit eventComplete on a collection of items events 2854 * @param {String} eventName 2855 * @param {Array} items - Outlayer.Items 2856 */ 2857proto._emitCompleteOnItems = function( eventName, items ) { 2858 var _this = this; 2859 function onComplete() { 2860 _this.dispatchEvent( eventName + 'Complete', null, [ items ] ); 2861 } 2862 2863 var count = items.length; 2864 if ( !items || !count ) { 2865 onComplete(); 2866 return; 2867 } 2868 2869 var doneCount = 0; 2870 function tick() { 2871 doneCount++; 2872 if ( doneCount == count ) { 2873 onComplete(); 2874 } 2875 } 2876 2877 // bind callback 2878 items.forEach( function( item ) { 2879 item.once( eventName, tick ); 2880 }); 2881}; 2882 2883/** 2884 * emits events via EvEmitter and jQuery events 2885 * @param {String} type - name of event 2886 * @param {Event} event - original event 2887 * @param {Array} args - extra arguments 2888 */ 2889proto.dispatchEvent = function( type, event, args ) { 2890 // add original event to arguments 2891 var emitArgs = event ? [ event ].concat( args ) : args; 2892 this.emitEvent( type, emitArgs ); 2893 2894 if ( jQuery ) { 2895 // set this.$element 2896 this.$element = this.$element || jQuery( this.element ); 2897 if ( event ) { 2898 // create jQuery event 2899 var $event = jQuery.Event( event ); 2900 $event.type = type; 2901 this.$element.trigger( $event, args ); 2902 } else { 2903 // just trigger with type if no event available 2904 this.$element.trigger( type, args ); 2905 } 2906 } 2907}; 2908 2909// -------------------------- ignore & stamps -------------------------- // 2910 2911 2912/** 2913 * keep item in collection, but do not lay it out 2914 * ignored items do not get skipped in layout 2915 * @param {Element} elem 2916 */ 2917proto.ignore = function( elem ) { 2918 var item = this.getItem( elem ); 2919 if ( item ) { 2920 item.isIgnored = true; 2921 } 2922}; 2923 2924/** 2925 * return item to layout collection 2926 * @param {Element} elem 2927 */ 2928proto.unignore = function( elem ) { 2929 var item = this.getItem( elem ); 2930 if ( item ) { 2931 delete item.isIgnored; 2932 } 2933}; 2934 2935/** 2936 * adds elements to stamps 2937 * @param {NodeList, Array, Element, or String} elems 2938 */ 2939proto.stamp = function( elems ) { 2940 elems = this._find( elems ); 2941 if ( !elems ) { 2942 return; 2943 } 2944 2945 this.stamps = this.stamps.concat( elems ); 2946 // ignore 2947 elems.forEach( this.ignore, this ); 2948}; 2949 2950/** 2951 * removes elements to stamps 2952 * @param {NodeList, Array, or Element} elems 2953 */ 2954proto.unstamp = function( elems ) { 2955 elems = this._find( elems ); 2956 if ( !elems ){ 2957 return; 2958 } 2959 2960 elems.forEach( function( elem ) { 2961 // filter out removed stamp elements 2962 utils.removeFrom( this.stamps, elem ); 2963 this.unignore( elem ); 2964 }, this ); 2965}; 2966 2967/** 2968 * finds child elements 2969 * @param {NodeList, Array, Element, or String} elems 2970 * @returns {Array} elems 2971 */ 2972proto._find = function( elems ) { 2973 if ( !elems ) { 2974 return; 2975 } 2976 // if string, use argument as selector string 2977 if ( typeof elems == 'string' ) { 2978 elems = this.element.querySelectorAll( elems ); 2979 } 2980 elems = utils.makeArray( elems ); 2981 return elems; 2982}; 2983 2984proto._manageStamps = function() { 2985 if ( !this.stamps || !this.stamps.length ) { 2986 return; 2987 } 2988 2989 this._getBoundingRect(); 2990 2991 this.stamps.forEach( this._manageStamp, this ); 2992}; 2993 2994// update boundingLeft / Top 2995proto._getBoundingRect = function() { 2996 // get bounding rect for container element 2997 var boundingRect = this.element.getBoundingClientRect(); 2998 var size = this.size; 2999 this._boundingRect = { 3000 left: boundingRect.left + size.paddingLeft + size.borderLeftWidth, 3001 top: boundingRect.top + size.paddingTop + size.borderTopWidth, 3002 right: boundingRect.right - ( size.paddingRight + size.borderRightWidth ), 3003 bottom: boundingRect.bottom - ( size.paddingBottom + size.borderBottomWidth ) 3004 }; 3005}; 3006 3007/** 3008 * @param {Element} stamp 3009**/ 3010proto._manageStamp = noop; 3011 3012/** 3013 * get x/y position of element relative to container element 3014 * @param {Element} elem 3015 * @returns {Object} offset - has left, top, right, bottom 3016 */ 3017proto._getElementOffset = function( elem ) { 3018 var boundingRect = elem.getBoundingClientRect(); 3019 var thisRect = this._boundingRect; 3020 var size = getSize( elem ); 3021 var offset = { 3022 left: boundingRect.left - thisRect.left - size.marginLeft, 3023 top: boundingRect.top - thisRect.top - size.marginTop, 3024 right: thisRect.right - boundingRect.right - size.marginRight, 3025 bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom 3026 }; 3027 return offset; 3028}; 3029 3030// -------------------------- resize -------------------------- // 3031 3032// enable event handlers for listeners 3033// i.e. resize -> onresize 3034proto.handleEvent = utils.handleEvent; 3035 3036/** 3037 * Bind layout to window resizing 3038 */ 3039proto.bindResize = function() { 3040 window.addEventListener( 'resize', this ); 3041 this.isResizeBound = true; 3042}; 3043 3044/** 3045 * Unbind layout to window resizing 3046 */ 3047proto.unbindResize = function() { 3048 window.removeEventListener( 'resize', this ); 3049 this.isResizeBound = false; 3050}; 3051 3052proto.onresize = function() { 3053 this.resize(); 3054}; 3055 3056utils.debounceMethod( Outlayer, 'onresize', 100 ); 3057 3058proto.resize = function() { 3059 // don't trigger if size did not change 3060 // or if resize was unbound. See #9 3061 if ( !this.isResizeBound || !this.needsResizeLayout() ) { 3062 return; 3063 } 3064 3065 this.layout(); 3066}; 3067 3068/** 3069 * check if layout is needed post layout 3070 * @returns Boolean 3071 */ 3072proto.needsResizeLayout = function() { 3073 var size = getSize( this.element ); 3074 // check that this.size and size are there 3075 // IE8 triggers resize on body size change, so they might not be 3076 var hasSizes = this.size && size; 3077 return hasSizes && size.innerWidth !== this.size.innerWidth; 3078}; 3079 3080// -------------------------- methods -------------------------- // 3081 3082/** 3083 * add items to Outlayer instance 3084 * @param {Array or NodeList or Element} elems 3085 * @returns {Array} items - Outlayer.Items 3086**/ 3087proto.addItems = function( elems ) { 3088 var items = this._itemize( elems ); 3089 // add items to collection 3090 if ( items.length ) { 3091 this.items = this.items.concat( items ); 3092 } 3093 return items; 3094}; 3095 3096/** 3097 * Layout newly-appended item elements 3098 * @param {Array or NodeList or Element} elems 3099 */ 3100proto.appended = function( elems ) { 3101 var items = this.addItems( elems ); 3102 if ( !items.length ) { 3103 return; 3104 } 3105 // layout and reveal just the new items 3106 this.layoutItems( items, true ); 3107 this.reveal( items ); 3108}; 3109 3110/** 3111 * Layout prepended elements 3112 * @param {Array or NodeList or Element} elems 3113 */ 3114proto.prepended = function( elems ) { 3115 var items = this._itemize( elems ); 3116 if ( !items.length ) { 3117 return; 3118 } 3119 // add items to beginning of collection 3120 var previousItems = this.items.slice(0); 3121 this.items = items.concat( previousItems ); 3122 // start new layout 3123 this._resetLayout(); 3124 this._manageStamps(); 3125 // layout new stuff without transition 3126 this.layoutItems( items, true ); 3127 this.reveal( items ); 3128 // layout previous items 3129 this.layoutItems( previousItems ); 3130}; 3131 3132/** 3133 * reveal a collection of items 3134 * @param {Array of Outlayer.Items} items 3135 */ 3136proto.reveal = function( items ) { 3137 this._emitCompleteOnItems( 'reveal', items ); 3138 if ( !items || !items.length ) { 3139 return; 3140 } 3141 var stagger = this.updateStagger(); 3142 items.forEach( function( item, i ) { 3143 item.stagger( i * stagger ); 3144 item.reveal(); 3145 }); 3146}; 3147 3148/** 3149 * hide a collection of items 3150 * @param {Array of Outlayer.Items} items 3151 */ 3152proto.hide = function( items ) { 3153 this._emitCompleteOnItems( 'hide', items ); 3154 if ( !items || !items.length ) { 3155 return; 3156 } 3157 var stagger = this.updateStagger(); 3158 items.forEach( function( item, i ) { 3159 item.stagger( i * stagger ); 3160 item.hide(); 3161 }); 3162}; 3163 3164/** 3165 * reveal item elements 3166 * @param {Array}, {Element}, {NodeList} items 3167 */ 3168proto.revealItemElements = function( elems ) { 3169 var items = this.getItems( elems ); 3170 this.reveal( items ); 3171}; 3172 3173/** 3174 * hide item elements 3175 * @param {Array}, {Element}, {NodeList} items 3176 */ 3177proto.hideItemElements = function( elems ) { 3178 var items = this.getItems( elems ); 3179 this.hide( items ); 3180}; 3181 3182/** 3183 * get Outlayer.Item, given an Element 3184 * @param {Element} elem 3185 * @param {Function} callback 3186 * @returns {Outlayer.Item} item 3187 */ 3188proto.getItem = function( elem ) { 3189 // loop through items to get the one that matches 3190 for ( var i=0; i < this.items.length; i++ ) { 3191 var item = this.items[i]; 3192 if ( item.element == elem ) { 3193 // return item 3194 return item; 3195 } 3196 } 3197}; 3198 3199/** 3200 * get collection of Outlayer.Items, given Elements 3201 * @param {Array} elems 3202 * @returns {Array} items - Outlayer.Items 3203 */ 3204proto.getItems = function( elems ) { 3205 elems = utils.makeArray( elems ); 3206 var items = []; 3207 elems.forEach( function( elem ) { 3208 var item = this.getItem( elem ); 3209 if ( item ) { 3210 items.push( item ); 3211 } 3212 }, this ); 3213 3214 return items; 3215}; 3216 3217/** 3218 * remove element(s) from instance and DOM 3219 * @param {Array or NodeList or Element} elems 3220 */ 3221proto.remove = function( elems ) { 3222 var removeItems = this.getItems( elems ); 3223 3224 this._emitCompleteOnItems( 'remove', removeItems ); 3225 3226 // bail if no items to remove 3227 if ( !removeItems || !removeItems.length ) { 3228 return; 3229 } 3230 3231 removeItems.forEach( function( item ) { 3232 item.remove(); 3233 // remove item from collection 3234 utils.removeFrom( this.items, item ); 3235 }, this ); 3236}; 3237 3238// ----- destroy ----- // 3239 3240// remove and disable Outlayer instance 3241proto.destroy = function() { 3242 // clean up dynamic styles 3243 var style = this.element.style; 3244 style.height = ''; 3245 style.position = ''; 3246 style.width = ''; 3247 // destroy items 3248 this.items.forEach( function( item ) { 3249 item.destroy(); 3250 }); 3251 3252 this.unbindResize(); 3253 3254 var id = this.element.outlayerGUID; 3255 delete instances[ id ]; // remove reference to instance by id 3256 delete this.element.outlayerGUID; 3257 // remove data for jQuery 3258 if ( jQuery ) { 3259 jQuery.removeData( this.element, this.constructor.namespace ); 3260 } 3261 3262}; 3263 3264// -------------------------- data -------------------------- // 3265 3266/** 3267 * get Outlayer instance from element 3268 * @param {Element} elem 3269 * @returns {Outlayer} 3270 */ 3271Outlayer.data = function( elem ) { 3272 elem = utils.getQueryElement( elem ); 3273 var id = elem && elem.outlayerGUID; 3274 return id && instances[ id ]; 3275}; 3276 3277 3278// -------------------------- create Outlayer class -------------------------- // 3279 3280/** 3281 * create a layout class 3282 * @param {String} namespace 3283 */ 3284Outlayer.create = function( namespace, options ) { 3285 // sub-class Outlayer 3286 var Layout = subclass( Outlayer ); 3287 // apply new options and compatOptions 3288 Layout.defaults = utils.extend( {}, Outlayer.defaults ); 3289 utils.extend( Layout.defaults, options ); 3290 Layout.compatOptions = utils.extend( {}, Outlayer.compatOptions ); 3291 3292 Layout.namespace = namespace; 3293 3294 Layout.data = Outlayer.data; 3295 3296 // sub-class Item 3297 Layout.Item = subclass( Item ); 3298 3299 // -------------------------- declarative -------------------------- // 3300 3301 utils.htmlInit( Layout, namespace ); 3302 3303 // -------------------------- jQuery bridge -------------------------- // 3304 3305 // make into jQuery plugin 3306 if ( jQuery && jQuery.bridget ) { 3307 jQuery.bridget( namespace, Layout ); 3308 } 3309 3310 return Layout; 3311}; 3312 3313function subclass( Parent ) { 3314 function SubClass() { 3315 Parent.apply( this, arguments ); 3316 } 3317 3318 SubClass.prototype = Object.create( Parent.prototype ); 3319 SubClass.prototype.constructor = SubClass; 3320 3321 return SubClass; 3322} 3323 3324// ----- helpers ----- // 3325 3326// how many milliseconds are in each unit 3327var msUnits = { 3328 ms: 1, 3329 s: 1000 3330}; 3331 3332// munge time-like parameter into millisecond number 3333// '0.4s' -> 40 3334function getMilliseconds( time ) { 3335 if ( typeof time == 'number' ) { 3336 return time; 3337 } 3338 var matches = time.match( /(^\d*\.?\d*)(\w*)/ ); 3339 var num = matches && matches[1]; 3340 var unit = matches && matches[2]; 3341 if ( !num.length ) { 3342 return 0; 3343 } 3344 num = parseFloat( num ); 3345 var mult = msUnits[ unit ] || 1; 3346 return num * mult; 3347} 3348 3349// ----- fin ----- // 3350 3351// back in global 3352Outlayer.Item = Item; 3353 3354return Outlayer; 3355 3356})); 3357
3358 3359/***/ }) 3360 3361/******/ }); 3362/************************************************************************/ 3363/******/ // The module cache 3364/******/ var __webpack_module_cache__ = {}; 3365/******/ 3366/******/ // The require function 3367/******/ function __webpack_require__(moduleId) { 3368/******/ // Check if module is in cache 3369/******/ var cachedModule = __webpack_module_cache__[moduleId]; 3370/******/ if (cachedModule !== undefined) { 3371/******/ return cachedModule.exports; 3372/******/ } 3373/******/ // Create a new module (and put it into the cache) 3374/******/ var module = __webpack_module_cache__[moduleId] = { 3375/******/ // no module.id needed 3376/******/ // no module.loaded needed 3377/******/ exports: {} 3378/******/ }; 3379/******/ 3380/******/ // Execute the module function 3381/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 3382/******/ 3383/******/ // Return the exports of the module 3384/******/ return module.exports; 3385/******/ } 3386/******/ 3387/************************************************************************/ 3388/******/ /* webpack/runtime/compat get default export */ 3389/******/ (() => { 3390/******/ // getDefaultExport function for compatibility with non-harmony modules 3391/******/ __webpack_require__.n = (module) => { 3392/******/ var getter = module && module.__esModule ? 3393/******/ () => (module['default']) : 3394/******/ () => (module); 3395/******/ __webpack_require__.d(getter, { a: getter }); 3396/******/ return getter; 3397/******/ }; 3398/******/ })(); 3399/******/ 3400/******/ /* webpack/runtime/define property getters */ 3401/******/ (() => { 3402/******/ // define getter functions for harmony exports 3403/******/ __webpack_require__.d = (exports, definition) => { 3404/******/ for(var key in definition) { 3405/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 3406/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 3407/******/ } 3408/******/ } 3409/******/ }; 3410/******/ })(); 3411/******/ 3412/******/ /* webpack/runtime/hasOwnProperty shorthand */ 3413/******/ (() => { 3414/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 3415/******/ })(); 3416/******/ 3417/************************************************************************/ 3418var __webpack_exports__ = {}; 3419// This entry need to be wrapped in an IIFE because it need to be in strict mode. 3420(() => { 3421"use strict"; 3422 3423;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js 3424function _defineProperty(obj, key, value) { 3425 if (key in obj) { 3426 Object.defineProperty(obj, key, { 3427 value: value, 3428 enumerable: true, 3429 configurable: true, 3430 writable: true 3431 }); 3432 } else { 3433 obj[key] = value; 3434 } 3435 3436 return obj; 3437} 3438// EXTERNAL MODULE: ./node_modules/isotope-layout/js/isotope.js 3439var isotope = __webpack_require__(3391); 3440var isotope_default = /*#__PURE__*/__webpack_require__.n(isotope); 3441;// CONCATENATED MODULE: ./src/js/modules/isotope.js 3442function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);enumerableOnly && (symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;})), keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = null != arguments[i] ? arguments[i] : {};i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {_defineProperty(target, key, source[key]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}return target;} 3443 3444 3445 3446function initIsotope(selector, filterSelector, options) { 3447 var container = document.querySelector(selector); 3448 if (container) { 3449 var isotopeInstance = new (isotope_default())(selector, _objectSpread({}, 3450 options)); 3451 3452 3453 var filterItems = document.querySelectorAll(filterSelector);
3454 filterItems.forEach(function (item) { 3455 item.addEventListener('click', function () { 3456 for (var i = 0; i < filterItems.length; i++) { 3457 filterItems[i].classList.remove('current'); 3458 } 3459 this.classList.add('current'); 3460 var filterBy = item.dataset.filter; 3461 isotopeInstance.arrange({ filter: filterBy }); 3462 }); 3463 }); 3464 3465 if (selector === '.questions') { 3466 isotopeInstance.on('layoutComplete', function () { 3467 var filteredElems = isotopeInstance.getFilteredItemElements(); 3468 for (var i = 0; i < filteredElems.length; i++) { 3469 i === filteredElems.length - 1 ? filteredElems[i].style.borderColor = 'transparent' : filteredElems[i].style.borderColor = '#d8d8d8'; 3470 } 3471 }); 3472 } 3473 3474 window.addEventListener('resize', function () {return isotopeInstance.layout();}); 3475 } 3476} 3477;// CONCATENATED MODULE: ./src/js/blog.js 3478 3479 3480 3481 3482document.addEventListener('DOMContentLoaded', function () { 3483 initIsotope('.blog_posts--sortable', '.blog_panel-filters_filter', { 3484 layoutMode: 'fitRows' }); 3485 3486}); 3487})(); 3488 3489/******/ })() 3490;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.