diff --git a/src/main/assets/apps/shell/shell.lua b/src/main/assets/apps/shell/shell.lua index 1e80610..7f95afd 100644 --- a/src/main/assets/apps/shell/shell.lua +++ b/src/main/assets/apps/shell/shell.lua @@ -60,6 +60,12 @@ function loadAppContent_internal(app_id, app_path, skip_animation) -- Load app content using C++ function if loadAppContent then + -- Set opening animation BEFORE loading content to prevent flash + if not skip_animation then + app_container:SetClass("app-opening", true) + app_container:SetClass("app-closing", false) + end + local success = loadAppContent(app_container, app_path) showLoading(false) @@ -68,16 +74,11 @@ function loadAppContent_internal(app_id, app_path, skip_animation) current_app_path = app_path print("[Shell] App loaded: " .. app_id) - -- Play opening animation (unless skipped for initial load) - if not skip_animation then - app_container:SetClass("app-opening", true) - app_container:SetClass("app-closing", false) - -- Remove animation class after it completes - if setTimeout then - setTimeout(function() - app_container:SetClass("app-opening", false) - end, 300) - end + -- Remove animation class after it completes + if not skip_animation and setTimeout then + setTimeout(function() + app_container:SetClass("app-opening", false) + end, 300) end -- If home was loaded, populate apps dynamically @@ -144,7 +145,8 @@ local function playCloseAnimation(callback) app_container:SetClass("app-closing", true) app_container:SetClass("app-opening", false) setTimeout(function() - app_container:SetClass("app-closing", false) + -- Don't remove app-closing yet - callback will load new content + -- and loadAppContent_internal will switch to app-opening if callback then callback() end end, 200) else diff --git a/src/main/assets/apps/shell/shell.rml b/src/main/assets/apps/shell/shell.rml index 5541719..31b55e6 100644 --- a/src/main/assets/apps/shell/shell.rml +++ b/src/main/assets/apps/shell/shell.rml @@ -58,6 +58,9 @@ .app-closing { animation: 0.2s quadratic-in app-close; + /* Keep at end state after animation */ + opacity: 0; + transform: scale(0.8); } @keyframes app-open {