123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732 |
- "use strict";
- function isOnScreen(elem) {
- // if the element doesn't exist, abort
- if( elem.length == 0 ) {
- return;
- }
- var $window = jQuery(window)
- var viewport_top = $window.scrollTop()
- var viewport_height = $window.height()
- var viewport_bottom = viewport_top + viewport_height
- var $elem = jQuery(elem)
- var top = $elem.offset().top
- var height = $elem.height()
- var bottom = top + height
-
- return (top >= viewport_top && top < viewport_bottom) ||
- (bottom > viewport_top && bottom <= viewport_bottom) ||
- (height > viewport_height && top <= viewport_top && bottom >= viewport_bottom)
- }
-
- // start custom scripts
- (function($) {
- jQuery(document).ready(function($){
- /*========== Swicher ==========*/
-
- /*========== Progress bar ==========*/
- function animate() {
- $(".progress-bar").each(function(){
- var progressValue = $(this).attr('data-value');
- $(this).animate({width: progressValue +'%'}, 6000);
- });
- }
- function scrollToID(url, id, speed) {
- if(url!==null)
- {
- window.location.href = url;
- }
- var offSet = 50;
- var obj = jQuery(id).offset();
- var targetOffset = 0;
- if(jQuery(id).length)
- {
- targetOffset = jQuery(id).offset().top - offSet;
- }
- jQuery('html,body').animate({ scrollTop: targetOffset }, speed)
- }
- function backToPreviousLink()
- {
- var loc = window.location;
- var responseFrom = loc.hash.lastIndexOf('=') + 1;
-
- if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'index.php' )
- {
- if(loc.hash.substring( responseFrom, loc.hash.length ) == 'about')
- {
- $('.about-section').addClass('active').append('<span class="nav-active-mark"></span>');
- }
- else if(loc.hash.substring( responseFrom, loc.hash.length ) == 'our_partners')
- {
- $('.our_partners-section').addClass('active').append('<span class="nav-active-mark"></span>');
- }
- else if(loc.hash.substring( responseFrom, loc.hash.length ) == 'contact')
- {
- $('.contact-section').addClass('active').append('<span class="nav-active-mark"></span>');
- }
- else
- {
- $('.intro-section').addClass('active').append('<span class="nav-active-mark"></span>');
- }
-
- }
- else if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'careers.php' )
- {
- $('.career-link').addClass('active').append('<span class="nav-active-mark"></span>');
- }
- else if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'apply.php' )
- {
- $('.career-link').addClass('active').append('<span class="nav-active-mark"></span>');
- }
- else if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'portfolio.php' )
- {
- $('.portfolio-link').addClass('active').append('<span class="nav-active-mark"></span>');
- }
- else if(loc.pathname.includes("services") )
- {
- $('.service-link').addClass('active').append('<span class="nav-active-mark"></span>');
- }
- else if(loc.pathname.includes("industries") )
- {
- $('.industries-link').addClass('active').append('<span class="nav-active-mark"></span>');
- }
-
- }
-
- //service and industry
-
- //homepage
- var previousLink;
- var indexPeviousSelectedLink = 0;
-
- $('#navigation .service-link').on('click', function()
- {
-
- $(".nav-active-mark").parent().removeClass("active").removeClass('up');
- $(".nav-active-mark").remove();
-
- $('#industriesMenu').css('display', 'none');
- $('#servicesMenu').toggle('active');
- if($('#header').hasClass('active_dropdown'))
- {
- if(previousLink != 'industries')
- {
- $('#header').removeClass('active_dropdown');
- //$(this).remove('.nav-active-mark').removeClass('active');
-
- backToPreviousLink();
- previousLink = '';
- }
- else if(previousLink !== undefined)
- {
- $(this).addClass('active').addClass("up").append('<span class="nav-active-mark"></span>');
- previousLink = 'services'
- //$(this).remove('.nav-active-mark').removeClass('active');
- }
-
- }
- else
- {
-
- $('#header').addClass('active_dropdown');
- $(this).addClass('active').addClass('up').append('<span class="nav-active-mark"></span>');
- previousLink = 'services';
- }
-
- });
-
- $('#navigation .industries-link').on('click', function()
- {
-
- $(".nav-active-mark").parent().removeClass("active").removeClass('up');
- $(".nav-active-mark").remove();
-
- $('#servicesMenu').css('display', 'none');
- $('#industriesMenu').toggle('active');
- if($('#header').hasClass('active_dropdown'))
- {
- if(previousLink != 'services')
- {
- $('#header').removeClass('active_dropdown');
- //$(this).remove('.nav-active-mark').removeClass('active');
-
- backToPreviousLink();
- previousLink = '';
- }
- else if(previousLink !== undefined)
- {
- //$(this).remove('.nav-active-mark').removeClass('active');
- $(this).addClass('up').addClass('active').append('<span class="nav-active-mark"></span>');
- previousLink = 'industries';
- }
-
- }
- else
- {
- $('#header').addClass('active_dropdown');
- $(this).addClass('up').addClass('active').append('<span class="nav-active-mark"></span>');
- previousLink = 'industries';
- }
-
- });
-
-
- $('#mobile-navigation .service-link').click(function(event){
- event.stopPropagation();
- var mobileDrodown = $(this).find('ul');
- if(mobileDrodown.is( ":hidden" ))
- {
-
- mobileDrodown.slideDown('slow');
- mobileDrodown.removeClass('active');
- }
- else
- {
-
- mobileDrodown.hide();
- mobileDrodown.addClass('active');
- }
-
- });
- $('#mobile-navigation .industries-link').click(function(event){
- event.stopPropagation();
- var mobileDrodown = $(this).find('ul');
- if(mobileDrodown.is( ":hidden" ))
- {
-
- mobileDrodown.slideDown('slow');
- mobileDrodown.removeClass('active');
- }
- else
- {
-
- mobileDrodown.hide();
- mobileDrodown.addClass('active');
- }
-
- });
- //homepage end
- //career
- var expand = false;
- $('.position').on('click', function(ev) {
- //ev.preventDefault();
-
- $(this).find(".chev").toggleClass('chevron--down chevron--up');
- $(this).closest(".position-cont").find(".collapse").toggleClass("show");
-
- $(this).toggleClass("active"); //css({"background-color": "#993c95", "color": "white"});
-
-
- expand= !expand;
- });
- $('.chev').on('click', function(ev) {
- //ev.preventDefault();
-
- $(this).toggleClass('chevron--down chevron--up');
- $(this).closest(".position-cont").find(".collapse").toggleClass("show");
-
- $(this).closest(".position").toggleClass("active"); //css({"background-color": "#993c95", "color": "white"});
-
-
- expand= !expand;
- });
- //end career
-
- //apply
- // $(".resume-cont").click(function()
- // {
- // $(".resume-file").click();
- // });
- if( $("#positions").length)
- {
- $("#positions").selectize({
- create: true,
- sortField: {
- field: 'text',
- direction: 'asc'
- },
-
- });
- }
- var resume = "";
- $("input:file").change(function (event){
- var fileName = $(this).val();
-
-
- var reader = new FileReader();
-
- reader.onload = function(e)
- {
- resume = e.target.result;
- }
- reader.readAsDataURL(this.files[0]);
- var fileExtensionAt = fileName.lastIndexOf(".") + 1;
- var fileExtension = fileName.substring(fileExtensionAt, fileName.length);
- if(fileName!="" && fileExtension == "doc" || fileExtension == "docx" || fileExtension == "pdf")
- {
- var from = fileName.lastIndexOf("\\") + 1;
- var to = fileName.length ;
- if(to < 12)
- {
- fileName = fileName.substring(from, to);
- }
- else
- {
- fileName = fileName.substring(from, from + 12) + " ...";
- }
- }
- else{
- fileName="Choose file";
- }
- $(".resume-file-cont label").html(fileName);
-
- });
- $(".btn-delete-file").click(function(e)
- {
- e.preventDefault();
- $(".resume-file-cont label").html("Choose file");
- });
- var btn_apply = $("#apply-submit");
- var apply_form = $("#apply-form");
-
- apply_form.bind('submit', function(ev) {
- ev.preventDefault();
-
- var resume_file = document.getElementById("resume-file").files[0];
- var data = new FormData(document.getElementById("apply-form"));
- data.append("resume", "'" + resume + "'");
- data.append("resume-file", resume_file);
-
-
- $.ajax({
- url: "job_apply.php?call=upload",
- method: "POST",
- data: data,
- contentType: false,
- cache: false,
- processData:false,
- success : function(data) {
-
- window.location.replace("careers.php?response=successful");
-
- },
- error: function(error)
- {
- console.log(console.error);
- }
-
- });
-
- });
-
-
-
-
-
- //apply end
- //contact form
-
- var contact_form = $("#contact-form");
- var contact_button = jQuery("#contact-form #submit");
- var status = jQuery(".log");
-
-
-
- contact_form.bind('submit', function(event)
- {
- event.preventDefault();
-
- var data = new FormData(document.getElementById("contact-form"));
-
- $.ajax({
- url: "contact_form.php",
- method: "POST",
- data: data,
- contentType: false,
- cache: false,
- processData:false,
- success : function(data) {
-
- window.location.replace("index.php");
-
- },
- error: function(error)
- {
- console.log(console.error);
- }
-
- });
-
- });
-
-
-
- $('.clear_storage').on('click', function(e){
- window.localStorage.clear();
- });
-
-
- var get_id = localStorage.getItem('pg_id');
- var setupUrl = false;
- // check page id, then scroll to its div
- if(get_id)
- {
- scrollToID(null, get_id, 300);
- }
-
- jQuery(document).ready(function()
- {
- var loc = window.location;
- if(!get_id && loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'index.php' && !setupUrl)
- {
- var sectionType = window.location.hash;
-
- var id = sectionType.substr(sectionType.indexOf('=') + 1, sectionType.length );
- id+="-section";
- if(id != "" && id != null)
- {
- var nav_link = "#navigation ."+ id +" > a";
- var item = $(nav_link);
- item.trigger('click');
- setupUrl =true;
- }
- }
- });
- $("#back-to-top").on('click', function()
- {
- $(window).scrollTop(0);
- $(this).removeClass('active');
- });
- // 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);
-
-
- });
- //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);
-
- });
-
-
-
- var siteUrl = window.location.hash;
- window.addEventListener('scroll', function(e) {
- if($( document ).width() <= 768)
- {
- $("#back-to-top").addClass("active");
- }
-
- if($( document ).scrollTop() == 0)
- {
- $("#back-to-top").removeClass("active");
- }
-
- var loc = window.location;
- if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'index.php')
- {
- var newUrl = "";
- if( isOnScreen( $( '#intro-section' ) ) ) { /* Pass element id/class you want to check */
- $("nav li.active").removeClass("active").find('.nav-active-mark').remove();
- $("nav li.intro-section").addClass("active").append('<span class="nav-active-mark"></span>');
-
- //newUrl = siteUrl.substring(0, siteUrl.indexOf("/"));
- parent.location.hash = "?section=intro";
- }
- if( isOnScreen( $( '#about-section' ) ) ) { /* Pass element id/class you want to check */
-
- $("nav li.active").removeClass("active").find('.nav-active-mark').remove();
- $("nav li.about-section").addClass("active").append('<span class="nav-active-mark"></span>');
-
- parent.location.hash = "?section=about";
-
- }
- if( isOnScreen( $( '#our_partners-section' ) ) ) { /* Pass element id/class you want to check */
-
- $("nav li.active").removeClass("active").find('.nav-active-mark').remove();
- $("nav li.our_partners-section").addClass("active").append('<span class="nav-active-mark"></span>');
-
-
- parent.location.hash = "?section=our_partners";
- }
- if( isOnScreen( $( '#services-section' ) ) ) { /* Pass element id/class you want to check */
-
- $("nav li.active").removeClass("active").find('.nav-active-mark').remove();
- $("nav li.services-section").addClass("active").append('<span class="nav-active-mark"></span>');
-
-
- parent.location.hash = "?section=services";
- }
- if( isOnScreen( $( '#teams-wrap' ) ) ) { /* Pass element id/class you want to check */
-
- $("nav li.active").removeClass("active").find('.nav-active-mark').remove();
- $("nav li.teams-wrap").addClass("active").append('<span class="nav-active-mark"></span>');
-
- newUrl = siteUrl.substring(0, siteUrl.lastIndexOf("/") -1) + "teams-wrap";
- parent.location.hash = "?section=teams"
- }
- if( isOnScreen( $( '#contact-section' ) ) ) { /* Pass element id/class you want to check */
-
- $("nav li.active").removeClass("active").find('.nav-active-mark').remove();
- $("nav li.contact-section").addClass("active").append('<span class="nav-active-mark"></span>');
-
-
- parent.location.hash = "?section=contact"
- }
-
- }
- });
-
- //careers
-
- var loc = window.location;
- //response=successful
- var responseFrom = loc.search.lastIndexOf('=') + 1;
-
- if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'careers.php' && loc.search.substring( responseFrom, loc.search.length ))
- {
- $('.background-overlay').addClass('active');
- $('.apply-notification').addClass('active');
-
- }
- $('.close-notification').click(function()
- {
- window.location.replace("careers.php");
-
- }
- )
-
- //careers end
- /*========== Disables ==========*/
- if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
- $('#animate_css_file, #wow_js_file').remove();
- } else {
-
- /*========== WOW Animations ==========*/
- var wow = new WOW(
- {
- animateClass: 'animated',
- offset: 100
- }
- );
- wow.init();
-
- }
-
- /*========== Logo Retina ==========*/
- if( window.devicePixelRatio > 1 ) {
- var logoWidth = $('#logo img').width();
- var logoHeight = $('#logo img').height();
- $('#logo img').attr("src", "images/[email protected]");
- $('#logo img').css({ 'width': logoWidth , 'height': logoHeight });
- }
-
- /*========== Team Item Hover ==========*/
- $('.team-item').each(function(){
- var memberImage = $(this).find('.member-face').attr('style');
- var current = $(this).find('.change-color');
- $(this).find('.hex-in2.outer-hex').first().hover(function(){
- $(this).find('.member-face').css('background','#000');
- $(current).css('background-color','#f3b202');
- $(this).find('.socials').show();
- },function(){
- $(this).find('.socials').hide();
- $(this).find('.member-face').attr('style', memberImage);
- $(current).css('background-color','#000');
- });
- });
-
- /*========== Gallery Item Hover ==========*/
-
- $('.gallery-item').hover(function(){
- $(this).find('.gallery-info').stop(true,true).animate({ "top": "0" } );
- },function(){
- $(this).find('.gallery-info').stop(true,true).animate({ "top": "-999" } );
- });
-
-
-
- /*========== Pie Chart ==========*/
- $('.days').waypoint(function() {
- $('.chart').easyPieChart({
- easing: 'easeOutBounce',
- barColor: '#f3b202',
- trackColor: '#595959',
- lineWidth: '18',
- lineCap: 'butt',
- size: '160',
- scaleColor: false,
- onStep: function(from, to, percent) {
- $(this.el).find('.percent').text(Math.round(percent));
- }
- });
- });
-
- /*========== Smooth Scroll ==========*/
- $('a[href*=#]:not([href=#])').click(function() {
-
- $("#navigation ul > li").each( function(index)
- {
- var selected = $(this).find(".nav-active-mark");
- if(selected.length)
- {
- indexPeviousSelectedLink = index +1;
- }
- });
- $("li.active").removeClass("active").find('.nav-active-mark').remove();
- if(!$(this).parent().hasClass('service-link') && !$(this).parent().hasClass('industries-link'))
- {
- $('#servicesMenu').css('display', 'none');
- $('#industriesMenu').css('display', 'none');
- $('#header').removeClass('active_dropdown');
-
- }
- $(this).parent().addClass('active').end().append('<span class="nav-active-mark"></span>');
-
- if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
- var target = $(this.hash);
- target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
- if (target.length) {
- $('html,body').animate({
- scrollTop: target.offset().top - 53
- }, 1000);
- return false;
- }
- }
- });
-
- /*========== Graph Bars Animate ==========*/
- $('.days').waypoint(function() {
- $('.graph ul li.bar').each(function() {
- var curBarHeight = $(this).data('bar-height');
- $(this).animate({ height: curBarHeight }, 2000, "easeInOutBack");
- });
- });
-
- /*========== Intro Note Box Tooltip ==========*/
- /*$('.note-1').hover(function(){
- $(this).find('.note-tooltip').fadeIn();
- },function(){
- $(this).find('.note-tooltip').fadeOut();
- });
- */
-
- /*========== PrettyPhoto ==========*/
- $("a[data-rel^='prettyPhoto']").prettyPhoto({theme:'dark_rounded', hook: 'data-rel'});
-
- /*========== Flickr ==========*/
- var flickrImageSrc = [ ];
- var flickrLink = [ ];
- $('.flickr_badge_image').each(function(i){
- flickrImageSrc[i] = $(this).find('img').attr('src');
- flickrLink[i] = $(this).find('a').attr('href');
- });
- $('.flickr-item').each(function(i){
- $(this).find('.hex-area').css('background-image', 'url(' + flickrImageSrc[i] + ')');
- $(this).find('.flickr-link').attr('href', flickrLink[i] );
- });
-
- /*========== Window Resize ==========*/
- var windowWidth = $(window).width();
- var numberOfHexagon = windowWidth / 106;
- var offsetBackground = ((numberOfHexagon - 14) * 106 ) /2;
- $('#hexagon-overlay').css('background-position', offsetBackground + 'px' + ' ' + 'top');
-
- $(window).resize(function() {
- var currentWindowWidth = $(window).width();
- if(currentWindowWidth <= 940) return;
- $('#hexagon-overlay').css('background-position', - ( ( (windowWidth - currentWindowWidth)/2 ) - offsetBackground ) + 'px' + ' ' + 'top');
- });
-
- /*========== Mobile Menu ==========*/
- $('.mobile-nav-toggle').on('click',function(){
- if($(this).attr('class') == 'mobile-nav-toggle deactive') {
- $('#mobile-navigation').fadeIn();
- $(this).removeClass('deactive');
- } else {
- $('#mobile-navigation').fadeOut();
- $(this).addClass('deactive');
- }
- });
-
- $("#mobile-navigation li:not(.service-link):not(.industries-link) a").on("click", function(){
- $('#mobile-navigation').fadeOut();
- $(".mobile-nav-toggle").addClass('deactive');
-
- });
-
- $(window).resize(function(){
- var w = $(window).width();
- if(w > 767) {
- $('#mobile-navigation').fadeOut();
- $(".mobile-nav-toggle").addClass('deactive');
- }
- });
-
- /*========== Contact Form Validation ==========*/
-
- function isValidEmailAddress(emailAddress) {
- 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);
- return pattern.test(emailAddress);
- }
-
-
- /*========== FlexSlider ==========*/
- if($('.flexslider').length)
- {
- $('.flexslider').flexslider({
- animation: "fade",
- animationLoop: false,
- directionNav: false,
- slideshow: false
- });
- }
-
-
- }); // end jquery init
- })(jQuery);
-
- var verifyCallbackApply = function(response) {
- return new Promise(function(resolve, reject) {
- if (response) {
- //jQuery("#apply-form").submit();
- $('#apply-submit').removeAttr('disabled');
- }
- });
- };
- var verifyCallbackContact = function(response) {
- return new Promise(function(resolve, reject) {
- if (response) {
- //jQuery("#apply-form").submit();
- $('#contact-form #submit').removeAttr('disabled');
- }
- });
- };
- var onloadCallback = function () {
-
- if (jQuery('#googlecapatcha_apply').length) {
- recaptcha = grecaptcha.render('googlecapatcha_apply', {
- 'sitekey': "6Lc3Bt8ZAAAAACPv1F98oFvwPOYVyvWvmN1HYkrS",
- 'theme': 'light',
- 'callback': verifyCallbackApply
- });
- }
- if (jQuery('#googlecapatcha_contact').length)
- {
- recaptcha = grecaptcha.render('googlecapatcha_contact', {
- 'sitekey': "6Lc3Bt8ZAAAAACPv1F98oFvwPOYVyvWvmN1HYkrS",
- 'theme': 'light',
- 'callback': verifyCallbackContact
- });
- }
-
- };
|