").appendTo("body"); scrollbarWidth=scrollbarParent.children().innerWidth()-scrollbarParent.children().height(99).innerWidth(); if (userAgent.match(/(edge\/\d+|Edge\/\d+)/)) {scrollbarWidth=scrollbarWidth+4;} scrollbarParent.remove();} $("a[data-linkinject]").each(function() {$(this).attr("href",$(this).data("linkinject"));}); $("#interfacemenu").on("show.bs.collapse hide.bs.collapse", function(e) {e.preventDefault(); $(this).toggleClass("in");}); $("#interfacemenu .dropdown-menu").on("click", function(e) {if ($(e.target).closest("a, button, input").length===0) {e.stopPropagation();}}); $(".servicesselect>a").on("click", function(e) {e.preventDefault(); e.stopPropagation(); $(this).blur(); const $selected=$(this).parent(); $("#serviceslist>li.servicesselect").not($selected).removeClass("selected selectedsmall"); $selected.addClass("selected"); if ($(this).find(".fa-caret-right").first().css("display")==="none") {$selected.toggleClass("selectedsmall");} else {$selected.addClass("selectedsmall");} if ($selected.offset().top<$(window).scrollTop() || $selected.offset().top+$selected.outerHeight()>$(window).scrollTop()+$(window).height()) {$selected[0].scrollIntoView({behavior: "auto", block: "start"});}}); $(document).on("show.bs.modal", function() {$("#interfacemenu .dropdown.open").each(function() {$(this).find(".dropdown-toggle").dropdown("toggle");}); if ($("#interfacemenu").hasClass("in")) {$("#interfaceheader .navbar-toggle").click();}}); $(document).on("shown.bs.modal",function(){if (!isMobile) {$("body, #interfaceheader, .modal").css("margin-right",scrollbarWidth+"px"); if (!$("#proxyscroll").length) {$("
").html(aiMessage)[0], walker=document.createTreeWalker(wrapper, NodeFilter.SHOW_TEXT, {acceptNode: n => /\S/.test(n.nodeValue) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT}); let tn; while ((tn=walker.nextNode())) {const span=document.createElement("span"); span.className="matchskel"; tn.parentNode.insertBefore(span, tn); span.appendChild(tn);} $(wrapper).find("img").each(function() {const img=this, skel=document.createElement("span"); skel.className="matchskel matchskelphoto"; img.parentNode.insertBefore(skel, img); skel.appendChild(img);}); $ai.append($(wrapper).contents()); $textarea.attr("placeholder", "Share additional details"); $body.stop(true).animate({scrollTop: Math.max(0, $ai.offset().top-$body.offset().top+$body.scrollTop()-90)}, 300); const spans=$ai.find("span.matchskel").toArray(), spansTotal=spans.length; let idx=0; function revealNext() {if (idx>=spansTotal) {try {localStorage.setItem("match"+role, truncateMatch($dialog));} catch(err) {} $buttons.prop("disabled", false); $submit.removeClass("matchloading").attr("aria-busy","false"); return;} const el=spans[idx], $el=$(el); if (el.firstElementChild && el.firstElementChild.tagName==="IMG") {const $img=$(el.firstElementChild); $img.css("opacity", 0); $el.replaceWith($img); $img.animate({opacity: 1}, 300);} else {$el.replaceWith(document.createTextNode($el.text()));} idx++; setTimeout(revealNext, Math.floor((1000*(1-(idx/spansTotal)))+100));} setTimeout(revealNext, 2000);});}}).fail(function() {matchProgress.stop().then(function() {const $error=$("
Sorry—something went wrong. Please try again.
"); $dialog.append($ai.append($error)); $body.stop(true).animate({scrollTop: $body[0].scrollHeight}, 300); try {localStorage.setItem("match"+role, truncateMatch($dialog));} catch (err) {} $buttons.prop("disabled", false); $submit.removeClass("matchloading").attr("aria-busy", "false");});});});} else {$textarea.focus();}}}}); $("#interfaceediting").click(function(e) {e.preventDefault(); $("#editingmodal").modal({backdrop:"static", keyboard:false, show:true});}); $(".interfacecontact").click(function(e) {e.preventDefault(); $("#contactmodal").modal({backdrop:"static", keyboard:false, show:true});}); $("#contactsubmit").click(function(){$("#contactform").submit();}); $(".results, .modalresults").each(function(){$(this).attr("src","about:blank");}); $(".modalresults").parents(".modal").on("hidden.bs.modal",function(){$(".modalresults",this).css({"height":"0","margin-bottom":"0"}).attr("src","about:blank");}); $(".modal").on("hidden.bs.modal",function(){$(".modal-footer",this).addClass("modalbtnhide");}); $(window).on("shown.bs.modal",function(){$(".modal:visible").each(function(){var shownModal=$(this), checkFooter=setInterval(function(){var shownFooter=shownModal.find(".modal-footer").first(); if (shownFooter.length) {clearInterval(checkFooter); modalButtons(shownFooter);}},0);});}); $("#browsemodal, #setupprojectmodal, #paymentmodal").on("hidden.bs.modal",function(){$(this).find(".modal-content").empty(); $(this).removeData();}); targetForm(""); modalScroll(""); modalPopover($("body")); $("a[data-toggle='popover']").on("shown.bs.popover",function(){modalPopover($(this).next());}); if (isMobile) {$(".modal-content").css("margin-bottom","30px"); $("#matchmodal textarea").css("font-size", "16px");} else {$(".modal-scroll").scroll(function(){$("[data-toggle=popover]").popover("hide");});} localDate(); $("#interfacesignin").click(function(e) {e.preventDefault(); signinModal("");}); $(".interfacejoin").click(function(e) {e.preventDefault(); $("#joinmodal").modal({backdrop:"static", keyboard:false, show:true});}); $(".signinretrieve").click(function(e) {e.preventDefault(); $(this).blur().toggleClass("signinretrieveactive");}); $("#signinsubmit").click(function(){$("#signinform").submit();}); $("#managersubmit").click(function(){$("#managertarget").val($("#signintarget").val()); $("#managerusername").val($("#signinusername").val()); $("#managerpassword1").val($("#signinpassword1").val()); $("#managerisremember").val($("#signinisremember").val()); $("#managerform").submit();}); var swiperPitch=new Swiper("#pitch", {slidesPerView: 1, centeredSlides: true, grabCursor: true, spaceBetween: 31, loop: true, breakpoints: {470: {slidesPerView: 1.25,}, 768: {slidesPerView: 1.5,}, 992: {slidesPerView: 2,}, 1600: {slidesPerView: 2.5,}, 2000: {slidesPerView: 3,}}, on: {transitionEnd: function(){$("#pitch .pitchfadein").removeClass("pitchfadein").addClass("pitchfadeout"); $(this.slides[this.activeIndex]).find(".swiper-button-prev").css("visibility","visible"); $(this.slides[this.activeIndex]).find(".swiper-button-next").css("visibility","visible"); $(this.slides[this.activeIndex]).removeClass("pitchfadeout").addClass("pitchfadein");}}, navigation: {nextEl: "#pitch .swiper-button-next", prevEl: "#pitch .swiper-button-prev",},}); $("#pitch .swiper-button-next, #pitch .swiper-button-prev").on("click",function(){$("#pitch .swiper-button-next, #pitch .swiper-button-prev").css("visibility","hidden");}); var swiperSocialProof=new Swiper("#socialproof .swiper", {slidesPerView: "auto", grabCursor: true, spaceBetween: 15, loop: true, breakpoints: {470: {spaceBetween: 30,}, 1300: {spaceBetween: 50,}}, autoplay: {delay: 5000, disableOnInteraction: false,},}); if (isMobile) {$("#trusted").addClass("trustedmobile");} var swiperOptions=new Swiper("#options", {slidesPerView: 1.25, freeMode: true, spaceBetween: 20, grabCursor: true, breakpoints: {450: {slidesPerView: 1.5,}, 640: {slidesPerView: 2, freeMode: false, spaceBetween: 50,}, 1300: {slidesPerView: 3, freeMode: false, spaceBetween: 50,}, 2100: {slidesPerView: 4, freeMode: false, spaceBetween: 50,}}, pagination: {el: "#options .swiper-pagination", clickable: true,}, navigation: {nextEl: "#options .swiper-button-next", prevEl: "#options .swiper-button-prev",},}); var swiperProfessionals=new Swiper("#professionals .swiper", {effect: "creative", creativeEffect: {prev: {translate: ["100%", 0, 0],}, next: {shadow: true, translate: [0, 0, -400],},}, autoplay: {delay: 5000, disableOnInteraction: false,},}); swiperProfessionals.allowTouchMove=false; $("#reviews").click(function(){$("#reviewsmodal").modal({backdrop:"static", keyboard:false, show:true});}); setTimeout(function(){$(document).trigger("afterready");},1);}); $(document).bind("afterready",function(){$("html").css("opacity","1"); if ($("#bodyheader").length) {$("#bodyheader").css("opacity","1");}}); $(function(){$("[data-toggle=popover]").popover();}); $("body").on("click",function(e){$("[data-toggle=popover]").each(function(){if (!$(this).is(e.target) && $(this).has(e.target).length===0 && $(".popover").has(e.target).length===0) {$(this).popover("hide");}});}); $(window).resize(function(){$("[data-toggle=popover]").popover("hide");}); $(window).resize(function(){modalScroll(""); modalButtons($(".modal-footer:visible")); if ($.isFunction(window.froalaHeight)) {froalaHeight();} $(".results, .modalresults, .message").each(function(){if ($(this).contents().has("title").length && !($(this).hasClass("message") && $(this).prev().hasClass("msginitial"))) {iframeSize($(this));}});}); $(function(){$("[href^='#']").not("[href~='#']").click(function(e){e.preventDefault(); $(window).scrollTop($("[id*='"+$(this).attr("href").split("#")[1]+"']").offset().top-68);});});