You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. (function($) {
  2. "use strict";
  3. //Hide Loading Box (Preloader)
  4. function handlePreloader() {
  5. if($('.preloader').length){
  6. $('.preloader').delay(200).fadeOut(500);
  7. }
  8. }
  9. //Update Header Style and Scroll to Top
  10. function headerStyle() {
  11. if($('.main-header').length){
  12. var windowpos = $(window).scrollTop();
  13. var siteHeader = $('.main-header');
  14. var scrollLink = $('.scroll-to-top');
  15. if (windowpos >= 200) {
  16. siteHeader.addClass('fixed-header');
  17. scrollLink.fadeIn(300);
  18. } else {
  19. siteHeader.removeClass('fixed-header');
  20. scrollLink.fadeOut(300);
  21. }
  22. }
  23. }
  24. headerStyle();
  25. //Submenu Dropdown Toggle
  26. if($('.main-header li.dropdown ul').length){
  27. $('.main-header li.dropdown').append('<div class="dropdown-btn"><span class="fa fa-angle-down"></span></div>');
  28. //Dropdown Button
  29. $('.main-header li.dropdown .dropdown-btn').on('click', function() {
  30. $(this).prev('ul').slideToggle(500);
  31. });
  32. //Dropdown Menu / Fullscreen Nav
  33. $('.fullscreen-menu .navigation li.dropdown > a').on('click', function() {
  34. $(this).next('ul').slideToggle(500);
  35. });
  36. //Disable dropdown parent link
  37. $('.navigation li.dropdown > a').on('click', function(e) {
  38. e.preventDefault();
  39. });
  40. //Disable dropdown parent link
  41. $('.main-header .navigation li.dropdown > a,.hidden-bar .side-menu li.dropdown > a').on('click', function(e) {
  42. e.preventDefault();
  43. });
  44. }
  45. //Hidden Sidebar
  46. if ($('.hidden-bar,.fullscreen-menu').length) {
  47. var hiddenBar = $('.hidden-bar');
  48. var hiddenBarOpener = $('.nav-toggler');
  49. var hiddenBarCloser = $('.hidden-bar-closer,.close-menu');
  50. $('.hidden-bar-wrapper').mCustomScrollbar();
  51. //Show Sidebar
  52. hiddenBarOpener.on('click', function () {
  53. $('body').addClass('visible-menu-bar');
  54. hiddenBar.addClass('visible-sidebar');
  55. });
  56. //Hide Sidebar
  57. hiddenBarCloser.on('click', function () {
  58. $('body').removeClass('visible-menu-bar');
  59. hiddenBar.removeClass('visible-sidebar');
  60. });
  61. }
  62. //Custom Seclect Box
  63. if($('.custom-select-box').length){
  64. $('.custom-select-box').selectmenu().selectmenu('menuWidget').addClass('overflow');
  65. }
  66. //Gallery Filters
  67. if($('.filter-list').length){
  68. $('.filter-list').mixItUp({});
  69. }
  70. //Fact Counter + Text Count
  71. if($('.count-box').length){
  72. $('.count-box').appear(function(){
  73. var $t = $(this),
  74. n = $t.find(".count-text").attr("data-stop"),
  75. r = parseInt($t.find(".count-text").attr("data-speed"), 10);
  76. if (!$t.hasClass("counted")) {
  77. $t.addClass("counted");
  78. $({
  79. countNum: $t.find(".count-text").text()
  80. }).animate({
  81. countNum: n
  82. }, {
  83. duration: r,
  84. easing: "linear",
  85. step: function() {
  86. $t.find(".count-text").text(Math.floor(this.countNum));
  87. },
  88. complete: function() {
  89. $t.find(".count-text").text(this.countNum);
  90. }
  91. });
  92. }
  93. },{accY: 0});
  94. }
  95. //Main Slider Carousel
  96. if ($('.main-slider-carousel').length) {
  97. $('.main-slider-carousel').owlCarousel({
  98. animateOut: 'fadeOut',
  99. animateIn: 'fadeIn',
  100. loop:true,
  101. margin:0,
  102. nav:true,
  103. autoHeight: true,
  104. smartSpeed: 500,
  105. autoplay: 6000,
  106. navText: [ '<span class="flaticon-back-5"></span>', '<span class="flaticon-next-7"></span>' ],
  107. responsive:{
  108. 0:{
  109. items:1
  110. },
  111. 600:{
  112. items:1
  113. },
  114. 800:{
  115. items:1
  116. },
  117. 1024:{
  118. items:1
  119. },
  120. 1200:{
  121. items:1
  122. }
  123. }
  124. });
  125. }
  126. // Team Carousel
  127. if ($('.team-carousel').length) {
  128. $('.team-carousel').owlCarousel({
  129. loop:true,
  130. margin:30,
  131. nav:true,
  132. autoHeight: true,
  133. smartSpeed: 500,
  134. autoplay: 5000,
  135. navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
  136. responsive:{
  137. 0:{
  138. items:1
  139. },
  140. 600:{
  141. items:2
  142. },
  143. 800:{
  144. items:3
  145. },
  146. 1024:{
  147. items:3
  148. },
  149. 1200:{
  150. items:3
  151. }
  152. }
  153. });
  154. }
  155. // Team Carousel
  156. if ($('.widget-news-carousel').length) {
  157. $('.widget-news-carousel').owlCarousel({
  158. loop:true,
  159. margin:0,
  160. nav:true,
  161. autoHeight: true,
  162. smartSpeed: 500,
  163. autoplay: 5000,
  164. navText: [ '<span class="fa fa-angle-left"></span> Prev', 'Next <span class="fa fa-angle-right"></span>' ],
  165. responsive:{
  166. 0:{
  167. items:1
  168. },
  169. 600:{
  170. items:1
  171. },
  172. 800:{
  173. items:1
  174. },
  175. 1024:{
  176. items:1
  177. },
  178. 1200:{
  179. items:1
  180. }
  181. }
  182. });
  183. }
  184. // Single Item Carousel
  185. if ($('.single-item-carousel').length) {
  186. $('.single-item-carousel').owlCarousel({
  187. loop:true,
  188. margin:0,
  189. nav:true,
  190. smartSpeed: 500,
  191. autoplay: 4000,
  192. navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
  193. responsive:{
  194. 0:{
  195. items:1
  196. },
  197. 480:{
  198. items:1
  199. },
  200. 600:{
  201. items:1
  202. },
  203. 800:{
  204. items:1
  205. },
  206. 1024:{
  207. items:1
  208. }
  209. }
  210. });
  211. }
  212. // Project Single Carousel
  213. if ($('.project-single-carousel').length) {
  214. $('.project-single-carousel').owlCarousel({
  215. animateOut: 'slideOutDown',
  216. animateIn: 'fadeIn',
  217. loop:true,
  218. margin:0,
  219. nav:true,
  220. smartSpeed: 500,
  221. autoplay: 4000,
  222. navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
  223. responsive:{
  224. 0:{
  225. items:1
  226. },
  227. 480:{
  228. items:1
  229. },
  230. 600:{
  231. items:1
  232. },
  233. 800:{
  234. items:1
  235. },
  236. 1024:{
  237. items:1
  238. }
  239. }
  240. });
  241. }
  242. // Three Item Carousel
  243. if ($('.three-item-carousel').length) {
  244. $('.three-item-carousel').owlCarousel({
  245. loop:true,
  246. margin:30,
  247. nav:true,
  248. smartSpeed: 500,
  249. autoplay: 4000,
  250. navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
  251. responsive:{
  252. 0:{
  253. items:1
  254. },
  255. 480:{
  256. items:1
  257. },
  258. 600:{
  259. items:1
  260. },
  261. 700:{
  262. items:2
  263. },
  264. 800:{
  265. items:2
  266. },
  267. 1024:{
  268. items:3
  269. }
  270. }
  271. });
  272. }
  273. // Four Item Carousel
  274. if ($('.four-item-carousel').length) {
  275. $('.four-item-carousel').owlCarousel({
  276. loop:true,
  277. margin:30,
  278. nav:true,
  279. smartSpeed: 500,
  280. autoplay: 4000,
  281. navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
  282. responsive:{
  283. 0:{
  284. items:1
  285. },
  286. 480:{
  287. items:1
  288. },
  289. 600:{
  290. items:2
  291. },
  292. 800:{
  293. items:3
  294. },
  295. 1024:{
  296. items:4
  297. }
  298. }
  299. });
  300. }
  301. // Sponsors Item Carousel
  302. if ($('.sponsors-carousel').length) {
  303. $('.sponsors-carousel').owlCarousel({
  304. loop:true,
  305. margin:30,
  306. nav:true,
  307. smartSpeed: 500,
  308. autoplay: 4000,
  309. navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
  310. responsive:{
  311. 0:{
  312. items:1
  313. },
  314. 480:{
  315. items:2
  316. },
  317. 600:{
  318. items:3
  319. },
  320. 800:{
  321. items:4
  322. },
  323. 1024:{
  324. items:5
  325. }
  326. }
  327. });
  328. }
  329. // Product Carousel Slider
  330. if ($('.shop-page .image-carousel').length && $('.shop-page .thumbs-carousel').length) {
  331. var $sync1 = $(".shop-page .image-carousel"),
  332. $sync2 = $(".shop-page .thumbs-carousel"),
  333. flag = false,
  334. duration = 500;
  335. $sync1
  336. .owlCarousel({
  337. loop:true,
  338. items: 1,
  339. margin: 0,
  340. nav: false,
  341. navText: [ '<span class="icon fa fa-angle-left"></span>', '<span class="icon fa fa-angle-right"></span>' ],
  342. dots: false,
  343. autoplay: true,
  344. autoplayTimeout: 5000
  345. })
  346. .on('changed.owl.carousel', function (e) {
  347. if (!flag) {
  348. flag = false;
  349. $sync2.trigger('to.owl.carousel', [e.item.index, duration, true]);
  350. flag = false;
  351. }
  352. });
  353. $sync2
  354. .owlCarousel({
  355. loop:true,
  356. margin: 20,
  357. items: 1,
  358. nav: true,
  359. navText: [ '<span class="icon fa fa-angle-left"></span>', '<span class="icon fa fa-angle-right"></span>' ],
  360. dots: false,
  361. center: false,
  362. autoplay: true,
  363. autoplayTimeout: 5000,
  364. responsive: {
  365. 0:{
  366. items:2,
  367. autoWidth: false
  368. },
  369. 400:{
  370. items:2,
  371. autoWidth: false
  372. },
  373. 600:{
  374. items:3,
  375. autoWidth: false
  376. },
  377. 900:{
  378. items:5,
  379. autoWidth: false
  380. },
  381. 1000:{
  382. items:4,
  383. autoWidth: false
  384. }
  385. },
  386. })
  387. .on('click', '.owl-item', function () {
  388. $sync1.trigger('to.owl.carousel', [$(this).index(), duration, true]);
  389. })
  390. .on('changed.owl.carousel', function (e) {
  391. if (!flag) {
  392. flag = true;
  393. $sync1.trigger('to.owl.carousel', [e.item.index, duration, true]);
  394. flag = false;
  395. }
  396. });
  397. }
  398. //Jquery Spinner / Quantity Spinner
  399. if($('.quantity-spinner').length){
  400. $("input.quantity-spinner").TouchSpin({
  401. verticalbuttons: true
  402. });
  403. }
  404. //Product Tabs
  405. if($('.project-tab').length){
  406. $('.project-tab .product-tab-btns .p-tab-btn').on('click', function(e) {
  407. e.preventDefault();
  408. var target = $($(this).attr('data-tab'));
  409. if ($(target).hasClass('actve-tab')){
  410. return false;
  411. }else{
  412. $('.project-tab .product-tab-btns .p-tab-btn').removeClass('active-btn');
  413. $(this).addClass('active-btn');
  414. $('.project-tab .p-tabs-content .p-tab').removeClass('active-tab');
  415. $(target).addClass('active-tab');
  416. }
  417. });
  418. }
  419. //Tabs Box
  420. if($('.tabs-box').length){
  421. $('.tabs-box .tab-buttons .tab-btn').on('click', function(e) {
  422. e.preventDefault();
  423. var target = $($(this).attr('data-tab'));
  424. if ($(target).is(':visible')){
  425. return false;
  426. }else{
  427. target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeClass('active-btn');
  428. $(this).addClass('active-btn');
  429. target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeOut(0);
  430. target.parents('.tabs-box').find('.tabs-content').find('.tab').removeClass('active-tab');
  431. $(target).fadeIn(300);
  432. $(target).addClass('active-tab');
  433. }
  434. });
  435. }
  436. //Product Carousel
  437. if ($('.project-carousel').length) {
  438. $('.project-carousel').owlCarousel({
  439. loop:true,
  440. margin:0,
  441. nav:true,
  442. smartSpeed: 700,
  443. autoplay: 5000,
  444. navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ],
  445. responsive:{
  446. 0:{
  447. items:1
  448. },
  449. 600:{
  450. items:2
  451. },
  452. 800:{
  453. items:2
  454. },
  455. 1024:{
  456. items:3
  457. },
  458. 1200:{
  459. items:4
  460. },
  461. 1400:{
  462. items:5
  463. }
  464. }
  465. });
  466. }
  467. //Event Countdown Timer
  468. if($('.time-countdown').length){
  469. $('.time-countdown').each(function() {
  470. var $this = $(this), finalDate = $(this).data('countdown');
  471. $this.countdown(finalDate, function(event) {
  472. var $this = $(this).html(event.strftime('' + '<div class="counter-column"><span class="count">%D</span>Days</div> ' + '<div class="counter-column"><span class="count">%H</span>Hours</div> ' + '<div class="counter-column"><span class="count">%M</span>Minutes</div> ' + '<div class="counter-column"><span class="count">%S</span>Seconds</div>'));
  473. });
  474. });
  475. }
  476. //Accordion Box
  477. if($('.accordion-box').length){
  478. $(".accordion-box").on('click', '.acc-btn', function() {
  479. var outerBox = $(this).parents('.accordion-box');
  480. var target = $(this).parents('.accordion');
  481. if($(this).hasClass('active')!==true){
  482. $(outerBox).find('.accordion .acc-btn').removeClass('active');
  483. }
  484. if ($(this).next('.acc-content').is(':visible')){
  485. return false;
  486. }else{
  487. $(this).addClass('active');
  488. $(outerBox).children('.accordion').removeClass('active-block');
  489. $(outerBox).find('.accordion').children('.acc-content').slideUp(300);
  490. target.addClass('active-block');
  491. $(this).next('.acc-content').slideDown(300);
  492. }
  493. });
  494. }
  495. //LightBox / Fancybox
  496. if($('.lightbox-image').length) {
  497. $('.lightbox-image').fancybox({
  498. openEffect : 'fade',
  499. closeEffect : 'fade',
  500. helpers : {
  501. media : {}
  502. }
  503. });
  504. }
  505. //Contact Form Validation
  506. if($('#contact-form').length){
  507. $('#contact-form').validate({
  508. rules: {
  509. firstname: {
  510. required: true
  511. },
  512. email: {
  513. required: true,
  514. email: true
  515. },
  516. phone: {
  517. required: true
  518. },
  519. subject: {
  520. required: true
  521. },
  522. message: {
  523. required: true
  524. }
  525. }
  526. });
  527. }
  528. // Scroll to a Specific Div
  529. if($('.scroll-to-target').length){
  530. $(".scroll-to-target").on('click', function() {
  531. var target = $(this).attr('data-target');
  532. // animate
  533. $('html, body').animate({
  534. scrollTop: $(target).offset().top
  535. }, 1500);
  536. });
  537. }
  538. // Elements Animation
  539. if($('.wow').length){
  540. var wow = new WOW(
  541. {
  542. boxClass: 'wow', // animated element css class (default is wow)
  543. animateClass: 'animated', // animation css class (default is animated)
  544. offset: 0, // distance to the element when triggering the animation (default is 0)
  545. mobile: true, // trigger animations on mobile devices (default is true)
  546. live: true // act on asynchronously loaded content (default is true)
  547. }
  548. );
  549. wow.init();
  550. }
  551. /* ==========================================================================
  552. When document is Scrollig, do
  553. ========================================================================== */
  554. $(window).on('scroll', function() {
  555. headerStyle();
  556. });
  557. /* ==========================================================================
  558. When document is loading, do
  559. ========================================================================== */
  560. $(window).on('load', function() {
  561. handlePreloader();
  562. });
  563. })(window.jQuery);