diff --git a/serve.js b/serve.js index 72d049005..315be2097 100755 --- a/serve.js +++ b/serve.js @@ -96,7 +96,7 @@ log(chalk.red(messages('santatracker')), `[${yargs.lang}]`); // nb. matches config in release.js -const baseurl = `http://127.0.0.1:${yargs.port + 80}/`; +const baseurl = `http://127.0.0.1:${yargs.port}/`; const config = { staticScope: `${baseurl}${yargs.prefix}/`, version: `dev-${(new Date).toISOString().replace(/[^\d]/g, '')}`, @@ -118,7 +118,7 @@ async function serve() { const staticServer = polka(); staticServer.use(yargs.prefix, vfsMiddleware(vfs, 'static'), staticHost); - await listen(staticServer, yargs.port + 80, yargs.all); + await listen(staticServer, yargs.port, yargs.all); log('Static', chalk.green(config.staticScope), yargs.all ? chalk.red('(on all interfaces)') : ''); const prodServer = polka(); diff --git a/static/entrypoint.js b/static/entrypoint.js index 240990b6f..46020a89a 100644 --- a/static/entrypoint.js +++ b/static/entrypoint.js @@ -813,4 +813,5 @@ configureCustomKeys(loaderElement); // ignore } } +function()%7B(function%20()%20%7B%0A%20%20function%20isiOSPermissionRequired()%20%7B%0A%20%20%20%20return%20(%0A%20%20%20%20%20%20typeof%20DeviceMotionEvent%20!%3D%3D%20%22undefined%22%20%26%26%0A%20%20%20%20%20%20typeof%20DeviceMotionEvent.requestPermission%20%3D%3D%3D%20%22function%22%0A%20%20%20%20)%3B%0A%20%20%7D%0A%0A%20%20function%20requestPermissions()%20%7B%0A%20%20%20%20Promise.all(%5B%0A%20%20%20%20%20%20DeviceMotionEvent.requestPermission()%2C%0A%20%20%20%20%20%20DeviceOrientationEvent.requestPermission()%0A%20%20%20%20%5D)%0A%20%20%20%20%20%20.then((%5Bmotion%2C%20orientation%5D)%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20console.log(%22Motion%3A%22%2C%20motion%2C%20%22Orientation%3A%22%2C%20orientation)%3B%0A%0A%20%20%20%20%20%20%20%20if%20(motion%20%3D%3D%3D%20%22granted%22%20%7C%7C%20orientation%20%3D%3D%3D%20%22granted%22)%20%7B%0A%20%20%20%20%20%20%20%20%20%20window.dispatchEvent(new%20Event(%22motion-permission-granted%22))%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D)%0A%20%20%20%20%20%20.catch(err%20%3D%3E%20console.error(err))%3B%0A%20%20%7D%0A%0A%20%20function%20createFullscreenTapLayer()%20%7B%0A%20%20%20%20const%20overlay%20%3D%20document.createElement(%22div%22)%3B%0A%0A%20%20%20%20overlay.style.position%20%3D%20%22fixed%22%3B%0A%20%20%20%20overlay.style.top%20%3D%20%220%22%3B%0A%20%20%20%20overlay.style.left%20%3D%20%220%22%3B%0A%20%20%20%20overlay.style.width%20%3D%20%22100vw%22%3B%0A%20%20%20%20overlay.style.height%20%3D%20%22100vh%22%3B%0A%20%20%20%20overlay.style.zIndex%20%3D%20%22999999%22%3B%0A%20%20%20%20overlay.style.background%20%3D%20%22rgba(0%2C0%2C0%2C0)%22%3B%20%2F%2F%20fully%20transparent%0A%20%20%20%20overlay.style.touchAction%20%3D%20%22manipulation%22%3B%0A%20%20%20%20overlay.style.cursor%20%3D%20%22pointer%22%3B%0A%0A%20%20%20%20overlay.addEventListener(%0A%20%20%20%20%20%20%22click%22%2C%0A%20%20%20%20%20%20()%20%3D%3E%20%7B%0A%20%20%20%20%20%20%20%20requestPermissions()%3B%0A%20%20%20%20%20%20%20%20overlay.remove()%3B%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%7B%20once%3A%20true%20%7D%0A%20%20%20%20)%3B%0A%0A%20%20%20%20document.body.appendChild(overlay)%3B%0A%20%20%7D%0A%0A%20%20window.addEventListener(%22load%22%2C%20()%20%3D%3E%20%7B%0A%20%20%20%20if%20(isiOSPermissionRequired())%20%7B%0A%20%20%20%20%20%20createFullscreenTapLayer()%3B%0A%20%20%20%20%7D%20else%20%7B%0A%20%20%20%20%20%20window.dispatchEvent(new%20Event(%22motion-permission-granted%22))%3B%0A%20%20%20%20%7D%0A%20%20%7D)%3B%0A%7D)()%3B%7D)()%3B }());