Expand description
Allows FLIP transitions between element positions by using provided NodeRefs from the Leptos crate.
Enums§
- Clear
Error - Might occur when clearing the styles of elements from the given node references. The single
variant, CouldNotGetHtmlElement(
Vec<T>), contains all IDs for which elements could not be obtained from the given node references. - Flip
Error - Errors that might occur when FLIPping elements. Its variants and respective purposes are as follows:
- Prepare
Flip Error - Might occur when attempting to prepare a FLIP. When trying to obtain the position for a given element, if it is not possible to get it from the node reference, will return a vector of all IDs for which this is the case.
Functions§
- prepare_
flip - Main function of this crate. Returns a
Resultwhose Ok is a pair of closures,(flip, clear), which performs the transition when an element’s position is changed, and clears the styles of the transitioned elements, respectively. The Err variant contains aPrepareFlipError, whose single variant is aCouldNotGetHtmlElement, which itself contains aVecwith all IDs for which getting an element was not possible. The reason whyprepare_fliphas to calculate the positions of the elements is to store them for later comparison with the new positions, and calculation of the element’s offset for the FLIP transition.