Diligent web site
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. "use strict";
  2. // start custom scripts
  3. (function($) {
  4. jQuery(document).ready(function($){
  5. /*========== Swicher ==========*/
  6. /*========== Progress bar ==========*/
  7. function animate() {
  8. $(".progress-bar").each(function(){
  9. var progressValue = $(this).attr('data-value');
  10. $(this).animate({width: progressValue +'%'}, 6000);
  11. });
  12. }
  13. $('#contact-wrap').waypoint(function() {
  14. animate();
  15. });
  16. /*========== Disables ==========*/
  17. if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
  18. $('#animate_css_file, #wow_js_file').remove();
  19. } else {
  20. /*========== WOW Animations ==========*/
  21. var wow = new WOW(
  22. {
  23. animateClass: 'animated',
  24. offset: 100
  25. }
  26. );
  27. wow.init();
  28. }
  29. /*========== Logo Retina ==========*/
  30. if( window.devicePixelRatio > 1 ) {
  31. var logoWidth = $('#logo img').width();
  32. var logoHeight = $('#logo img').height();
  33. $('#logo img').attr("src", "images/logo@2x.png");
  34. $('#logo img').css({ 'width': logoWidth , 'height': logoHeight });
  35. }
  36. /*========== Team Item Hover ==========*/
  37. $('.team-item').each(function(){
  38. var memberImage = $(this).find('.member-face').attr('style');
  39. var current = $(this).find('.change-color');
  40. $(this).find('.hex-in2.outer-hex').first().hover(function(){
  41. $(this).find('.member-face').css('background','#000');
  42. $(current).css('background-color','#f3b202');
  43. $(this).find('.socials').show();
  44. },function(){
  45. $(this).find('.socials').hide();
  46. $(this).find('.member-face').attr('style', memberImage);
  47. $(current).css('background-color','#000');
  48. });
  49. });
  50. /*========== Gallery Item Hover ==========*/
  51. $('.gallery-item').hover(function(){
  52. $(this).find('.gallery-info').stop(true,true).animate({ "top": "0" } );
  53. },function(){
  54. $(this).find('.gallery-info').stop(true,true).animate({ "top": "-999" } );
  55. });
  56. /*========== FlexSlider ==========*/
  57. $('.flexslider').flexslider({
  58. animation: "fade",
  59. animationLoop: false,
  60. directionNav: false,
  61. slideshow: false
  62. });
  63. /*========== Pie Chart ==========*/
  64. $('.days').waypoint(function() {
  65. $('.chart').easyPieChart({
  66. easing: 'easeOutBounce',
  67. barColor: '#f3b202',
  68. trackColor: '#595959',
  69. lineWidth: '18',
  70. lineCap: 'butt',
  71. size: '160',
  72. scaleColor: false,
  73. onStep: function(from, to, percent) {
  74. $(this.el).find('.percent').text(Math.round(percent));
  75. }
  76. });
  77. });
  78. /*========== Smooth Scroll ==========*/
  79. $('a[href*=#]:not([href=#])').click(function() {
  80. $("li.active").removeClass("active").find('.nav-active-mark').remove();
  81. $(this).parent().addClass('active').end().append('<span class="nav-active-mark"></span>');
  82. if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
  83. var target = $(this.hash);
  84. target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
  85. if (target.length) {
  86. $('html,body').animate({
  87. scrollTop: target.offset().top - 53
  88. }, 1000);
  89. return false;
  90. }
  91. }
  92. });
  93. /*========== Graph Bars Animate ==========*/
  94. $('.days').waypoint(function() {
  95. $('.graph ul li.bar').each(function() {
  96. var curBarHeight = $(this).data('bar-height');
  97. $(this).animate({ height: curBarHeight }, 2000, "easeInOutBack");
  98. });
  99. });
  100. /*========== Intro Note Box Tooltip ==========*/
  101. /*$('.note-1').hover(function(){
  102. $(this).find('.note-tooltip').fadeIn();
  103. },function(){
  104. $(this).find('.note-tooltip').fadeOut();
  105. });
  106. */
  107. /*========== PrettyPhoto ==========*/
  108. $("a[data-rel^='prettyPhoto']").prettyPhoto({theme:'dark_rounded', hook: 'data-rel'});
  109. /*========== Flickr ==========*/
  110. var flickrImageSrc = [ ];
  111. var flickrLink = [ ];
  112. $('.flickr_badge_image').each(function(i){
  113. flickrImageSrc[i] = $(this).find('img').attr('src');
  114. flickrLink[i] = $(this).find('a').attr('href');
  115. });
  116. $('.flickr-item').each(function(i){
  117. $(this).find('.hex-area').css('background-image', 'url(' + flickrImageSrc[i] + ')');
  118. $(this).find('.flickr-link').attr('href', flickrLink[i] );
  119. });
  120. /*========== Window Resize ==========*/
  121. var windowWidth = $(window).width();
  122. var numberOfHexagon = windowWidth / 106;
  123. var offsetBackground = ((numberOfHexagon - 14) * 106 ) /2;
  124. $('#hexagon-overlay').css('background-position', offsetBackground + 'px' + ' ' + 'top');
  125. $(window).resize(function() {
  126. var currentWindowWidth = $(window).width();
  127. if(currentWindowWidth <= 940) return;
  128. $('#hexagon-overlay').css('background-position', - ( ( (windowWidth - currentWindowWidth)/2 ) - offsetBackground ) + 'px' + ' ' + 'top');
  129. });
  130. /*========== Mobile Menu ==========*/
  131. $('.mobile-nav-toggle').on('click',function(){
  132. if($(this).attr('class') == 'mobile-nav-toggle deactive') {
  133. $('#mobile-navigation').fadeIn();
  134. $(this).removeClass('deactive');
  135. } else {
  136. $('#mobile-navigation').fadeOut();
  137. $(this).addClass('deactive');
  138. }
  139. });
  140. $("#mobile-navigation li a").on("click", function(){
  141. $('#mobile-navigation').fadeOut();
  142. $(".mobile-nav-toggle").addClass('deactive');
  143. });
  144. $(window).resize(function(){
  145. var w = $(window).width();
  146. if(w > 767) {
  147. $('#mobile-navigation').fadeOut();
  148. $(".mobile-nav-toggle").addClass('deactive');
  149. }
  150. });
  151. /*========== Contact Form Validation ==========*/
  152. function isValidEmailAddress(emailAddress) {
  153. var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
  154. return pattern.test(emailAddress);
  155. }
  156. $('.contact-form form').submit(function() {
  157. var hasError = false;
  158. var comment = $('#message-txt').val();
  159. if ($.trim(comment) == '') {
  160. $('#message-txt').addClass('error');
  161. $('#message-txt').focus();
  162. hasError = true;
  163. }
  164. else {
  165. $('#message-txt').removeClass('error');
  166. }
  167. var subject = $('#subject-txt').val();
  168. if ($.trim(subject) == '') {
  169. $('#subject-txt').addClass('error');
  170. $('#subject-txt').focus();
  171. hasError = true;
  172. }
  173. else {
  174. $('#subject-txt').removeClass('error');
  175. }
  176. var emailVal = $('#email-txt').val();
  177. if ($.trim(emailVal) == '' || !isValidEmailAddress(emailVal)) {
  178. $('#email-txt').addClass('error');
  179. $('#email-txt').focus();
  180. hasError = true;
  181. }
  182. else {
  183. $('#email-txt').removeClass('error');
  184. }
  185. var name = $('#name-txt').val();
  186. if ($.trim(name) == '') {
  187. $('#name-txt').addClass('error');
  188. $('#name-txt').focus();
  189. hasError = true;
  190. }
  191. else {
  192. $('#name-txt').removeClass('error');
  193. }
  194. if (!hasError) {
  195. $('#submit').fadeOut('normal', function(){
  196. $('.loading').css({
  197. display: "block"
  198. });
  199. });
  200. $.post($('.contact-form form').attr('action'), $('.contact-form form').serialize(), function(data){
  201. $('.log').html(data);
  202. $('.loading').remove();
  203. $('.contact-form form').slideUp('slow');
  204. });
  205. }
  206. return false;
  207. });
  208. }); // end jquery init
  209. })(jQuery);