Feat: add tachyonFX animations
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
use std::cell::RefCell;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use cagire_ratatui::Sparkles;
|
||||
use tachyonfx::{fx, Effect, EffectManager, Interpolation};
|
||||
|
||||
use crate::page::Page;
|
||||
use crate::state::effects::FxId;
|
||||
use crate::state::{ColorScheme, Modal};
|
||||
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
|
||||
@@ -48,6 +52,12 @@ pub struct UiState {
|
||||
pub minimap_until: Option<Instant>,
|
||||
pub color_scheme: ColorScheme,
|
||||
pub hue_rotation: f32,
|
||||
pub effects: RefCell<EffectManager<FxId>>,
|
||||
pub modal_fx: RefCell<Option<Effect>>,
|
||||
pub title_fx: RefCell<Option<Effect>>,
|
||||
pub prev_modal_open: bool,
|
||||
pub prev_page: Page,
|
||||
pub prev_show_title: bool,
|
||||
}
|
||||
|
||||
impl Default for UiState {
|
||||
@@ -74,6 +84,12 @@ impl Default for UiState {
|
||||
minimap_until: None,
|
||||
color_scheme: ColorScheme::default(),
|
||||
hue_rotation: 0.0,
|
||||
effects: RefCell::new(EffectManager::default()),
|
||||
modal_fx: RefCell::new(None),
|
||||
title_fx: RefCell::new(Some(fx::coalesce((400, Interpolation::QuadOut)))),
|
||||
prev_modal_open: false,
|
||||
prev_page: Page::default(),
|
||||
prev_show_title: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user