From 69240d41b0c2512d0b5b37901a6eeb681c37eaca Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 7 Feb 2015 10:45:56 -0800 Subject: [PATCH] Offset the timing of the pulsing animation --- Marlin/configurator/js/configurator.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Marlin/configurator/js/configurator.js b/Marlin/configurator/js/configurator.js index aa363cfe0b..a31b908c5c 100644 --- a/Marlin/configurator/js/configurator.js +++ b/Marlin/configurator/js/configurator.js @@ -62,7 +62,8 @@ var configuratorApp = (function(){ therms_list = {}, total_config_lines, total_config_adv_lines, - hover_timer; + hover_timer, + pulse_offset = 0; // Return this anonymous object as configuratorApp return { @@ -142,12 +143,13 @@ var configuratorApp = (function(){ $('#message').prepend($err); var baseColor = $err.css('color').replace(/rgba?\(([^),]+,[^),]+,[^),]+).*/, 'rgba($1,'); var d = new Date(); - err.startTime = d.getTime(); + err.pulse_offset = (pulse_offset += 200); + err.startTime = d.getTime() + pulse_offset; err.pulser = setInterval(function(){ d = new Date(); - var pulse_time = (d.getTime() - err.startTime); + var pulse_time = d.getTime() + err.pulse_offset; $err.css({color:baseColor+(0.5+Math.sin(pulse_time/200)*0.4)+')'}); - if (pulse_time > 5000) { + if (pulse_time - err.startTime > 5000) { clearInterval(err.pulser); $err.remove(); }