Smooth transition

This commit is contained in:
city-unit 2023-10-20 22:31:57 -04:00
parent b8939b8ccb
commit 95a3021e53
1 changed files with 16 additions and 2 deletions

View File

@ -8104,8 +8104,22 @@ jQuery(async function () {
$(document).on("click", function (e) { $(document).on("click", function (e) {
// Check if the click was outside the relevant elements // Check if the click was outside the relevant elements
if (!$(e.target).closest('.extraMesButtons, .extraMesButtonsHint').length) { if (!$(e.target).closest('.extraMesButtons, .extraMesButtonsHint').length) {
$('.extraMesButtonsHint').show().css('opacity', .2); // Reset the hint button to its original state // Transition out the .extraMesButtons first
$('.extraMesButtons').hide().css('opacity', 0); // Hide the extra buttons and reset their opacity $('.extraMesButtons').transition({
opacity: 0,
duration: 150,
easing: 'ease-in-out',
complete: function () {
$(this).hide(); // Hide the .extraMesButtons after the transition
// Transition the .extraMesButtonsHint back in
$('.extraMesButtonsHint').show().transition({
opacity: .2,
duration: 150,
easing: 'ease-in-out'
});
}
});
} }
}); });