From 51b8f56d9d224cb319d5de445600b12af127727b Mon Sep 17 00:00:00 2001 From: James Date: Mon, 21 Jun 2021 00:51:10 -0400 Subject: [PATCH] Add files via upload --- index.html | 1 + index.js | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 4970b38..c598b51 100644 --- a/index.html +++ b/index.html @@ -27,6 +27,7 @@

hi go take a break now

window.close() } }, 100); + socket.on('close', () => {window.close()}) diff --git a/index.js b/index.js index e0f72ce..d815a3f 100644 --- a/index.js +++ b/index.js @@ -19,22 +19,25 @@ app.use(express.static(__dirname)); io.on('connection', async (socket) => { socket.on('disconnect', function(){ - console.log('dcopen', active, unf) if(active && !socket.connected) bopen("http://localhost:8899"); }); socket.on('unfocused', () => { unf = true; - console.log('ufopen', active, unf) if(active && !socket.connected) bopen("http://localhost:8899"); unf = false; }) }) async function main() { + console.log("Starting break at") + console.log(new Date()) bopen("http://localhost:8899") active = true; - await delay(300000); + await delay(3000); + console.log("Ending break at") + console.log(new Date()) active = false; + io.emit('close') await delay(2400000); main() }