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.

213 lines
5.2 KiB

1 year ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /* ----- Custom Scripts for Destiny template ----- */
  2. jQuery(function($) {
  3. "use strict";
  4. // get the value of the bottom of the #main element by adding the offset of that element plus its height, set it as a variable
  5. var mainbottom = $('#main').offset().top;
  6. // on scroll,
  7. $(window).on('scroll',function(){
  8. // we round here to reduce a little workload
  9. stop = Math.round($(window).scrollTop());
  10. if (stop > mainbottom) {
  11. $('.navbar').addClass('past-main');
  12. $('.navbar').addClass('effect-main')
  13. } else {
  14. $('.navbar').removeClass('past-main');
  15. }
  16. });
  17. // Collapse navbar on click
  18. $(document).on('click.nav','.navbar-collapse.in',function(e) {
  19. if( $(e.target).is('a') ) {
  20. $(this).removeClass('in').addClass('collapse');
  21. }
  22. });
  23. // Owl carousel init
  24. $(".testimonials").owlCarousel({
  25. slideSpeed : 200,
  26. items: 1,
  27. singleItem: true,
  28. autoPlay : true,
  29. pagination : false
  30. });
  31. /* ------ Clients Section Owl Carousel ----- */
  32. $(".clients").owlCarousel({
  33. slideSpeed : 200,
  34. items: 5,
  35. singleItem: false,
  36. autoPlay : true,
  37. pagination : false
  38. });
  39. /* ------ jQuery for Easing min -- */
  40. $(function() {
  41. $('a.page-scroll').bind('click', function(event) {
  42. var $anchor = $(this);
  43. $('html, body').stop().animate({
  44. scrollTop: $($anchor.attr('href')).offset().top
  45. }, 1500, 'easeInOutExpo');
  46. event.preventDefault();
  47. });
  48. });
  49. /* ----- Magnific Popup ----- */
  50. $('.popup').magnificPopup({
  51. disableOn: 0,
  52. type: 'iframe',
  53. mainClass: 'mfp-fade',
  54. removalDelay: 160,
  55. preloader: false,
  56. fixedContentPos: false
  57. });
  58. /* ----- Jarallax Init ----- */
  59. $('.jarallax').jarallax({
  60. speed: 0.7
  61. });
  62. /* ----- Jarallax Personal Homepage Init ----- */
  63. $('.personal-jarallax').jarallax({
  64. speed: 0.7
  65. });
  66. /*----- Preloader ----- */
  67. $(window).load(function() {
  68. setTimeout(function() {
  69. $('#loading').fadeOut('slow', function() {
  70. });
  71. }, 3000);
  72. });
  73. /* --------- Wow Init -------*/
  74. new WOW().init();
  75. /* ----- Counter Up ----- */
  76. $('.counter').counterUp({
  77. delay: 10,
  78. time: 1000
  79. });
  80. /* ----- Countdown ----- */
  81. if($.find('#countdown')[0]) {
  82. $('#countdown').countDown({
  83. targetDate: {
  84. 'day': 14,
  85. 'month': 7,
  86. 'year': 2017,
  87. 'hour': 11,
  88. 'min': 13,
  89. 'sec': 0
  90. },
  91. omitWeeks: true
  92. });
  93. //enter the count down date using the format year, month, day, time: hour, min, sec
  94. if( $('.day_field .top').html() == "0" ) $('.day_field').css('display','none');
  95. }
  96. /*-----------------------------------
  97. ----------- Scroll To Top -----------
  98. ------------------------------------*/
  99. $(window).scroll(function () {
  100. if ($(this).scrollTop() > 1000) {
  101. $('#back-top').fadeIn();
  102. } else {
  103. $('#back-top').fadeOut();
  104. }
  105. });
  106. // scroll body to 0px on click
  107. $('#back-top').on('click', function () {
  108. $('#back-top').tooltip('hide');
  109. $('body,html').animate({
  110. scrollTop: 0
  111. }, 1500);
  112. return false;
  113. });
  114. /* ------ Animsition ----- */
  115. $(".animsition").animsition({
  116. inClass: 'fade-in',
  117. outClass: 'fade-out',
  118. inDuration: 1500,
  119. outDuration: 800,
  120. linkElement: '.animsition-link',
  121. // e.g. linkElement: 'a:not([target="_blank"]):not([href^="#"])'
  122. loading: true,
  123. loadingParentElement: 'body', //animsition wrapper element
  124. loadingClass: 'animsition-loading',
  125. loadingInner: '', // e.g '<img src="loading.svg" />'
  126. timeout: false,
  127. timeoutCountdown: 5000,
  128. onLoadEvent: true,
  129. browser: [ 'animation-duration', '-webkit-animation-duration'],
  130. // "browser" option allows you to disable the "animsition" in case the css property in the array is not supported by your browser.
  131. // The default setting is to disable the "animsition" in a browser that does not support "animation-duration".
  132. overlay : false,
  133. overlayClass : 'animsition-overlay-slide',
  134. overlayParentElement : 'body',
  135. transition: function(url){ window.location.href = url; }
  136. });
  137. /*----- Subscription Form ----- */
  138. $('.subscribe-form').submit(function(e) {
  139. e.preventDefault();
  140. var postdata = $('.subscribe-form').serialize();
  141. $.ajax({
  142. type: 'POST',
  143. url: 'assets/php/subscribe.php',
  144. data: postdata,
  145. dataType: 'json',
  146. success: function(json) {
  147. if(json.valid == 0) {
  148. $('.success-message').hide();
  149. $('.error-message').hide();
  150. $('.error-message').html(json.message);
  151. $('.error-message').fadeIn('fast', function(){
  152. $('.subscribe-form').addClass('animated flash').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
  153. $(this).removeClass('animated flash');
  154. });
  155. });
  156. }
  157. else {
  158. $('.error-message').hide();
  159. $('.success-message').hide();
  160. $('.subscribe-form').hide();
  161. $('.success-message').html(json.message);
  162. $('.success-message').fadeIn('fast', function(){
  163. $('.top-content').backstretch("resize");
  164. });
  165. }
  166. }
  167. });
  168. });
  169. });