app.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991
  1. var GPTHEME = GPTHEME || {};
  2. (function ($) {
  3. /*!----------------------------------------------
  4. # This beautiful code written with heart
  5. # by Mominul Islam <hello@mominul.me>
  6. # In Dhaka, BD at the GpTheme workstation.
  7. ---------------------------------------------*/
  8. // USE STRICT
  9. "use strict";
  10. window.Gp = {
  11. init: function () {
  12. // Header
  13. this.header = $('.site-header');
  14. this.body = $('body');
  15. this.headerFixed = {
  16. initialOffset: parseInt(this.header.attr('data-fixed-initial-offset')) || 100,
  17. enabled: $('[data-header-fixed]').length,
  18. value: false,
  19. mobileEnabled: $('[data-mobile-header-fixed]').length,
  20. mobileValue: false
  21. };
  22. // Menus
  23. this.megaMenu = this.header.find('#mega-menu-wrap');
  24. this.mobileMenu = $('[data-mobile-menu-resolution]').data('mobile-menu-resolution');
  25. this.resize();
  26. },
  27. resize: function () {
  28. this.isDesktop = $(window).width() >= 991;
  29. this.isMobile = $(window).width() <= 991;
  30. this.isPad = $(window).width() <= 1024;
  31. this.isMobileMenu = $(window).width() <= Gp.mobileMenu;
  32. }
  33. };
  34. GPTHEME.initialize = {
  35. init: function () {
  36. GPTHEME.initialize.general();
  37. GPTHEME.initialize.swiperSlider();
  38. GPTHEME.initialize.sectionBackground();
  39. GPTHEME.initialize.portfolio();
  40. GPTHEME.initialize.sectionSwitch();
  41. GPTHEME.initialize.countUp();
  42. GPTHEME.initialize.countDown();
  43. GPTHEME.initialize.tab();
  44. GPTHEME.initialize.googleMap();
  45. GPTHEME.initialize.footer();
  46. GPTHEME.initialize.contactFrom();
  47. },
  48. /*========================================================*/
  49. /*= Collection of snippet and tweaks =*/
  50. /*========================================================*/
  51. general: function () {
  52. // Mouse Move Parallax Element
  53. var $scene = $('.parallax-element').parallax({
  54. scalarX: 100,
  55. scalarY: 100,
  56. });
  57. var svgContainer = document.getElementById('svgContainer');
  58. var animItem = bodymovin.loadAnimation({
  59. wrapper: svgContainer,
  60. animType: 'svg',
  61. loop: true,
  62. path: 'assets/js/data.json'
  63. });
  64. if ($('.astriol__blog-filter').length > 0) {
  65. $('.astriol__blog-filter').append('<li class="indicator"></li>');
  66. if ($('.astriol__blog-filter li a').hasClass('isActive')) {
  67. var cLeft = $('.astriol__blog-filter li a.isActive').position().left + 'px',
  68. cWidth = $('.astriol__blog-filter li a.isActive').css('width');
  69. $('.indicator').css({
  70. left: cLeft,
  71. width: cWidth
  72. })
  73. }
  74. $('.astriol__blog-filter li a').on('click', function () {
  75. $('.astriol__blog-filter li a').removeClass('isActive');
  76. $(this).addClass('isActive');
  77. var cLeft = $('.astriol__blog-filter li a.isActive').position().left + 'px',
  78. cWidth = $('.astriol__blog-filter li a.isActive').css('width');
  79. $('.indicator').css({
  80. left: cLeft,
  81. width: cWidth
  82. })
  83. });
  84. }
  85. // $(".banner-title").lettering();
  86. $(document).ready(function () {
  87. animation();
  88. }, 1000);
  89. function animation() {
  90. var title1 = new TimelineMax();
  91. title1.staggerFromTo(".banner-title span", 0.5, {
  92. ease: Back.easeOut.config(1.7),
  93. opacity: 0,
  94. bottom: -80
  95. }, {
  96. ease: Back.easeOut.config(1.7),
  97. opacity: 1,
  98. bottom: 0
  99. }, 0.05);
  100. }
  101. $('.marquee-wrap').marquee({
  102. speed: 50, // this echos 20
  103. gap: 30,
  104. delayBeforeStart: 0,
  105. direction: 'left',
  106. duplicated: true,
  107. startVisible: true
  108. });
  109. var $body = $('body');
  110. var $popup = $('.canvas-menu-wrapper');
  111. $("#mobile-menu-open").on('click', function (e) {
  112. e.preventDefault();
  113. var mask = '<div class="mask-overlay">';
  114. $(mask).hide().appendTo('body').fadeIn('fast');
  115. $popup.addClass('open');
  116. $(this).addClass('active');
  117. $body.addClass('page-popup-open');
  118. $("html").addClass("no-scroll sidebar-open").height(window.innerHeight + "px");
  119. });
  120. $(".close-menu, .mask-overlay").on('click', function (e) {
  121. e.preventDefault();
  122. $('.mask-overlay').remove();
  123. $body.removeClass('page-popup-open');
  124. $popup.removeClass('open');
  125. $('.sub-menu, .sub-menu-wide').removeAttr('style');
  126. $("html").removeClass("no-scroll sidebar-open").height("auto");
  127. $("#mobile-menu-open").removeClass('active');
  128. $('.has-submenu .menu-link').removeClass('active');
  129. });
  130. /* Magnefic Popup */
  131. $('.popup-video').each(function () {
  132. $('.popup-video').magnificPopup({
  133. type: 'iframe'
  134. });
  135. });
  136. $('.jarallax').jarallax({
  137. speed: 0.2
  138. });
  139. $('.popup-image').magnificPopup({
  140. type: 'image',
  141. midClick: true,
  142. });
  143. /* Active Menu */
  144. $('.astriol-main-menu li > a').each(function () {
  145. if ($(this).attr('href') == location.href.split("/").slice(-1)) {
  146. $(this).addClass('current-menu-item');
  147. }
  148. });
  149. $(window).scroll(function (event) {
  150. var scrollPos = $(this).scrollTop();
  151. $('.call-to-action-creative').each(function () {
  152. var $el = $('.call-to-action-creative');
  153. var elPosRelToWindow = $el.offset().top - $(window).scrollTop();
  154. var inView = ((elPosRelToWindow > 0) && (elPosRelToWindow < $(window).height() - 250));
  155. $('#debug').html('elPosRelToWindow = ' + elPosRelToWindow + '<br>inView = ' + inView);
  156. $el.toggleClass('highlighter', inView);
  157. $('body').toggleClass('highlighter-hidden', inView);
  158. });
  159. });
  160. },
  161. /*===========================================*/
  162. /*= handle Mobile Header =*/
  163. /*===========================================*/
  164. handleMobileHeader: function () {
  165. if (Gp.header && Gp.header.length) {
  166. if (Gp.isMobileMenu) {
  167. Gp.header.addClass('mobile-header');
  168. Gp.body.addClass('is-mobile-menu');
  169. setTimeout(function () {
  170. $('.main-nav').addClass('unhidden');
  171. }, 300);
  172. } else {
  173. Gp.header.removeClass('mobile-header');
  174. Gp.body.removeClass('is-mobile-menu');
  175. $('.main-nav').addClass('visible');
  176. }
  177. }
  178. },
  179. /*==========================================*/
  180. /*= Handle Fixed Header =*/
  181. /*==========================================*/
  182. handleFixedHeader: function () {
  183. var fixed = Gp.headerFixed;
  184. if ($(document).scrollTop() > fixed.initialOffset) {
  185. if ((!Gp.isMobileMenu && fixed.enabled && !fixed.value) ||
  186. (Gp.isMobileMenu && fixed.mobileEnabled && !fixed.mobileValue)) {
  187. if (Gp.isMobileMenu) {
  188. fixed.mobileValue = true;
  189. } else {
  190. fixed.value = true;
  191. }
  192. Gp.header.addClass('header-fixed no-transition');
  193. }
  194. } else if (fixed.value || fixed.mobileValue) {
  195. fixed.value = false;
  196. fixed.mobileValue = false;
  197. Gp.header.removeClass('header-fixed');
  198. }
  199. // Effect appearance
  200. if ($(document).scrollTop() > fixed.initialOffset + 50) {
  201. Gp.header.removeClass('no-transition').addClass('showed');
  202. } else {
  203. Gp.header.removeClass('showed').addClass('no-transition');
  204. }
  205. },
  206. /*=====================================*/
  207. /*= Swiper Slider =*/
  208. /*=====================================*/
  209. swiperSlider: function () {
  210. $('.swiper-container').each(function () {
  211. var id = $(this).attr('id');
  212. var perpage = $(this).data('perpage') || 1;
  213. var loop = $(this).data('loop') || true;
  214. var speed = $(this).data('speed') || 700;
  215. var autoplay = $(this).data('autoplay') || 5000;
  216. var space = $(this).data('space') || 0;
  217. var effect = $(this).data('effect');
  218. var direction = $(this).data('direction') || 'horizontal';
  219. var breakpoints = $(this).data('breakpoints');
  220. var swiper = new Swiper('#' + id, {
  221. slidesPerView: perpage,
  222. spaceBetween: space,
  223. effect: effect,
  224. direction: direction,
  225. loop: loop,
  226. speed: speed,
  227. watchSlidesVisibility: true,
  228. slideVisibleClass: 'astriol-active-slide',
  229. breakpoints: breakpoints,
  230. autoplay: {
  231. delay: autoplay,
  232. },
  233. pagination: {
  234. el: '.swiper-pagination',
  235. clickable: true
  236. },
  237. navigation: {
  238. nextEl: '.gp-nav-next, .slider-next',
  239. prevEl: '.gp-nav-prev, .slider-prev',
  240. },
  241. thumbs: {
  242. swiper: galleryThumbs
  243. }
  244. });
  245. });
  246. /* Tab Slider */
  247. var exportFeatures = $(".previewSlider");
  248. if (exportFeatures) {
  249. var
  250. sliderFeature = $(".swiper-wrapper", exportFeatures),
  251. childSlide = sliderFeature.children(),
  252. i,
  253. pictos = [],
  254. titles = [];
  255. childSlide.each(function () {
  256. var $this = $(this);
  257. var picto = $this.data('image'),
  258. title = $this.data('title');
  259. pictos.push(picto);
  260. titles.push(title);
  261. });
  262. var swiperExport = new Swiper(".previewSlider", {
  263. effect: "fade",
  264. autoplay: {
  265. delay: 5000,
  266. },
  267. fadeEffect: {
  268. crossFade: true
  269. },
  270. pagination: {
  271. el: ".astriol-pagination",
  272. clickable: !0,
  273. renderBullet: function (e, t) {
  274. return '<span class="' + t + '"><i class="' + pictos[e] + '"></i><span>' + titles[e] + "</span></span>"
  275. }
  276. }
  277. });
  278. swiperExport.on("slideChange", function () {
  279. var e = this.activeIndex;
  280. document.getElementById("slider-tab").classList = "dashboard-preview active-tab-" + e
  281. })
  282. }
  283. var galleryThumbs = new Swiper('.thumb-slider', {
  284. slidesPerView: 4,
  285. loop: true,
  286. effect: 'coverflow',
  287. centeredSlides: true,
  288. // slideToClickedSlide: true,
  289. coverflowEffect: {
  290. rotate: 0,
  291. stretch: -25,
  292. slideShadows: false,
  293. depth: 200
  294. },
  295. freeMode: false,
  296. watchSlidesVisibility: true,
  297. watchSlidesProgress: true,
  298. });
  299. var galleryTop = new Swiper('.gallery-slider', {
  300. // spaceBetween: 10,
  301. // effect: 'fade',
  302. loop: true,
  303. centeredSlides: true,
  304. // fadeEffect: {
  305. // crossFade: true
  306. // },
  307. thumbs: {
  308. swiper: galleryThumbs
  309. }
  310. });
  311. $('.testimonial-top').slick({
  312. slidesToShow: 1,
  313. slidesToScroll: 1,
  314. arrows: false,
  315. fade: true,
  316. asNavFor: '.testimonial-bottom'
  317. });
  318. $('.testimonial-bottom').slick({
  319. slidesToShow: 3,
  320. slidesToScroll: 1,
  321. asNavFor: '.testimonial-top',
  322. arrows: false,
  323. dots: false,
  324. centerMode: true,
  325. focusOnSelect: true,
  326. responsive: [{
  327. breakpoint: 480,
  328. settings: {
  329. slidesToShow: 1,
  330. slidesToScroll: 1
  331. }
  332. }]
  333. });
  334. },
  335. /*==============================*/
  336. /*= Portfolio =*/
  337. /*==============================*/
  338. portfolio: function () {
  339. if ((typeof $.fn.imagesLoaded !== 'undefined') && (typeof $.fn.isotope !== 'undefined')) {
  340. $(".astriol__portfolio-items").imagesLoaded(function () {
  341. var container = $(".astriol__portfolio-items");
  342. container.isotope({
  343. itemSelector: '.astriol__portfolio',
  344. percentPosition: true,
  345. transitionDuration: '0.5s',
  346. masonry: {
  347. columnWidth: '.grid-sizer',
  348. layoutMode: 'masonry',
  349. }
  350. });
  351. $('.astriol__isotope-filter a').on('click', function () {
  352. $('.astriol__isotope-filter').find('.current').removeClass('current');
  353. $(this).parent().addClass('current');
  354. var selector = $(this).attr("data-filter");
  355. container.isotope({
  356. filter: selector
  357. });
  358. return false;
  359. });
  360. $(window).resize(function () {
  361. container.isotope();
  362. });
  363. });
  364. var container = $(".astriol__blog-items");
  365. $(".astriol__blog-items").imagesLoaded(function () {
  366. container.isotope({
  367. itemSelector: '.astriol__blog-grid',
  368. percentPosition: true,
  369. transitionDuration: '0.5s',
  370. masonry: {
  371. layoutMode: 'masonry',
  372. }
  373. });
  374. $('.astriol__blog-filter a').on('click', function () {
  375. $('.astriol__blog-filter').find('.current').removeClass('current');
  376. $(this).parent().addClass('current');
  377. var selector = $(this).attr("data-filter");
  378. container.isotope({
  379. filter: selector
  380. });
  381. return false;
  382. });
  383. $(window).resize(function () {
  384. container.isotope();
  385. });
  386. });
  387. }
  388. },
  389. /*==========================================*/
  390. /*= Section Background =*/
  391. /*==========================================*/
  392. sectionBackground: function () {
  393. // Section Background Image
  394. $('[data-bg-image]').each(function () {
  395. var img = $(this).data('bg-image');
  396. $(this).css({
  397. backgroundImage: 'url(' + img + ')',
  398. });
  399. });
  400. //Parallax Background
  401. $('[data-parallax="image"]').each(function () {
  402. var actualHeight = $(this).position().top;
  403. var speed = $(this).data('parallax-speed');
  404. var reSize = actualHeight - $(window).scrollTop();
  405. var makeParallax = -(reSize / 2);
  406. var posValue = makeParallax + "px";
  407. $(this).css({
  408. backgroundPosition: '50% ' + posValue,
  409. });
  410. });
  411. },
  412. /*=========================================*/
  413. /*= Section Background =*/
  414. /*=========================================*/
  415. sectionSwitch: function () {
  416. $('[data-type="section-switch"], .gp-btn, .astriol-main-menu li a').on('click', function () {
  417. if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
  418. var target = $(this.hash);
  419. if (target.length > 0) {
  420. target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
  421. $('html,body').animate({
  422. scrollTop: target.offset().top
  423. }, 1000);
  424. return false;
  425. }
  426. }
  427. });
  428. },
  429. /*==============================*/
  430. /*= Countup =*/
  431. /*==============================*/
  432. countUp: function () {
  433. var options = {
  434. useEasing: true,
  435. useGrouping: true,
  436. separator: ',',
  437. decimal: '.',
  438. prefix: '',
  439. suffix: ''
  440. };
  441. var counteEl = $('[data-counter]');
  442. if (counteEl) {
  443. counteEl.each(function () {
  444. var val = $(this).data('counter');
  445. var countup = new CountUp(this, 0, val, 0, 2.5, options);
  446. $(this).appear(function () {
  447. countup.start();
  448. }, {
  449. accX: 0,
  450. accY: 0
  451. })
  452. });
  453. }
  454. },
  455. /*=================================*/
  456. /*= Count Down =*/
  457. /*=================================*/
  458. countDown: function () {
  459. $('.countdown').each(function (index, value) {
  460. var count_year = $(this).attr("data-count-year");
  461. var count_month = $(this).attr("data-count-month");
  462. var count_day = $(this).attr("data-count-day");
  463. var count_date = count_year + '/' + count_month + '/' + count_day;
  464. $(this).countdown(count_date, function (event) {
  465. $(this).html(
  466. event.strftime('<span class="CountdownContent">%D<span class="CountdownLabel">Days</span></span><span class="CountdownSeparator"></span><span class="CountdownContent">%H <span class="CountdownLabel">HR</span></span><span class="CountdownSeparator"></span><span class="CountdownContent">%M <span class="CountdownLabel">MIN</span></span><span class="CountdownSeparator"></span><span class="CountdownContent">%S <span class="CountdownLabel">SC</span></span>')
  467. );
  468. });
  469. });
  470. },
  471. /*=============================*/
  472. /*= Skills =*/
  473. /*=============================*/
  474. skills: function () {
  475. $('.skill-bar li').each(function () {
  476. $(this).appear(function () {
  477. $(this).css({
  478. opacity: 1,
  479. left: "0px"
  480. });
  481. var b = $(this).find(".progress-bar").attr("data-width");
  482. $(this).find(".progress-bar").css({
  483. width: b + "%"
  484. });
  485. });
  486. });
  487. },
  488. /*==========================*/
  489. /*= Tab =*/
  490. /*==========================*/
  491. tab: function () {
  492. $('.gp-tab ul.gp-tabs-nav').addClass('active').find('> li:eq(0)').addClass('current');
  493. $('.gp-tab ul.gp-tabs-nav li a').click(function (g) {
  494. var tab = $(this).closest('.gp-tab'),
  495. index = $(this).closest('li').index();
  496. tab.find('ul.gp-tabs-nav > li').removeClass('current');
  497. $(this).closest('li').addClass('current');
  498. tab.find('.tab_content').find('div.gp_tabs_item').not('div.gp_tabs_item:eq(' + index + ')').slideUp();
  499. tab.find('.tab_content').find('div.gp_tabs_item:eq(' + index + ')').slideDown();
  500. g.preventDefault();
  501. });
  502. if ($('.tab-swipe').length > 0) {
  503. $('.tab-swipe li a').on('click', function () {
  504. $('.tab-swipe li a').removeClass('isActive');
  505. $(this).addClass('isActive');
  506. });
  507. }
  508. var tabItems = $('.gp-tabs-navigation li'),
  509. tabContentWrapper = $('.gp-tabs-content');
  510. tabItems.on('click', function (event) {
  511. event.preventDefault();
  512. var selectedItem = $(this);
  513. if (!selectedItem.hasClass('active-tab')) {
  514. var selectedTab = selectedItem.data('content'),
  515. selectedContent = tabContentWrapper.find('li[data-content="' + selectedTab + '"]'),
  516. slectedContentHeight = selectedContent.innerHeight();
  517. tabItems.removeClass('active-tab');
  518. selectedItem.addClass('active-tab');
  519. selectedContent.addClass('active-tab').siblings('li').removeClass('active-tab');
  520. //animate tabContentWrapper height when content changes
  521. tabContentWrapper.animate({
  522. 'height': slectedContentHeight
  523. }, 500);
  524. }
  525. });
  526. //hide the .gp-tabs::after element when tabbed navigation has scrolled to the end (mobile version)
  527. checkScrolling($('.gp-tabs nav'));
  528. $(window).on('resize', function () {
  529. checkScrolling($('.gp-tabs nav'));
  530. tabContentWrapper.css('height', 'auto');
  531. });
  532. $('.gp-tabs nav').on('scroll', function () {
  533. checkScrolling($(this));
  534. });
  535. function checkScrolling(tabs) {
  536. var totalTabWidth = parseInt(tabs.children('.gp-tabs-navigation').width()),
  537. tabsViewport = parseInt(tabs.width());
  538. if (tabs.scrollLeft() >= totalTabWidth - tabsViewport) {
  539. tabs.parent('.gp-tabs').addClass('is-ended');
  540. } else {
  541. tabs.parent('.gp-tabs').removeClass('is-ended');
  542. }
  543. }
  544. },
  545. /*=================================*/
  546. /*= Google Map =*/
  547. /*=================================*/
  548. googleMap: function () {
  549. $('.gmap3-area').each(function () {
  550. var $this = $(this),
  551. key = $this.data('key'),
  552. lat = $this.data('lat'),
  553. lng = $this.data('lng'),
  554. mrkr = $this.data('mrkr'),
  555. address = $this.data('address'),
  556. addr = $this.data('addr');
  557. $this.gmap3({
  558. center: [lat, lng],
  559. zoom: 14,
  560. scrollwheel: false,
  561. mapTypeId: google.maps.MapTypeId.ROADMAP,
  562. styles: [{
  563. "featureType": "all",
  564. "elementType": "labels.text.fill",
  565. "stylers": [{
  566. "saturation": 36
  567. },
  568. {
  569. "color": "#000000"
  570. },
  571. {
  572. "lightness": 40
  573. }
  574. ]
  575. },
  576. {
  577. "featureType": "all",
  578. "elementType": "labels.text.stroke",
  579. "stylers": [{
  580. "visibility": "on"
  581. },
  582. {
  583. "color": "#000000"
  584. },
  585. {
  586. "lightness": 16
  587. }
  588. ]
  589. },
  590. {
  591. "featureType": "all",
  592. "elementType": "labels.icon",
  593. "stylers": [{
  594. "visibility": "off"
  595. }]
  596. },
  597. {
  598. "featureType": "administrative",
  599. "elementType": "geometry.fill",
  600. "stylers": [{
  601. "color": "#000000"
  602. },
  603. {
  604. "lightness": 20
  605. }
  606. ]
  607. },
  608. {
  609. "featureType": "administrative",
  610. "elementType": "geometry.stroke",
  611. "stylers": [{
  612. "color": "#000000"
  613. },
  614. {
  615. "lightness": 17
  616. },
  617. {
  618. "weight": 1.2
  619. }
  620. ]
  621. },
  622. {
  623. "featureType": "landscape",
  624. "elementType": "geometry",
  625. "stylers": [{
  626. "color": "#000000"
  627. },
  628. {
  629. "lightness": 20
  630. }
  631. ]
  632. },
  633. {
  634. "featureType": "poi",
  635. "elementType": "geometry",
  636. "stylers": [{
  637. "color": "#000000"
  638. },
  639. {
  640. "lightness": 21
  641. }
  642. ]
  643. },
  644. {
  645. "featureType": "road.highway",
  646. "elementType": "geometry.fill",
  647. "stylers": [{
  648. "color": "#000000"
  649. },
  650. {
  651. "lightness": 17
  652. }
  653. ]
  654. },
  655. {
  656. "featureType": "road.highway",
  657. "elementType": "geometry.stroke",
  658. "stylers": [{
  659. "color": "#000000"
  660. },
  661. {
  662. "lightness": 29
  663. },
  664. {
  665. "weight": 0.2
  666. }
  667. ]
  668. },
  669. {
  670. "featureType": "road.arterial",
  671. "elementType": "geometry",
  672. "stylers": [{
  673. "color": "#000000"
  674. },
  675. {
  676. "lightness": 18
  677. }
  678. ]
  679. },
  680. {
  681. "featureType": "road.local",
  682. "elementType": "geometry",
  683. "stylers": [{
  684. "color": "#000000"
  685. },
  686. {
  687. "lightness": 16
  688. }
  689. ]
  690. },
  691. {
  692. "featureType": "transit",
  693. "elementType": "geometry",
  694. "stylers": [{
  695. "color": "#000000"
  696. },
  697. {
  698. "lightness": 19
  699. }
  700. ]
  701. },
  702. {
  703. "featureType": "water",
  704. "elementType": "geometry",
  705. "stylers": [{
  706. "color": "#000000"
  707. },
  708. {
  709. "lightness": 17
  710. }
  711. ]
  712. }
  713. ]
  714. })
  715. .marker(function (map) {
  716. return {
  717. position: map.getCenter(),
  718. icon: mrkr,
  719. };
  720. })
  721. });
  722. },
  723. /*=============================*/
  724. /*= Footer =*/
  725. /*=============================*/
  726. footer: function () {
  727. /* Footer Fixed */
  728. var footerFixed = $('#footer-btc').outerHeight();
  729. if ($(document).width() > 768) {
  730. $('#main_content').css('margin-bottom', footerFixed);
  731. }
  732. },
  733. /*=================================*/
  734. /*= Contact Form =*/
  735. /*=================================*/
  736. contactFrom: function () {
  737. $('[data-gp-form]').each(function () {
  738. var $this = $(this);
  739. $('.form-result', $this).css('display', 'none');
  740. $this.submit(function () {
  741. $('button[type="submit"]', $this).addClass('clicked');
  742. // Create a object and assign all fields name and value.
  743. var values = {};
  744. $('[name]', $this).each(function () {
  745. var $this = $(this),
  746. $name = $this.attr('name'),
  747. $value = $this.val();
  748. values[$name] = $value;
  749. });
  750. // Make Request
  751. $.ajax({
  752. url: $this.attr('action'),
  753. type: 'POST',
  754. data: values,
  755. success: function success(data) {
  756. if (data.error == true) {
  757. $('.form-result', $this).addClass('alert-warning').removeClass('alert-success alert-danger').css('display', 'block');
  758. } else {
  759. $('.form-result', $this).addClass('alert-success').removeClass('alert-warning alert-danger').css('display', 'block');
  760. }
  761. $('.form-result > .content', $this).html(data.message);
  762. $('button[type="submit"]', $this).removeClass('clicked');
  763. },
  764. error: function error() {
  765. $('.form-result', $this).addClass('alert-danger').removeClass('alert-warning alert-success').css('display', 'block');
  766. $('.form-result > .content', $this).html('Sorry, an error occurred.');
  767. $('button[type="submit"]', $this).removeClass('clicked');
  768. }
  769. });
  770. return false;
  771. });
  772. });
  773. }
  774. };
  775. GPTHEME.documentOnReady = {
  776. init: function () {
  777. GPTHEME.initialize.init();
  778. $('#animated-wave-one').wavify({
  779. height: 20,
  780. bones: 4,
  781. amplitude: 70,
  782. color: "rgba(218, 222, 255, 0.2)",
  783. speed: .15
  784. });
  785. $('#animated-wave-two').wavify({
  786. height: 30,
  787. bones: 4,
  788. amplitude: 100,
  789. color: 'rgba(218, 222, 255, 0.2)',
  790. speed: .2
  791. });
  792. $('#animated-wave-three').wavify({
  793. height: 30,
  794. bones: 4,
  795. amplitude: 100,
  796. color: 'rgba(255, 255, 255, 0.039)',
  797. speed: .15
  798. });
  799. $('#animated-wave-four').wavify({
  800. height: 30,
  801. bones: 4,
  802. amplitude: 100,
  803. color: 'rgba(255, 255, 255, 0.039)',
  804. speed: .2
  805. });
  806. },
  807. };
  808. GPTHEME.documentOnLoad = {
  809. init: function () {
  810. $(".page-loader").fadeOut("slow");
  811. GPTHEME.initialize.handleMobileHeader();
  812. },
  813. };
  814. GPTHEME.documentOnResize = {
  815. init: function () {
  816. Gp.resize();
  817. GPTHEME.initialize.handleMobileHeader();
  818. GPTHEME.initialize.handleFixedHeader();
  819. },
  820. };
  821. GPTHEME.documentOnScroll = {
  822. init: function () {
  823. GPTHEME.initialize.sectionBackground();
  824. GPTHEME.initialize.handleFixedHeader();
  825. if ($(window).scrollTop() > 300) {
  826. $('.return-to-top').addClass('back-top');
  827. } else {
  828. $('.return-to-top').removeClass('back-top');
  829. }
  830. /* Header Sticky */
  831. if ($(this).scrollTop() > 150) {
  832. $('#header').addClass("fixed")
  833. } else {
  834. $('#header').removeClass("fixed")
  835. }
  836. /* Mobile Nav */
  837. if ($(window).scrollTop() > 54) {
  838. $('#mobile-nav-wrap,.mobile-menu-inner').addClass('mnav-fixed');
  839. } else {
  840. $('#mobile-nav-wrap, mobile-menu-inner').removeClass('mnav-fixed');
  841. }
  842. },
  843. };
  844. Gp.init();
  845. // Initialize Functions
  846. $(document).ready(GPTHEME.documentOnReady.init);
  847. $(window).on('load', GPTHEME.documentOnLoad.init);
  848. $(window).on('resize', GPTHEME.documentOnResize.init);
  849. $(window).on('scroll', GPTHEME.documentOnScroll.init);
  850. })(jQuery);