const square = document.querySelector('.whoquestions'); const observer = new IntersectionObserver(entries => { entries.forEach(entry => { //console.log(entry.target.classList[0]); if (entry.isIntersecting) { switch(entry.target.classList[0]) { case 'whotxt': entry.target.classList.add('text-pop-up-top'); square.classList.add('text-pop-up-left'); break; case 'whattxt': entry.target.classList.add('text-pop-up-bottom'); //square.classList.add('text-pop-up-left'); break; default: break; } } }); }); observer.observe(document.querySelector('.whotxt')); observer.observe(document.querySelector('.whattxt')); var hackState = true; function keyboardShortcuts(event) { const { key } = event; //console.log(key); switch (key) { case 'Insert': case 'F1': case "'": hackState = !hackState; if(hackState) { $( "#draggable" ).show(); } else { $( "#draggable" ).hide(); } break; } } document.addEventListener('keyup', keyboardShortcuts); $( function() { if($("body").width() < 1000 || $("body").height() < 655) { window.location.href += "?mobile"; } $( "#draggable" ).draggable({disabled: true}); $( "#drag_area" ).hover(function() { $( "#draggable" ).draggable({disabled: false}); }, function() { $( "#draggable" ).draggable({disabled: true}); }); //if($("#hj_cslt").offset().top > 580) $("#buyBt1").on("click", function () { $("html").animate({ scrollTop: $("#hj_pricing").offset().top - 100 }, 5000); }); $("#buyBt2").on("click", function () { $("html").animate({ scrollTop: $("#hj_pricing").offset().top - 100 }, 3000); }); $("#buyBt3").on("click", function () { window.location.href = 'https://www.hackeandojogos.com/system/checkout.php'; }); });