Refactor AnimationToken
for Cleaner Structure and Flexible Timing
#72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR improves the
AnimationToken
class and related logic.Here’s what’s changed:
NamedTuple
with@dataclass
forAnimationFrame
, this allows future extensibility and enforces immutability withfrozen=True
AnimationToken
constructor and logic: cleaned up how frames are stored, removing unnecessary re-wrapping and simplified frame indexing using modulo arithmetic for loopingloop
flag, users can now choose whether the animation repeats or plays oncedone
flag, signals when a non-looping animation is finished, preventing further advancementupdate()
method, allows animations to self-update based on elapsed time, making frame progression consistent regardless of frame rate or lag__slots__
, keeps memory usage optimized while the class expands in capabilityAnimationToken.update()
andloop=True
, creating smoother visual transitionspyproject.toml
to include thepyscroll
package explicitly, fixing editable installs and restoring demo functionality during development (split out in Cleanup legacy build files and add Makefile for tooling #71)