[ai] Stop skeleton pulse animation on image load#74
Draft
MaggieAppleton wants to merge 1 commit into
Draft
Conversation
Adds a load event handler that adds the `loaded` class to `.image-wrapper`, which sets `animation: none` on the `::before` skeleton element. Also handles already-cached images via `img.complete`. Closes #69. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 tasks
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
Implements
Closes #69
Parent plan
#56
What changed
.image-wrapper.loaded::before { animation: none; }CSS rule to halt the pulse keyframe when the image is done loading<script>block that queries all.image-wrapperelements on the page and attaches aloadlistener to each contained<img>loadedclass (removing the animation) and fires with{ once: true }so it auto-cleans upimg.complete— the class is applied synchronously if the image is already decodedHow to verify
<BasicImage>componentspulseanimation on.image-wrapper::beforeafter the image has loadedloadevent firesNotes
{ once: true }option means the event listener removes itself after firing — no cleanup needed<script>blocks globally;querySelectorAllhandles all instances of the component on a single page