|
|
|
@@ -30,83 +30,123 @@ jQuery(document).ready(function($){ |
|
|
|
$(this).animate({width: progressValue +'%'}, 6000); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
//contact form |
|
|
|
|
|
|
|
var form = document.getElementById("contact-form"); |
|
|
|
var button = $("#contact-form #submit"); |
|
|
|
var status = $(".log"); |
|
|
|
|
|
|
|
function success(){ |
|
|
|
//form.reset(); |
|
|
|
button.style = "display: none "; |
|
|
|
status.addClass("successfully").text("Thanks!"); |
|
|
|
} |
|
|
|
|
|
|
|
function error() { |
|
|
|
status.addClass("error").text("Oops! There was a problem."); |
|
|
|
} |
|
|
|
|
|
|
|
button.on("submit", function(ev) { |
|
|
|
ev.preventDefault(); |
|
|
|
button.style = "display: none "; |
|
|
|
var data = new FormData(form); |
|
|
|
ajax(form.method, form.action, data, success, error); |
|
|
|
}); |
|
|
|
|
|
|
|
function ajax(method, url, data, success, error) { |
|
|
|
var xhr = new XMLHttpRequest(); |
|
|
|
xhr.open(method, url); |
|
|
|
xhr.setRequestHeader("Accept", "application/json"); |
|
|
|
xhr.onreadystatechange = function() { |
|
|
|
if (xhr.readyState !== XMLHttpRequest.DONE) return; |
|
|
|
if (xhr.status === 200) { |
|
|
|
success(); |
|
|
|
} else { |
|
|
|
error(); |
|
|
|
} |
|
|
|
}; |
|
|
|
xhr.send(data); |
|
|
|
} |
|
|
|
|
|
|
|
//end contact form |
|
|
|
$('#contact-wrap').waypoint(function() { |
|
|
|
animate(); |
|
|
|
}); |
|
|
|
//nikola |
|
|
|
|
|
|
|
$('.clear_storage').on('click', function(e){ |
|
|
|
window.localStorage.clear(); |
|
|
|
}); |
|
|
|
$('.clear_storage').on('click', function(e){ |
|
|
|
window.localStorage.clear(); |
|
|
|
}); |
|
|
|
|
|
|
|
var get_id = localStorage.getItem('pg_id'); |
|
|
|
var get_id = localStorage.getItem('pg_id'); |
|
|
|
|
|
|
|
// check page id, then scroll to its div |
|
|
|
if(get_id) |
|
|
|
scrollToID(null, get_id, 300); |
|
|
|
if(get_id) |
|
|
|
scrollToID(null, get_id, 300); |
|
|
|
|
|
|
|
// click event to scroll to div |
|
|
|
//section link in nav which refer to section on homepage |
|
|
|
$('.home_link').on('click', function(e){ |
|
|
|
e.preventDefault(); |
|
|
|
var id = '#'+$(this).data('id'); |
|
|
|
localStorage.setItem('pg_id', id); |
|
|
|
var url = $(this).attr("href"); |
|
|
|
scrollToID(url, id, 300); |
|
|
|
$('.home_link').on('click', function(e){ |
|
|
|
e.preventDefault(); |
|
|
|
var id = '#'+$(this).data('id'); |
|
|
|
localStorage.setItem('pg_id', id); |
|
|
|
var url = $(this).attr("href"); |
|
|
|
scrollToID(url, id, 300); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
//Link from our partners section on homepage which refer to section on portfolio page |
|
|
|
$('.partners_link').on('click', function(e){ |
|
|
|
e.preventDefault(); |
|
|
|
var id = '#'+$(this).data('id'); |
|
|
|
localStorage.setItem('pg_id', id); |
|
|
|
var url = $(this).attr("href"); |
|
|
|
scrollToID(url, id, 300); |
|
|
|
|
|
|
|
}); |
|
|
|
$('.partners_link').on('click', function(e){ |
|
|
|
e.preventDefault(); |
|
|
|
var id = '#'+$(this).data('id'); |
|
|
|
localStorage.setItem('pg_id', id); |
|
|
|
var url = $(this).attr("href"); |
|
|
|
scrollToID(url, id, 300); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
function scrollToID(url, id, speed) { |
|
|
|
if(url!==null) |
|
|
|
{ |
|
|
|
window.location.href = url; |
|
|
|
function scrollToID(url, id, speed) { |
|
|
|
if(url!==null) |
|
|
|
{ |
|
|
|
window.location.href = url; |
|
|
|
} |
|
|
|
var offSet = 50; |
|
|
|
var obj = $(id).offset(); |
|
|
|
var targetOffset = $(id).offset().top - offSet; |
|
|
|
$('html,body').animate({ scrollTop: targetOffset }, speed); |
|
|
|
} |
|
|
|
var offSet = 50; |
|
|
|
var obj = $(id).offset(); |
|
|
|
var targetOffset = $(id).offset().top - offSet; |
|
|
|
$('html,body').animate({ scrollTop: targetOffset }, speed); |
|
|
|
} |
|
|
|
|
|
|
|
window.addEventListener('scroll', function(e) { |
|
|
|
var loc = window.location; |
|
|
|
if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length)=='index.html') |
|
|
|
{ |
|
|
|
if( isOnScreen( $( '#intro-wrap' ) ) ) { /* Pass element id/class you want to check */ |
|
|
|
$("nav li.active").removeClass("active").find('.nav-active-mark').remove(); |
|
|
|
$("nav li.intro-wrap").addClass("active").append('<span class="nav-active-mark"></span>'); |
|
|
|
} |
|
|
|
if( isOnScreen( $( '#about-wrap' ) ) ) { /* Pass element id/class you want to check */ |
|
|
|
|
|
|
|
$("nav li.active").removeClass("active").find('.nav-active-mark').remove(); |
|
|
|
$("nav li.about-wrap").addClass("active").append('<span class="nav-active-mark"></span>'); |
|
|
|
} |
|
|
|
if( isOnScreen( $( '#our_partners-wrap' ) ) ) { /* Pass element id/class you want to check */ |
|
|
|
|
|
|
|
$("nav li.active").removeClass("active").find('.nav-active-mark').remove(); |
|
|
|
$("nav li.our_partners-wrap").addClass("active").append('<span class="nav-active-mark"></span>'); |
|
|
|
} |
|
|
|
if( isOnScreen( $( '#services-wrap' ) ) ) { /* Pass element id/class you want to check */ |
|
|
|
|
|
|
|
$("nav li.active").removeClass("active").find('.nav-active-mark').remove(); |
|
|
|
$("nav li.services-wrap").addClass("active").append('<span class="nav-active-mark"></span>'); |
|
|
|
} |
|
|
|
if( isOnScreen( $( '#contact-wrap' ) ) ) { /* Pass element id/class you want to check */ |
|
|
|
|
|
|
|
$("nav li.active").removeClass("active").find('.nav-active-mark').remove(); |
|
|
|
$("nav li.contact-wrap").addClass("active").append('<span class="nav-active-mark"></span>'); |
|
|
|
} |
|
|
|
window.addEventListener('scroll', function(e) { |
|
|
|
var loc = window.location; |
|
|
|
if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length)=='index.html') |
|
|
|
{ |
|
|
|
if( isOnScreen( $( '#intro-wrap' ) ) ) { /* Pass element id/class you want to check */ |
|
|
|
$("nav li.active").removeClass("active").find('.nav-active-mark').remove(); |
|
|
|
$("nav li.intro-wrap").addClass("active").append('<span class="nav-active-mark"></span>'); |
|
|
|
} |
|
|
|
if( isOnScreen( $( '#about-wrap' ) ) ) { /* Pass element id/class you want to check */ |
|
|
|
|
|
|
|
$("nav li.active").removeClass("active").find('.nav-active-mark').remove(); |
|
|
|
$("nav li.about-wrap").addClass("active").append('<span class="nav-active-mark"></span>'); |
|
|
|
} |
|
|
|
if( isOnScreen( $( '#our_partners-wrap' ) ) ) { /* Pass element id/class you want to check */ |
|
|
|
|
|
|
|
$("nav li.active").removeClass("active").find('.nav-active-mark').remove(); |
|
|
|
$("nav li.our_partners-wrap").addClass("active").append('<span class="nav-active-mark"></span>'); |
|
|
|
} |
|
|
|
if( isOnScreen( $( '#services-wrap' ) ) ) { /* Pass element id/class you want to check */ |
|
|
|
|
|
|
|
$("nav li.active").removeClass("active").find('.nav-active-mark').remove(); |
|
|
|
$("nav li.services-wrap").addClass("active").append('<span class="nav-active-mark"></span>'); |
|
|
|
} |
|
|
|
if( isOnScreen( $( '#contact-wrap' ) ) ) { /* Pass element id/class you want to check */ |
|
|
|
|
|
|
|
$("nav li.active").removeClass("active").find('.nav-active-mark').remove(); |
|
|
|
$("nav li.contact-wrap").addClass("active").append('<span class="nav-active-mark"></span>'); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
//nikola |
|
|
|
/*========== Disables ==========*/ |