script.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. var $ = jQuery;
  2. jQuery(document).ready(function($) {
  3. $(window).load(function(){
  4. $('#preloader').fadeOut('slow',function(){$(this).remove();});
  5. });
  6. });
  7. // Setting up Video
  8. var $ = jQuery;
  9. var vidWidth = $(window).width(), vidHeight = $(window).height();
  10. $("#video-wrap").css({
  11. 'height': vidHeight
  12. });
  13. $('#video').videoBG({
  14. mp4:'assets/bg.mp4',
  15. ogv:'assets/bg.ogv',
  16. webm:'assets/bg.webm',
  17. poster:'assets/poster.jpg',
  18. scale:true,
  19. zIndex:0,
  20. height: vidHeight
  21. });
  22. // Navbar fixing
  23. $("#nav-menu").stick_in_parent()
  24. // Calling Wow
  25. new WOW().init();
  26. // Count Down Timer
  27. $('.countdown').final_countdown({
  28. start : 1360000000, //Here use Milisecond. To convert your time you can go to this(https://currentmillis.com/) website.
  29. end : 1390000000,
  30. now : 1385000000,
  31. seconds: {
  32. borderColor: '#5677fc',
  33. borderWidth: '3'
  34. },
  35. minutes: {
  36. borderColor: '#7e57c2',
  37. borderWidth: '3'
  38. },
  39. hours: {
  40. borderColor: '#4db6ac',
  41. borderWidth: '3'
  42. },
  43. days: {
  44. borderColor: '#d81b60',
  45. borderWidth: '3'
  46. }}, function() {
  47. });
  48. // rotating text
  49. (function() {
  50. var quotes = $(".quotes");
  51. var quoteIndex = -1;
  52. function showNextQuote() {
  53. ++quoteIndex;
  54. quotes.eq(quoteIndex % quotes.length)
  55. .fadeIn(1000)
  56. .delay(1000)
  57. .fadeOut(1000, showNextQuote);
  58. }
  59. showNextQuote();
  60. })();
  61. // smooth mouse wheel
  62. $(function() {
  63. $('a[href*=#]:not([href=#])').click(function() {
  64. if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
  65. var target = $(this.hash);
  66. target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
  67. if (target.length) {
  68. $('html,body').animate({
  69. scrollTop: target.offset().top
  70. }, 1000);
  71. return false;
  72. }
  73. }
  74. });
  75. });
  76. /*------------------------------------------
  77. Subscribe form ajax
  78. ------------------------------------------*/
  79. $('#subscribe-form').submit(function(e) {
  80. e.preventDefault();
  81. var $form = $('#subscribe-form');
  82. var submit = $('#subscribe-button');
  83. var ajaxResponse = $('#subscription-response');
  84. var email = $('#subscriber-email').val();
  85. $.ajax({
  86. type: 'POST',
  87. url: 'php/subscribe.php',
  88. dataType: 'json',
  89. data: {
  90. email: email
  91. },
  92. cache: false,
  93. beforeSend: function(result) {
  94. submit.val("Joining...");
  95. },
  96. success: function(result) {
  97. if(result.sendstatus == 1) {
  98. ajaxResponse.html(result.message);
  99. $form.fadeOut(500);
  100. } else {
  101. ajaxResponse.html(result.message);
  102. submit.val("Join");
  103. }
  104. }
  105. });
  106. });