fix and reintroduce animation exit effect

This commit is contained in:
jr-k 2024-08-01 09:50:54 +02:00
parent b89ae3b7d1
commit 02c54566a9
4 changed files with 15 additions and 7 deletions

View File

@ -43,6 +43,7 @@ class GitUpdaterController(ObController):
elif os_name == "darwin":
logging.warn('Git Updater doesn\'t supports macos dependency manager, install system dependencies manually with homebrew')
run_system_command(['git', 'config', '--global', '--add', 'safe.directory', get_working_directory()])
run_system_command(['git', '-C', get_working_directory(), 'stash'])
run_system_command(['git', '-C', get_working_directory(), 'checkout', 'master'])
run_system_command(['git', '-C', get_working_directory(), 'pull'])

View File

@ -50,7 +50,7 @@ class PlayerController(ObController):
polling_interval = int(request.args.get('polling', self._model_store.variable().get_one_by_name('polling_interval').eval()))
slide_animation_speed = request.args.get('animation_speed', self._model_store.variable().get_one_by_name('slide_animation_speed').eval()).lower()
slide_animation_entrance_effect = request.args.get('animation_effect', self._model_store.variable().get_one_by_name('slide_animation_entrance_effect').eval())
# slide_animation_exit_effect = request.args.get('slide_animation_exit_effect', self._model_store.variable().get_one_by_name('slide_animation_exit_effect').eval())
slide_animation_exit_effect = request.args.get('slide_animation_exit_effect', self._model_store.variable().get_one_by_name('slide_animation_exit_effect').eval())
return render_template(
'player/player.jinja.html',
@ -59,6 +59,7 @@ class PlayerController(ObController):
polling_interval=polling_interval,
slide_animation_enabled=animation_enabled,
slide_animation_entrance_effect=slide_animation_entrance_effect,
slide_animation_exit_effect=slide_animation_exit_effect,
slide_animation_speed=slide_animation_speed,
animation_speed_duration=animation_speed_duration,
)

View File

@ -129,7 +129,7 @@ class VariableManager:
### Player Animation
{"name": "slide_animation_enabled", "section": self.t(VariableSection.PLAYER_ANIMATION), "value": False, "type": VariableType.BOOL, "editable": True, "description": self.t('settings_variable_desc_slide_animation_enabled'), "refresh_player": True},
{"name": "slide_animation_entrance_effect", "section": self.t(VariableSection.PLAYER_ANIMATION), "value": AnimationEntranceEffect.FADE_IN.value, "type": VariableType.SELECT_SINGLE, "editable": True, "description": self.t('settings_variable_desc_slide_animation_entrance_effect'), "selectables": enum_to_dict(AnimationEntranceEffect), "refresh_player": True},
# {"name": "slide_animation_exit_effect", "section": self.t(VariableSection.PLAYER_ANIMATION), "value": AnimationExitEffect.NONE.value, "type": VariableType.SELECT_SINGLE, "editable": True, "description": self.t('settings_variable_desc_slide_animation_exit_effect'), "selectables": enum_to_dict(AnimationExitEffect), "refresh_player": True},
{"name": "slide_animation_exit_effect", "section": self.t(VariableSection.PLAYER_ANIMATION), "value": AnimationExitEffect.NONE.value, "type": VariableType.SELECT_SINGLE, "editable": True, "description": self.t('settings_variable_desc_slide_animation_exit_effect'), "selectables": enum_to_dict(AnimationExitEffect), "refresh_player": True},
{"name": "slide_animation_speed", "section": self.t(VariableSection.PLAYER_ANIMATION), "value": AnimationSpeed.NORMAL.value, "type": VariableType.SELECT_SINGLE, "editable": True, "description": self.t('settings_variable_desc_slide_animation_speed'), "selectables": self.t(AnimationSpeed), "refresh_player": True},
### Fleet Management

View File

@ -65,8 +65,7 @@
const animation_speed_duration = {{ animation_speed_duration[slide_animation_speed] if slide_animation_enabled else 0 }};
const animate_transitions = [
"animate__{{ slide_animation_entrance_effect|default("fadeIn") }}",
"animate__none"
{#"animate__{{ slide_animation_exit_effect|default("none") }}"#}
"animate__{{ slide_animation_exit_effect|default("none") }}"
];
// Slide flow management
@ -296,13 +295,20 @@
if (animate) {
nextSlide.classList.add('animate__animated', animate_transitions[0], animate_speed);
nextSlide.onanimationend = function() {
nextSlide.classList.remove(animate_transitions[0], animate_speed);
loadingNextSlide();
nextSlide.classList.remove(animate_transitions[0], animate_transitions[1], animate_speed);
if (animate_transitions[1] === 'animate__none') {
loadingNextSlide();
}
};
curSlide.classList.add('animate__animated', animate_transitions[1], animate_speed);
curSlide.onanimationend = function() {
curSlide.classList.remove(animate_transitions[1], animate_speed);
curSlide.classList.remove(animate_transitions[1], animate_transitions[0], animate_speed);
if (animate_transitions[1] !== 'animate__none') {
setTimeout(function() {
loadingNextSlide();
}, 100);
}
};
} else {
loadingNextSlide();