jQuery(document).ready(function($) { vcenter = function() { $('.vcenter').each(function(index, el) { $(this).css('margin-top', ($(this).parent().height() - $(this).height()) / 2); }); } vcenter(); resize_header(); center_prices() $(window).resize(function(){ resize_header(); center_prices() }); function resize_header() { if($(window).outerWidth() < 840) { $('.mobile-menu').show(); $('.main-menu').hide(); } else { $('.mobile-menu').hide(); $('.main-menu').show(); } if($('header nav .mobile-menu').is(':visible')) { $('header nav').css('padding-top', (($('header .logo img').outerHeight() - $('header nav .mobile-menu').outerHeight()) / 2)); } else { $('header nav').attr('style', ''); } if(!$('.lp').length) return false; var window_height = $(window).outerHeight(); var all_height = $('header .all').outerHeight(); $('header').css({'height': window_height}); var p_height = Math.floor(window_height - all_height); var p_width = Math.floor(p_height * 1.677); if(p_width >= ($(window).width() - 10)) { p_width = $(window).width() - 20; p_height = 'auto'; } $('.presentation').css({ 'height': p_height, 'width': p_width, 'left': (($('header').width() - Math.floor(p_width))/2) }).fadeIn('fast'); } setTimeout(function() { resize_header(); }, 200); function center_prices() { if(!$('.lp').length) return false; $('.price-tables .table').each(function(){ var top_width = $(this).find('.top').width(); var price_width = $(this).find('.top .price').width(); $(this).find('.price').css({'left': (((top_width - price_width))/2)}); }); } $(".go-to-more-info").click(function() { $('html,body').animate({ scrollTop: $('.benefits').offset().top }, { duration: 'slow', easing: 'swing'}); }); $(".go-to-buy-now").click(function() { $('html,body').animate({ scrollTop: $('.price-tables').offset().top }, { duration: 'slow', easing: 'swing'}); }); if($('.typed').length) { $(".typed").typed({ strings: ["Escort", "Model", "Massage", "Companion", "Cam-Model"], typeSpeed: 140, loop: true, loopCount: false, showCursor: true }); } $(document).mouseup(function (e) { if(!$('header nav .mobile-menu').is(':visible')) return false; var container1 = $("header nav .main-menu"); var container2 = $("header nav .mobile-menu"); if (!container1.is(e.target) && container1.has(e.target).length === 0 && !container2.is(e.target) && container2.has(e.target).length === 0) { container1.hide(); } }); $('header nav .mobile-menu').on('click', function(event) { var menu = $(this).parent().find('.main-menu'); menu.toggle(); }); $('.lp .theme-description .read-more').on('click', function(event) { $(this).parent().hide(); $('.lp .theme-description').css('height', 'auto'); }); $('.lp .theme-description-released-versions h3').on('click', function(event) { var version = $(this).data('section'); if($('.theme-description-released-versions .one-description[data-dropdown="'+version+'"]').is(':visible')) { $('.theme-description-released-versions .one-description:visible').slideToggle('fast'); } else { $('.theme-description-released-versions .one-description:visible').slideToggle('fast'); $('.theme-description-released-versions .one-description[data-dropdown="'+version+'"]').slideToggle('fast'); } }); $('.buy-button-wrapper .buy-with-btc').on('click', function(event) { event.preventDefault(); $(this).hide(); $('.write-bitcoin-email-wrapper').slideDown(200); }); $('.buy-with-btc2').on('click', function(event) { event.preventDefault(); var button = $(this); if(button.hasClass('working')) { return false; } else { button.addClass('working'); } var email = $('.btc-email').val(); setTimeout(function() { $.ajax({ type: "GET", url: 'https://escortwp.com/bitcoin/', data: { invoice_email: email }, cache: false, timeout: 20000, // in milliseconds success: function(raw_data) { if(raw_data == "nope") { button.removeClass('working'); } else { window.location.href = raw_data; } }, error: function(request, status, err) { button.removeClass('working'); } }); }, 5000); }); });