mains.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /* ========================================================================= */
  2. /* Preloader
  3. /* ========================================================================= */
  4. jQuery(window).load(function(){
  5. $("#preloader").fadeOut("slow");
  6. });
  7. /* ========================================================================= */
  8. /* Welcome Section Slider
  9. /* ========================================================================= */
  10. $(function() {
  11. var Page = (function() {
  12. var $navArrows = $( '#nav-arrows' ),
  13. $nav = $( '#nav-dots > span' ),
  14. slitslider = $( '#slider' ).slitslider( {
  15. onBeforeChange : function( slide, pos ) {
  16. $nav.removeClass( 'nav-dot-current' );
  17. $nav.eq( pos ).addClass( 'nav-dot-current' );
  18. }
  19. } ),
  20. init = function() {
  21. initEvents();
  22. },
  23. initEvents = function() {
  24. // add navigation events
  25. $navArrows.children( ':last' ).on( 'click', function() {
  26. slitslider.next();
  27. return false;
  28. } );
  29. $navArrows.children( ':first' ).on( 'click', function() {
  30. slitslider.previous();
  31. return false;
  32. } );
  33. $nav.each( function( i ) {
  34. $( this ).on( 'click', function( event ) {
  35. var $dot = $( this );
  36. if( !slitslider.isActive() ) {
  37. $nav.removeClass( 'nav-dot-current' );
  38. $dot.addClass( 'nav-dot-current' );
  39. }
  40. slitslider.jump( i + 1 );
  41. return false;
  42. } );
  43. } );
  44. };
  45. return { init : init };
  46. })();
  47. Page.init();
  48. });
  49. $(document).ready(function(){
  50. /* ========================================================================= */
  51. /* Portfolio
  52. /* ========================================================================= */
  53. var $projectWrapper = $('.project-wrapper');
  54. $projectWrapper.isotope({
  55. filter: '*',
  56. animationOptions: {
  57. duration: 750,
  58. easing: 'linear',
  59. queue: false
  60. }
  61. });
  62. $('.portfolio-filter a').click(function(){
  63. $('.portfolio-filter .active').removeClass('active');
  64. $(this).addClass('active');
  65. var selector = $(this).attr('data-filter');
  66. $projectWrapper.isotope({
  67. filter: selector,
  68. animationOptions: {
  69. duration: 750,
  70. easing: 'linear',
  71. queue: false
  72. }
  73. });
  74. return false;
  75. });
  76. /* ========================================================================= */
  77. /* Menu item highlighting
  78. /* ========================================================================= */
  79. // jQuery('#nav').singlePageNav({
  80. // offset: jQuery('#nav').outerHeight(),
  81. // filter: ':not(.external)',
  82. // speed: 2000,
  83. // currentClass: 'current',
  84. // easing: 'easeInOutExpo',
  85. // updateHash: true,
  86. // beforeStart: function() {
  87. // console.log('begin scrolling');
  88. // },
  89. // onComplete: function() {
  90. // console.log('done scrolling');
  91. // }
  92. // });
  93. $(window).scroll(function () {
  94. if ($(window).scrollTop() > 10) {
  95. $(".navbar-brand a").css("color","#fff");
  96. $("#navigation").removeClass("animated-header");
  97. } else {
  98. $(".navbar-brand a").css("color","inherit");
  99. $("#navigation").addClass("animated-header");
  100. }
  101. });
  102. /* ========================================================================= */
  103. /* Fix Slider Height
  104. /* ========================================================================= */
  105. // Slider Height
  106. var slideHeight = $(window).height();
  107. $('#home-slider, #slider, .sl-slider, .sl-content-wrapper').css('height',slideHeight);
  108. $(window).resize(function(){
  109. $('#home-slider, #slider, .sl-slider, .sl-content-wrapper').css('height',slideHeight);
  110. });
  111. // $(window).resize(function(){'use strict',
  112. // $('#home-slider, #slider, .sl-slider, .sl-content-wrapper').css('height',slideHeight);
  113. // });
  114. $("#works, #testimonial").owlCarousel({
  115. navigation : true,
  116. pagination : false,
  117. slideSpeed : 700,
  118. paginationSpeed : 400,
  119. singleItem:true,
  120. navigationText: ["<i class='fa fa-angle-left fa-lg'></i>","<i class='fa fa-angle-right fa-lg'></i>"]
  121. });
  122. /* ========================================================================= */
  123. /* Featured Project Lightbox
  124. /* ========================================================================= */
  125. $(".fancybox").fancybox({
  126. padding: 0,
  127. openEffect : 'elastic',
  128. openSpeed : 650,
  129. closeEffect : 'elastic',
  130. closeSpeed : 550,
  131. closeClick : true,
  132. beforeShow: function () {
  133. this.title = $(this.element).attr('title');
  134. this.title = '<h3>' + this.title + '</h3>' + '<p>' + $(this.element).parents('.portfolio-item').find('img').attr('alt') + '</p>';
  135. },
  136. helpers : {
  137. title : {
  138. type: 'inside'
  139. },
  140. overlay : {
  141. css : {
  142. 'background' : 'rgba(0,0,0,0.8)'
  143. }
  144. }
  145. }
  146. });
  147. });
  148. // ========== END GOOGLE MAP ========== //
  149. var wow = new WOW ({
  150. offset: 75, // distance to the element when triggering the animation (default is 0)
  151. mobile: false, // trigger animations on mobile devices (default is true)
  152. });
  153. wow.init();