remove toast animations to fix green flash
This commit is contained in:
@@ -252,23 +252,15 @@ function showToast(message, type)
|
|||||||
type_class = " toast-warning"
|
type_class = " toast-warning"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Create toast with visible animation class
|
-- Create toast (no animation to avoid flash)
|
||||||
local toast_html = '<div id="active-toast" class="toast toast-visible' .. type_class .. '"><span>' .. message .. '</span></div>'
|
local toast_html = '<div id="active-toast" class="toast' .. type_class .. '"><span>' .. message .. '</span></div>'
|
||||||
container.inner_rml = toast_html
|
container.inner_rml = toast_html
|
||||||
|
|
||||||
-- Auto-hide after 2.5 seconds (start hide animation, then remove)
|
-- Auto-hide after 2.5 seconds
|
||||||
if setTimeout then
|
if setTimeout then
|
||||||
active_toast_id = setTimeout(function()
|
active_toast_id = setTimeout(function()
|
||||||
local toast = shell_document:GetElementById("active-toast")
|
container.inner_rml = ""
|
||||||
if toast then
|
active_toast_id = nil
|
||||||
-- Switch to hiding animation
|
|
||||||
toast:SetAttribute("class", "toast toast-hiding" .. type_class)
|
|
||||||
-- Remove after animation completes
|
|
||||||
setTimeout(function()
|
|
||||||
container.inner_rml = ""
|
|
||||||
active_toast_id = nil
|
|
||||||
end, 300)
|
|
||||||
end
|
|
||||||
end, 2500)
|
end, 2500)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -127,14 +127,6 @@
|
|||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-visible {
|
|
||||||
animation: 0.4s back-out toast-pop-in;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast-hiding {
|
|
||||||
animation: 0.2s quadratic-in toast-pop-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.toast-success {
|
.toast-success {
|
||||||
background-color: #4CAF50;
|
background-color: #4CAF50;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
@@ -150,17 +142,6 @@
|
|||||||
color: #000000;
|
color: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes toast-pop-in {
|
|
||||||
0% { opacity: 0; transform: translateY(50dp) scale(0.8); }
|
|
||||||
70% { transform: translateY(-5dp) scale(1.02); }
|
|
||||||
100% { opacity: 1; transform: translateY(0) scale(1.0); }
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes toast-pop-out {
|
|
||||||
from { opacity: 1; transform: translateY(0) scale(1.0); }
|
|
||||||
to { opacity: 0; transform: translateY(30dp) scale(0.9); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Dialog/Modal overlay */
|
/* Dialog/Modal overlay */
|
||||||
#dialog-overlay {
|
#dialog-overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
Reference in New Issue
Block a user