Animation framework + Window open/close animations#131
Open
corradedied wants to merge 1 commit into
Open
Conversation
Implemented animation toggle framework and added support for animation toggling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Animation Framework
Adds
Library.Animations(defaultfalse), a single global toggle gating all UI animation in Obsidian, set viaCreateWindow({ Animations = true }). This is meant to be the on/off switch for every animation added going forward, not just one feature — each future animation checksLibrary.Animationsbefore tweening and falls back to the current instant behavior when it's off, so there's one flag for the user instead of one per animation. This PR only adds the window open/close fade. At a later date, more animations will be added in a different PR, including:Window Open/Close
When
Library.Animationsis enabled, toggling the window cross-fades every visible element instead of snappingVisibleinstantly — same technique as Linoria's toggle fade (per-descendant transparency tween, with a cached value to restore to on open).Why a per-descendant cache instead of a flat tween:
BackgroundTransparency/TextTransparencyalready vary per element (selected tab, slider fill, hover state), so fade-in can't target a flat0— it has to restore each element's actual prior value.Why the cache refreshes on every close, not just once: dynamic elements like the selected tab change after the first capture. Caching once and reusing forever could restore stale state on reopen — wrong tab shown as "selected," or the active tab's highlight failing to fade because the cache thought it was already transparent. Fixed by re-capturing the live value every close.
Why backgrounds needed handling on

TextButton/ImageButtontoo: buttons, sliders, and tabs are built onTextButtonbases with realBackgroundColor3fills, not just text containers — treating "has background" and "is text/image" as mutually exclusive silently skipped fading their backgrounds.