From a52a9e56e082361acc1650190a8d0b48b328b6fc Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 18 Jul 2023 15:47:33 +0800 Subject: [PATCH] better UI feedback for prompt msg --- static/app.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/static/app.js b/static/app.js index f8e7ed5..d2f1076 100755 --- a/static/app.js +++ b/static/app.js @@ -3161,10 +3161,30 @@ function updateCryptoPorftolio() { // SAVE FEATURES TO DISPLAY PROMPT FUNCTIONS +var savePromptTimeout; +var isSavePromptRunning = false; function displaySavePrompt() { + // Check if the function is already running + if (isSavePromptRunning) { + return; + } + isSavePromptRunning = true; document.getElementById('save-prompt-message').style.display = "block"; + var savePrompt = document.getElementById('save-prompt-p'); + // Store the original color + var originalColor = savePrompt.style.color; + // Set the new color for the transition effect + savePrompt.style.color = "yellow"; + // Clear any existing timeout + clearTimeout(savePromptTimeout); + // Add a delay before reverting back to the original color + savePromptTimeout = setTimeout(function() { + savePrompt.style.color = originalColor; + isSavePromptRunning = false; + },300); // 0.3 seconds } + function closeSavePrompt() { document.getElementById('save-prompt-message').style.display = "none"; }