MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / animation_progress

Method animation_progress

crates/opencode-tui/src/components/toast.rs:141–152  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

139 }
140
141 fn animation_progress(&self) -> f32 {
142 if self.message.is_none() {
143 return 0.0;
144 }
145
146 match self.phase {
147 ToastPhase::Entering => progress_ratio(self.phase_elapsed_ms, TRANSITION_MS),
148 ToastPhase::Visible => 1.0,
149 ToastPhase::Exiting => 1.0 - progress_ratio(self.phase_elapsed_ms, TRANSITION_MS),
150 }
151 .clamp(0.0, 1.0)
152 }
153}
154
155impl Default for Toast {

Callers 2

slide_offsetMethod · 0.80
renderMethod · 0.80

Calls 1

progress_ratioFunction · 0.85

Tested by

no test coverage detected