(function($) { "use strict"; // Start of use strict // Body opacity // $(document).ready(function() { // $("body").css("opacity", "1"); // }); // Smooth scrolling using jQuery easing $('a.js-scroll-trigger[href*="#"]:not([href="#"])').click(function() { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); if (target.length) { $('html, body').animate({ scrollTop: (target.offset().top - 57) }, 1000, "easeInOutExpo"); return false; } } }); // Closes responsive menu when a scroll trigger link is clicked $('.js-scroll-trigger').click(function() { $('.navbar-collapse').collapse('hide'); }); // Activate scrollspy to add active class to navbar items on scroll $('body').scrollspy({ target: '#mainNav', offset: 57 }); // Collapse Navbar var navbarCollapse = function() { if ($("#mainNav").offset().top > 100) { $("#mainNav").addClass("navbar-shrink"); } else { $("#mainNav").removeClass("navbar-shrink"); } }; // Collapse now if page is not at top navbarCollapse(); // Collapse the navbar when page is scrolled $(window).scroll(navbarCollapse); // Scroll reveal calls $(document).ready(function() { window.sr = ScrollReveal(); sr.reveal('.decagon-menu-container .decagon-menu-link', { duration: 1400, scale: 0.9, origin: 'bottom', distance: '5px', }, 400); sr.reveal('.home .section-header h1', { duration: 500, delay: 0, scale: 0.9, origin: 'bottom', distance: '5px', }, 0); sr.reveal('.home .section-header .tagline', { duration: 750, delay: 500, scale: 0.9, origin: 'bottom', distance: '5px', }, 0); sr.reveal('.home .heading-globe-animation', { duration: 5500, delay: 100, scale: 1, origin: 'center', // distance: '5px', }, 1500); }); // Home decagon animations $('.decagon-menu-container > div:nth-child(odd)').hover( function(){ $('.decagon-col svg').toggleClass('rotate'); } ); $('.decagon-menu-container > div:nth-child(even)').hover( function(){ $('.decagon-col svg').toggleClass('rotate-invert'); } ); // Owl Carousel initiation $(document).ready(function(){ $(".owl-carousel").owlCarousel({ nav: true, navText: ["",""], center: false, items:1, loop:true, margin:2, responsive:{ 600:{ nav: true, items:4 } }, autoplay:true, autoplayTimeout:3000, autoplayHoverPause:false, }); }); // Google map $(document).ready(function(){ // Define your locations: HTML content for the info window, latitude, longitude var locations = [ ['

Warszawa

MIEJSCE SPOTKAŃ

', 52.222176, 21.014643, 1], ['

Łódź

SIEDZIBA GŁÓWNA

', 51.758561, 19.462974, 2], ]; // Setup the different icons and shadows var iconURL = 'https://cgolegal.pl/wp-content/themes/cgo_ts/assets/img/map-point.png'; var icons = [ iconURL, ] var iconsLength = icons.length; var map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 9, center: new google.maps.LatLng( 52.112834, 19.364091 ), mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeControl: false, streetViewControl: false, panControl: false, gestureHandling: 'greedy', scrollwheel: false, zoomControl: true, zoomControlOptions: { position: google.maps.ControlPosition.RIGHT_BOTTOM }, styles: [ { "featureType": "water", "elementType": "geometry", "stylers": [ { "color": "#e9e9e9" }, { "lightness": 17 } ] }, { "featureType": "landscape", "elementType": "geometry", "stylers": [ { "color": "#f5f5f5" }, { "lightness": 20 } ] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [ { "color": "#ffffff" }, { "lightness": 17 } ] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [ { "color": "#ffffff" }, { "lightness": 29 }, { "weight": 0.2 } ] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [ { "color": "#ffffff" }, { "lightness": 18 } ] }, { "featureType": "road.local", "elementType": "geometry", "stylers": [ { "color": "#ffffff" }, { "lightness": 16 } ] }, { "featureType": "poi", "elementType": "geometry", "stylers": [ { "color": "#f5f5f5" }, { "lightness": 21 } ] }, { "featureType": "poi.park", "elementType": "geometry", "stylers": [ { "color": "#dedede" }, { "lightness": 21 } ] }, { "elementType": "labels.text.stroke", "stylers": [ { "visibility": "on" }, { "color": "#ffffff" }, { "lightness": 16 } ] }, { "elementType": "labels.text.fill", "stylers": [ { "saturation": 36 }, { "color": "#333333" }, { "lightness": 40 } ] }, { "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "transit", "elementType": "geometry", "stylers": [ { "color": "#f2f2f2" }, { "lightness": 19 } ] }, { "featureType": "administrative", "elementType": "geometry.fill", "stylers": [ { "color": "#fefefe" }, { "lightness": 20 } ] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [ { "color": "#fefefe" }, { "lightness": 17 }, { "weight": 1.2 } ] } ] }); var infowindow = new google.maps.InfoWindow({ maxWidth: 160 }); var markers = new Array(); var iconCounter = 0; // Add the markers and infowindows to the map for (var i = 0; i < locations.length; i++) { var marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: icons[iconCounter] }); markers.push(marker); // Google marker on click tooltip // google.maps.event.addListener(marker, 'click', (function(marker, i) { // return function() { // infowindow.setContent(locations[i][0]); // infowindow.open(map, marker); // } // })(marker, i)); iconCounter++; // We only have a limited number of possible icon colors, so we may have to restart the counter if(iconCounter >= iconsLength) { iconCounter = 0; } } }); // Page menu // $(document).ready(function(){ // // $('.page-menu-tab').each(function (i) { // $(this).addClass('page-menu-' + i); // }); // $('.page-menu-content').each(function (i) { // $(this).addClass('page-menu-' + i); // }); // // $(".page-menu-tab a").click(function(e) { // e.preventDefault(); // $(".page-menu-content").slideToggle('slow'); // return false; // }); // // }); // Zespol - slider // if($('body').is('.zespol')){ // // $(document).ready(function(){ // var main = $('.zespol-grid-main'), // index = $('.zespol-grid-index'), // figure = index.find('.zespol-grid-box'), // overflow, resized, placed = 0, // middle = main.width()/2, // figure_width = figure.width(), // num_figures = figure.length, // num_row_figures = Math.ceil(num_figures/2), // // row_width = figure_width*num_row_figures, // row_width = 2500, // momentum = typeof($('body')[0].style['-webkit-overflow-scrolling']) != 'undefined'; // // index.width(row_width); // // if (!momentum) { // main.css('overflow', 'hidden'); // index.drag(); // setDimensions(); // $(window).on('mouseup touchend', getOffset).resize(setDimensions); // $('body').mouseleave(getOffset); // } // // function setDimensions() { // // clearTimeout(resized); // // var inner = main.width()/2; // overflow = Math.max(0, row_width-2*inner); // var parent_width = row_width+overflow; // // $('.zespol-grid-container').css({width: parent_width, left: -overflow}); // // resized = setTimeout(function() { // var seat = Math.min(overflow, Math.max(0, overflow-placed+inner-middle)); // index.css('left', seat); // getOffset(); // middle = inner; // }, 50); // } // // function getOffset() {placed = overflow-index.position().left} // }); // // (function($) {$.fn.drag = function() { // // var object = this, limit = this.parent(), now, swipe, // press = 'mousedown touchstart', // move = 'mousemove touchmove', // release = 'mouseup touchend'; // // if (window.requestAnimationFrame) var neoteric = true; // // this.on(press, function(e) { // // if (e.type == 'mousedown' && e.which != 1) return; // // var margin = limit.width()-object.outerWidth(), // old = object.position().left, // touch = e.originalEvent.touches, // start = touch ? touch[0].pageX : e.pageX; // // $(window).on(move, function(e) { // // var contact = e.originalEvent.touches, // end = contact ? contact[0].pageX : e.pageX; // now = Math.max(0, Math.min(old+end-start, margin)); // // if (Math.abs(end-start) > 30) swipe = true; // // if (neoteric) requestAnimationFrame(setElement); // else setElement(); // }) // .one(release, function(e) { // e.preventDefault(); // swipe = false; // $(this).off(move).off(release); // }); // // e.preventDefault(); // }) // .find('a').on(press, function() { // // var destination = $(this).attr('href'); // // $(this).one(release, function() { // if (destination && !swipe) window.location = destination; // $(this).off(release); // }); // // }).click(function() {return false}); // // $('body').mouseleave(function() { // swipe = false; // $(window).off(move).off(release); // }); // // return this; // // function setElement() { // // object.css('left', now); // } // };}(jQuery)); // // } // Zespol auto-slide animation // $(document).ready(function(){ // $('.zespol-grid-main').animate( { scrollLeft: '100' }, 20000); // }); // Open tabs from url hash $(document).ready(function(){ //grabs the hash tag from the url var hash = window.location.hash; //checks whether or not the hash tag is set if (hash != "") { //removes all active classes from tabs $('.nav-tabs li a').each(function() { $(this).removeClass('active'); }); $('.tab-content div').each(function() { $(this).removeClass('active'); }); //this will add the active class on the hashtagged value var link = ""; $('.nav-tabs li a').each(function() { link = $(this).attr('href'); if (link == hash) { $(this).addClass('active'); } }); $('.tab-content div').each(function() { link = $(this).attr('id'); if ('#'+link == hash) { $(this).addClass('active'); } }); } }); // O grupie - auto scroll to tabs $(document).ready(function(){ var hash1 = '#tab1'; if (window.location.hash == hash1) { $('html, body').animate({ scrollTop: $("#section-tabs").offset().top }, 1500); } var hash2 = '#tab2'; if (window.location.hash == hash2) { $('html, body').animate({ scrollTop: $("#section-tabs").offset().top }, 1500); } var hash3 = '#tab3'; if (window.location.hash == hash3) { $('html, body').animate({ scrollTop: $("#section-tabs").offset().top }, 1500); } var hash4 = '#tab4'; if (window.location.hash == hash4) { $('html, body').animate({ scrollTop: $("#section-tabs").offset().top }, 1500); } var hash5 = '#tab5'; if (window.location.hash == hash5) { $('html, body').animate({ scrollTop: $("#section-tabs").offset().top }, 1500); } }); // Accounting - Cennik tabs $(document).ready(function(){ $('select.select-tabs').on('change', function () { $(':selected', this).tab('show'); }); }); // Show Menu after scrolled $(document).scroll(function() { var y = $(this).scrollTop(); if (y > 300) { $('.navScroll').fadeIn(); $('.navScroll').addClass('active'); } else { $('.navScroll').fadeOut(); $('.navScroll').removeClass('active'); } }); })(jQuery); // End of use strict