$(function () { $('.swiper-row').find('.layer.bg').each(function (e) { var layer_bg = $(this); var layer_bg_src = $(this).attr('data-src'); if (layer_bg_src) { $('body').append('
'); layer_bg.hide(); $('#tempLoader-' + e).imageLoader({ images: [{ src: layer_bg_src }], enableSplashScreenImage: 0, enableSplashScreenText: 0 }, function () { layer_bg.fadeIn(); $('#tempLoader-' + e).remove(); }); } }); function homeSwiper() { if ($('div.portfoliobanner').length) { winW = $(window).width(); $('.js-completed-projects-prev, .js-completed-projects-next').hide(); var completedSwiper = $('.completed-projects-swiper').swiper({ mode: 'horizontal', loop: false, keyboardControl: false, slidesPerView: 'auto' }); if ((completedSwiper.slides[completedSwiper.activeIndex].clientWidth) * completedSwiper.slides.length > completedSwiper.width) { $('.js-completed-projects-prev, .js-completed-projects-next').fadeIn(); $('.js-completed-projects-prev').click(function () { completedSwiper.swipePrev(); }); $('.js-completed-projects-next').click(function () { completedSwiper.swipeNext(); }); } $('.js-current-projects-prev, .js-current-projects-next').hide(); var currentSwiper = $('.current-projects-swiper').swiper({ mode: 'horizontal', loop: false, keyboardControl: false, slidesPerView: 'auto' }); if ((currentSwiper.slides[currentSwiper.activeIndex].clientWidth) * currentSwiper.slides.length > currentSwiper.width) { $('.js-current-projects-prev, .js-current-projects-next').fadeIn(); $('.js-current-projects-prev').click(function () { currentSwiper.swipePrev(); }); $('.js-current-projects-next').click(function () { currentSwiper.swipeNext(); }); } $('.js-future-projects-prev, .js-future-projects-next').hide(); var futuretSwiper = $('.future-projects-swiper').swiper({ mode: 'horizontal', loop: false, keyboardControl: true, slidesPerView: 'auto' }); if ((futuretSwiper.slides[futuretSwiper.activeIndex].clientWidth) * futuretSwiper.slides.length > futuretSwiper.width) { $('.js-future-projects-prev, .js-future-projects-next').fadeIn(); $('.js-future-projects-prev').click(function () { futuretSwiper.swipePrev(); }); $('.js-future-projects-next').click(function () { futuretSwiper.swipeNext(); }); } } } $('.investment-slider').each(function (e) { $(this).setGallerySwiper(e); }); $('.gallery-slider').each(function (e) { $(this).setGallerySwiper(e); }); function elemFadeToggle() { $('[data-fade-toggle]').on('click', function (event) { event.preventDefault(); $target = $($(this).data('fade-toggle')); $target.fadeToggle(); }); } elemFadeToggle(); $('.js-close-newsletter').click(function (e) { e.preventDefault(); $('.newsletter-content').fadeOut(); }); function accordion() { $('.accordion h3').click(function () { $(this).parent('li').find('.accordion-content').slideToggle(); $(this).parent('li').toggleClass('opened'); }); } accordion(); if ($('#map').length) { // google maps var map; function initialize() { var mapOptions = { zoom: 12, scrollwheel: false, center: new google.maps.LatLng(54.242159, 16.067076), mapTypeId: google.maps.MapTypeId.MAP, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL } }; var map = new google.maps.Map(document.getElementById('map'), mapOptions); // var image = ''; //var myLatLng = new google.maps.LatLng(54.162818,16.056808); var biuro = new google.maps.LatLng(54.259896, 16.056824); var markerBiuro = new google.maps.Marker({ position: biuro, map: map, title: 'Biuro Sprzedaży Firmus', animation: google.maps.Animation.DROP }); var biuroLabel = document.createElement("div"); biuroLabel.style.cssText = "margin-top: 15px; background: #fff; padding: 10px 5px; font-size: 13px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.5);"; biuroLabel.innerHTML = "Biuro Sprzedaży"; var infoboxOptions = { content: biuroLabel, disableAutoPan: false, maxWidth: 0, pixelOffset: new google.maps.Size(-65, 0), zIndex: null, boxStyle: { width: "130px" }, closeBoxURL: "", infoBoxClearance: new google.maps.Size(1, 1), isHidden: false, pane: "floatPane", enableEventPropagation: false }; var glowna = new google.maps.LatLng(54.218899, 16.089284); var markerGlowna = new google.maps.Marker({ position: glowna, map: map, title: 'Siedziba Główna' }); var glownaLabel = document.createElement("div"); glownaLabel.style.cssText = "margin-top: 15px; background: #fff; padding: 10px 5px; font-size: 13px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.5);"; glownaLabel.innerHTML = "Siedziba Główna"; var infoboxOptions2 = { content: glownaLabel, disableAutoPan: false, maxWidth: 0, pixelOffset: new google.maps.Size(-65, 0), zIndex: null, boxStyle: { width: "130px" }, closeBoxURL: "", infoBoxClearance: new google.maps.Size(1, 1), isHidden: false, pane: "floatPane", enableEventPropagation: false }; var ib = new InfoBox(infoboxOptions); ib.open(map, markerBiuro); var ib2 = new InfoBox(infoboxOptions2); ib2.open(map, markerGlowna); } google.maps.event.addDomListener(window, 'load', initialize); } $(window).resize(function () { homeSwiper(); }).trigger('resize'); }); function setSpinner(element) { var opts = { lines: 7, // The number of lines to draw length: 0, // The length of each line width: 4, // The line thickness radius: 12, // The radius of the inner circle color: '#33455d', // #rgb or #rrggbb speed: 1.4, // Rounds per second trail: 37, // Afterglow percentage shadow: false // Whether to render a shadow }; var target = document.getElementById(element); var spinner = new Spinner(opts).spin(target); } $.fn.setGallerySwiper = function (e) { var gallery = $(this); var gallery_wrapper = gallery.find('.swiper-wrapper'); var gallery_next = gallery.find('.js-gallery-next'); var gallery_prev = gallery.find('.js-gallery-prev'); var element_to_swipe = $(this).find('.swiper-container'); var img_array = new Array(); $('body').append(''); element_to_swipe.hide(); gallery_next.hide(); gallery_prev.hide(); gallery.prepend('