From 466b3eb2bb9bcfae840e828455ea0c35e7e92dc2 Mon Sep 17 00:00:00 2001 From: Prits001 Date: Mon, 11 Jul 2022 03:50:06 +0300 Subject: [PATCH] Changes with delay --- README.md | 3 +++ config.json | 2 ++ main.js | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc73776..bec9ebe 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,9 @@ This project was created only for good purposes and personal use. "numberOfButtons":2, #number of buttons shown(0-2) + + "loadingdelay": 5, #delay in seconds before loading + #button one name and url "button1Text":"Button One", "button1Link":"https://github.com/Prits001", diff --git a/config.json b/config.json index ba0c4bd..641cd3d 100644 --- a/config.json +++ b/config.json @@ -10,6 +10,8 @@ "numberOfButtons":2, + "loadingdelay": 5, + "button1Text":"Button One", "button1Link":"https://github.com/Prits001", diff --git a/main.js b/main.js index 848cb01..22e82aa 100644 --- a/main.js +++ b/main.js @@ -30,6 +30,7 @@ function checkConfig(){ console.log('\x1b[36m%s\x1b[0m',"[#]", "Additional info: ", "\x1b[32m"+config.additionalinfo+"\x1b[0m") console.log('\x1b[36m%s\x1b[0m',"[#]", "Text when hovering above large image icon: ","\x1b[32m"+config.largeimagetext+"\x1b[0m") console.log('\x1b[36m%s\x1b[0m',"[#]", "Ammount of buttons: ","\x1b[32m"+config.numberOfButtons+"\x1b[0m") + console.log('\x1b[36m%s\x1b[0m',"[#]", "Loading Delay: ","\x1b[32m"+config.loadingdelay+"\x1b[0m") if(config.numberOfButtons > 0){ console.log('\x1b[36m%s\x1b[0m',"[#]", "Name of the 1st button: ","\x1b[32m"+config.button1Text+"\x1b[0m") console.log('\x1b[36m%s\x1b[0m',"[#]", "Url of the 1st button: ","\x1b[32m"+config.button1Link+"\x1b[0m") @@ -38,9 +39,9 @@ function checkConfig(){ console.log('\x1b[36m%s\x1b[0m',"[#]", "Url of the 2nd button: ","\x1b[32m"+config.button2Link+"\x1b[0m") } } - console.log("Starting in 10 seconds..") + console.log(`Starting in ${config.loadingdelay} seconds..`) console.log("\x1b[46mPress Ctrl+C to abort\x1b[0m") - Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 10000); + Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, config.loadingdelay * 1000); return true } function start(){