/** * * Go Gallery * 1.0 * Responsive filterable gallery plugin with media categories. Shortcode driven, easy to use, lightweight yet powerful. Display beautiful galleries without slowing down your page load. * https://ampae.com/go-gallery/ * V Bugroff * bugroff@protonmail.com * M Karodine * usr04@protonmail.com * Tim de Jong * AlViMedia * support@alvimedia.com * AMPAE * info@ampae.com * * THIS CODE ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR * A PARTICULAR PURPOSE. * * 2019-04-08 * * Main Styles for Go Gallery; * * **/ (function($){ var Gallery = { init: function(){ $('.go-gallery').each(function(){ new Gallery.Instance(this); }); }, Instance: function(element){ var instance = this; this.container = $(element); this.id = this.container.attr('id'); this.menuColor = this.container.data('menu-color'); this.menuBg = this.container.data('menu-bg'); this.menuBgHover = this.container.data('menu-bg-hover'); this.menuGap = this.container.data('menu-gap'); this.bg = this.container.data('bg'); this.gap = this.container.data('gap'); this.borderSize = this.container.data('border-size'); this.borderColor = this.container.data('border-color'); this.descColor = this.container.data('desc-color'); this.descShadow = this.container.data('desc-shadow'); this.filters = this.container.find('ul.go-gallery-filters'); this.list = this.container.find('ul.go-gallery-list'); this.items = $('li', this.container); this.win = $(window); this.init = function(){ this.prepareStyle(); this.list.isotope({ itemSelector: '.go-gallery-item', layoutMode: 'masonry' }); this.filters.find('a').on('click', this.filter.bind(this)); if(this.container.hasClass('style-squared')){ var item, figure, image; this.items.each(function(){ item = $(this); image = $('
').addClass('image').css('background-image', 'url(' + item.find('img').attr('src') + ')'); item.find('figure').append(image); }); } }; this.loadImage = function(source, callback){ var image = new Image(); image.onload = callback; image.src = source; }; this.filter = function(event){ event.stopPropagation(); var link = $(event.target); var category = link.data('filter'); if(category != ''){ this.list.isotope({filter: '.category-' + category.toLowerCase()}); }else{ this.list.isotope({filter: ''}); } return false; }; this.prepareStyle = function(){ var style = $('