From 496b66e4df7c59e71abb38c373b58c8b7134786b Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 11 Aug 2020 15:47:35 +0100 Subject: [PATCH] added layout fluid countdown --- public/js/script.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/public/js/script.js b/public/js/script.js index a1358b2db..65fa8bd1e 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -1961,6 +1961,26 @@ function startTest() { const layouts = ["qwerty", "dvorak", "colemak"]; let index = 0; index = Math.floor(time / (config.time / 3)); + + if ( + time == Math.floor(config.time / 3) - 3 || + time == (config.time / 3) * 2 - 3 + ) { + showNotification("3", 1000); + } + if ( + time == Math.floor(config.time / 3) - 2 || + time == Math.floor(config.time / 3) * 2 - 2 + ) { + showNotification("2", 1000); + } + if ( + time == Math.floor(config.time / 3) - 1 || + time == Math.floor(config.time / 3) * 2 - 1 + ) { + showNotification("1", 1000); + } + if (config.layout !== layouts[index] && layouts[index] !== undefined) { showNotification(`--- !!! ${layouts[index]} !!! ---`, 3000); }