const button = document.querySelector("#login"); button.addEventListener("click", () => { const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : window.screenX; const dualScreenTop = window.screenTop !== undefined ? window.screenTop : window.screenY; const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; const windowWidth = 350; const windowHeight = 500; const systemZoom = width / window.screen.availWidth; const left = (width - windowWidth) / 2 / systemZoom + dualScreenLeft; const top = (height - windowHeight) / 2 / systemZoom + dualScreenTop; const auth = window.open("https://repl.it/auth_with_repl_site?domain=" + location.host, "id", `toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=${windowWidth}, height=${windowHeight}, top=${top}, left=${left}, resizable=no`); });