$(document).ready(function(){ $(function () { $.nette.init(); }); AOS.init(); $(".hp-intro").slick({ arrows: true, dots: false, infinite: true, autoplay: false, // autoplaySpeed: 2500, adaptiveHeight: true }); function randRange(data) { var newTime = data[Math.floor(data.length * Math.random())]; return newTime; } function toggleSomething() { var timeArray = new Array(200, 300, 150, 250, 2000, 3000, 1000, 1500); // var timeArray = new Array(2, 30, 15, 25, 200, 300, 100, 150); // do stuff, happens to use jQuery here (nothing else does) var hxsparent = document.getElementById('intro-bg-hxs'); // hxsparent.children[Math.floor(7 * Math.random())].style.width = Math.floor(40 * Math.random() + 10) + "px"; if(hxsparent !== null) { hxsparent.children[Math.floor(7 * Math.random())].style.transform = "rotate(" + Math.floor(80 * Math.random() - 40) + "deg)"; // hxsparent.children[Math.floor(7 * Math.random())].style.transform = "rotate(" + Math.floor(160 * Math.random() - 80) + "deg)"; } clearInterval(timer); timer = setInterval(toggleSomething, randRange(timeArray)); } var timer = setInterval(toggleSomething, 1000); }); document.getElementById("to-top").addEventListener("click", topFunction); // window.onload = function () { // if(document.getElementById('hide-check').innerHTML) { // document.getElementById('hide-checked').style.display = 'none' // }; // }; function show(child) { var elements = document.getElementsByClassName('main-categories-children'); for (x = 0; x < elements.length; x++) { elements[x].classList.remove('active'); } document.getElementById(child).classList.add('active'); } // When the user scrolls down 20px from the top of the document, show the button window.onscroll = function() {scrollFunction()}; function scrollFunction() { if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) { document.getElementById("to-top").style.display = "block"; } else { document.getElementById("to-top").style.display = "none"; } } // When the user clicks on the button, scroll to the top of the document function topFunction() { document.body.scrollTop = 0; // For Safari document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera } function ScrollTo(name) { // init thread ScrollToResolver(document.getElementById(name)); // $([document.documentElement, document.body]).animate({ // scrollTop: $("#" + name).offset().top // }, 2000); } function ScrollToResolver(elem) { // todo var jump = parseInt((elem.getBoundingClientRect().top * .2) - 10); document.body.scrollTop += jump; document.documentElement.scrollTop += jump; // lastjump detects anchor unreachable, also manual scrolling to cancel animation if scroll > jump if (!elem.lastjump || elem.lastjump > Math.abs(jump)) { elem.lastjump = Math.abs(jump); setTimeout(function() { ScrollToResolver(elem); }, "25"); } else { elem.lastjump = null; } } /* Set the width of the side navigation to 250px and the left margin of the page content to 250px and add a black background color to body */ function openNav() { document.getElementById("mySidenav").style.marginLeft = "0"; // document.getElementById("main").style.marginLeft = "100%"; document.body.style.backgroundColor = "rgba(0,0,0,0.4)"; } /* Set the width of the side navigation to 0 and the left margin of the page content to 0, and the background color of body to white */ function closeNav() { document.getElementById("mySidenav").style.marginLeft = "-100%"; // document.getElementById("main").style.marginLeft = "0"; document.body.style.backgroundColor = "white"; } function switchPositionForm(contents){ if (document.getElementById('positions-form').style.display == 'none') { document.getElementById('position-list').style.display = 'none'; document.getElementById('positions-form').style.display = 'block'; document.getElementById('frm-positionForm-basics-position').innerHTML = contents; } else { document.getElementById('position-list').style.display = 'block'; document.getElementById('positions-form').style.display = 'none'; document.getElementById('frm-positionForm-basics-position').innerHTML = ''; }; }; function switchBtn(){ var els = document.getElementsByClassName('openPositionFormBtn'); for(x = 0; x < els.length; x++) { if (els[x].innerHTML == 'I am interested') { els[x].innerHTML = 'Back'; els[x].classList.add('opened'); } else if (els[x].innerHTML == 'Back') { els[x].innerHTML = 'I am interested'; els[x].classList.remove('opened') } } } function rotateSpan(element) { if (element.children[0].style.transform == '') { element.children[0].style.transform = 'rotate(90deg)'; } else { element.children[0].style.transform = ''; } } function removeFlash(element) { element.parentElement.remove(); }