--- a/svghmi/svghmi.js Fri Jul 08 11:58:10 2022 +0200
+++ b/svghmi/svghmi.js Tue Jul 12 12:12:52 2022 +0200
@@ -59,32 +59,49 @@
// Called on requestAnimationFrame, modifies DOM
var requestAnimationFrameID = null;
- // Do the page swith if any one pending
- if(page_switch_in_progress){
- if(current_subscribed_page != current_visible_page){
- switch_visible_page(current_subscribed_page);
+ if(page_fading == "pending" || page_fading == "forced"){ + if(page_fading == "pending") + svg_root.classList.add("fade-out-page"); + page_fading = "in_progress"; + if(page_fading_args.length) + switch_page(...page_fading_args); - page_switch_in_progress = false;
+ // Do the page swith if pending + if(page_switch_in_progress){ + if(current_subscribed_page != current_visible_page){ + switch_visible_page(current_subscribed_page); - if(page_fading_in_progress){
- svg_root.classList.remove("fade-out-page");
- page_fading_in_progress = false;
+ page_switch_in_progress = false; - while(widget = need_cache_apply.pop()){
+ if(page_fading == "in_progress"){ + svg_root.classList.remove("fade-out-page"); - if(jumps_need_update) update_jumps();
+ while(widget = need_cache_apply.pop()){ + if(jumps_need_update) update_jumps();
- pending_widget_animates.forEach(widget => widget._animate());
- pending_widget_animates = [];
+ pending_widget_animates.forEach(widget => widget._animate()); + pending_widget_animates = []; requestAnimationFrameID = null;
+ if(rearm) requestHMIAnimation(); function requestHMIAnimation() {
@@ -212,14 +229,17 @@
-var page_fading_in_progress = false;
+var page_fading = "off"; +var page_fading_args = "off"; function fading_page_switch(...args){
- svg_root.classList.add("fade-out-page");
- page_fading_in_progress = true;
+ if(page_fading == "in_progress") + page_fading = "forced"; + page_fading = "pending"; + page_fading_args = args;
document.body.style.backgroundColor = "black";
--- a/svghmi/widget_jump.ysl2 Fri Jul 08 11:58:10 2022 +0200
+++ b/svghmi/widget_jump.ysl2 Tue Jul 12 12:12:52 2022 +0200
@@ -145,7 +145,7 @@
- animation: fadeOut 0.6s both;
+ animation: cubic-bezier(0, 0.8, 0.6, 1) fadeOut 0.6s both;