Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

script.js 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. jQuery(function ($) {
  2. "use strict";
  3. /* ========================================================================= */
  4. /* Page Preloader
  5. /* ========================================================================= */
  6. $(window).on('load', function () {
  7. $('.preloader').fadeOut(100);
  8. });
  9. /* ========================================================================= */
  10. /* Magnific popup
  11. /* ========================================================================= */
  12. $('.image-popup').magnificPopup({
  13. type: 'image',
  14. removalDelay: 160, //delay removal by X to allow out-animation
  15. callbacks: {
  16. beforeOpen: function () {
  17. // just a hack that adds mfp-anim class to markup
  18. this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
  19. this.st.mainClass = this.st.el.attr('data-effect');
  20. }
  21. },
  22. closeOnContentClick: true,
  23. midClick: true,
  24. fixedContentPos: false,
  25. fixedBgPos: true
  26. });
  27. /* ========================================================================= */
  28. /* Portfolio Filtering Hook
  29. /* ========================================================================= */
  30. var containerEl = document.querySelector('.shuffle-wrapper');
  31. if (containerEl) {
  32. var Shuffle = window.Shuffle;
  33. var myShuffle = new Shuffle(document.querySelector('.shuffle-wrapper'), {
  34. itemSelector: '.shuffle-item',
  35. buffer: 1
  36. });
  37. jQuery('input[name="shuffle-filter"]').on('change', function (evt) {
  38. var input = evt.currentTarget;
  39. if (input.checked) {
  40. myShuffle.filter(input.value);
  41. }
  42. });
  43. }
  44. /* ========================================================================= */
  45. /* Testimonial Carousel
  46. /* ========================================================================= */
  47. $("#testimonials").slick({
  48. infinite: true,
  49. arrows: false,
  50. autoplay: true,
  51. autoplaySpeed: 4000
  52. });
  53. /* ========================================================================= */
  54. /* Animated section
  55. /* ========================================================================= */
  56. var wow = new WOW({
  57. offset: 100, // distance to the element when triggering the animation (default is 0)
  58. mobile: false // trigger animations on mobile devices (default is true)
  59. });
  60. var scrolled = false;
  61. $(window).on('scroll', function () {
  62. if (!scrolled) {
  63. scrolled = true;
  64. wow.init();
  65. }
  66. })
  67. /* ========================================================================= */
  68. /* animation scroll js
  69. /* ========================================================================= */
  70. var html_body = $('html, body');
  71. $('nav a, .page-scroll').on('click', function () { //use page-scroll class in any HTML tag for scrolling
  72. if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') && location.hostname === this.hostname) {
  73. var target = $(this.hash);
  74. target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
  75. if (target.length) {
  76. html_body.animate({
  77. scrollTop: target.offset().top - 70
  78. }, 1500, 'easeInOutExpo');
  79. return false;
  80. }
  81. }
  82. });
  83. // easeInOutExpo Declaration
  84. jQuery.extend(jQuery.easing, {
  85. easeInOutExpo: function (x, t, b, c, d) {
  86. if (t === 0) {
  87. return b;
  88. }
  89. if (t === d) {
  90. return b + c;
  91. }
  92. if ((t /= d / 2) < 1) {
  93. return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
  94. }
  95. return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
  96. }
  97. });
  98. /* ========================================================================= */
  99. /* counter up
  100. /* ========================================================================= */
  101. function counter() {
  102. var oTop;
  103. if ($('.count').length !== 0) {
  104. oTop = $('.count').offset().top - window.innerHeight;
  105. }
  106. if ($(window).scrollTop() > oTop) {
  107. $('.count').each(function () {
  108. var $this = $(this),
  109. countTo = $this.attr('data-count');
  110. $({
  111. countNum: $this.text()
  112. }).animate({
  113. countNum: countTo
  114. }, {
  115. duration: 1000,
  116. easing: 'swing',
  117. step: function () {
  118. $this.text(Math.floor(this.countNum));
  119. },
  120. complete: function () {
  121. $this.text(this.countNum);
  122. }
  123. });
  124. });
  125. }
  126. }
  127. $(window).on('scroll', function () {
  128. counter();
  129. });
  130. /* ========================================================================= */
  131. /* Google Map Customization
  132. /* ========================================================================= */
  133. function initialize() {
  134. var latitude = $('#map-canvas').attr('data-latitude');
  135. var longitude = $('#map-canvas').attr('data-longitude');
  136. var myLatLng = new google.maps.LatLng(latitude, longitude);
  137. var roadAtlasStyles = [{
  138. "featureType": "landscape",
  139. "elementType": "geometry.fill",
  140. "stylers": [{
  141. "color": "#2F3238"
  142. }]
  143. }, {
  144. "elementType": "labels.text.fill",
  145. "stylers": [{
  146. "color": "#FFFFFF"
  147. }]
  148. }, {
  149. "elementType": "labels.text.stroke",
  150. "stylers": [{
  151. "visibility": "off"
  152. }]
  153. }, {
  154. "featureType": "road",
  155. "elementType": "geometry.fill",
  156. "stylers": [{
  157. "color": "#50525f"
  158. }]
  159. }, {
  160. "featureType": "road",
  161. "elementType": "geometry.stroke",
  162. "stylers": [{
  163. "visibility": "on"
  164. }, {
  165. "color": "#808080"
  166. }]
  167. }, {
  168. "featureType": "poi",
  169. "elementType": "labels",
  170. "stylers": [{
  171. "visibility": "off"
  172. }]
  173. }, {
  174. "featureType": "transit",
  175. "elementType": "labels.icon",
  176. "stylers": [{
  177. "visibility": "off"
  178. }]
  179. }, {
  180. "featureType": "poi",
  181. "elementType": "geometry",
  182. "stylers": [{
  183. "color": "#808080"
  184. }]
  185. }, {
  186. "featureType": "water",
  187. "elementType": "geometry.fill",
  188. "stylers": [{
  189. "color": "#3071a7"
  190. }, {
  191. "saturation": -65
  192. }]
  193. }, {
  194. "featureType": "road",
  195. "elementType": "labels.icon",
  196. "stylers": [{
  197. "visibility": "off"
  198. }]
  199. }, {
  200. "featureType": "landscape",
  201. "elementType": "geometry.stroke",
  202. "stylers": [{
  203. "color": "#bbbbbb"
  204. }]
  205. }];
  206. var mapOptions = {
  207. zoom: 14,
  208. center: myLatLng,
  209. disableDefaultUI: true,
  210. scrollwheel: false,
  211. navigationControl: false,
  212. mapTypeControl: false,
  213. scaleControl: false,
  214. draggable: false,
  215. mapTypeControlOptions: {
  216. mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'roadatlas']
  217. }
  218. };
  219. var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
  220. var marker = new google.maps.Marker({
  221. position: myLatLng,
  222. map: map,
  223. title: '',
  224. });
  225. google.maps.event.addListener(marker, 'click', function () {
  226. infowindow.open(map, marker);
  227. });
  228. var styledMapOptions = {
  229. name: 'US Road Atlas'
  230. };
  231. var usRoadMapType = new google.maps.StyledMapType(
  232. roadAtlasStyles, styledMapOptions);
  233. map.mapTypes.set('roadatlas', usRoadMapType);
  234. map.setMapTypeId('roadatlas');
  235. }
  236. google.maps.event.addDomListener(window, "load", initialize)
  237. });