textcursors upgrade#52
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades the Text and Cursors sections to use the shared HorizontalGallery + AnimationsLibrary pipeline (matching other categories like Buttons/Forms), and updates several cursor animations to render their fixed-position cursor effects via portals so they aren’t clipped by gallery/card overflow.
Changes:
- Refactors
TextandCursorspages to build gallery items fromgetAnimationsByCategory(...)and render viaHorizontalGallery. - Moves multiple cursor “overlay” DOM nodes (fixed cursor dots/squares) to
document.bodyusingcreatePortal, and adjusts container targeting away from.animation-containerqueries. - Adds additional Text animations to
AnimationsLibraryandGalleryAnimationso they can be opened in the live editor route.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/components/Text/Text.jsx | Replaces slider/code-view UI with HorizontalGallery items sourced from AnimationsLibrary (Text category). |
| frontend/src/components/Text/Text.scss | Removes legacy slider/code styles; keeps base subpage layout + full-viewport container behavior. |
| frontend/src/components/Cursors/Cursors.jsx | Replaces slider/code-view UI with HorizontalGallery items sourced from AnimationsLibrary (Cursors category). |
| frontend/src/components/Cursors/Cursors.scss | Removes legacy slider/code styles; keeps base subpage layout + full-viewport container behavior. |
| frontend/src/components/Cursors/CursorAnimations/TrailingDots/TrailingDots.jsx | Uses a ref container + portals cursor wrapper into document.body; adds scroll handling. |
| frontend/src/components/Cursors/CursorAnimations/TrailingDots/TrailingDots.scss | Moves fixed cursor wrapper styling to top-level to match portal rendering. |
| frontend/src/components/Cursors/CursorAnimations/RainingSquares/RainingSquares.jsx | Uses a ref container + portals squares wrapper into document.body; adjusts parent container resolution. |
| frontend/src/components/Cursors/CursorAnimations/RainbowAura/RainbowAura.jsx | Portals cursor element into document.body and hides cursor on scroll. |
| frontend/src/components/Cursors/CursorAnimations/RainbowAura/RainbowAura.scss | Moves .ra-cursor to top-level so styles apply when rendered via portal. |
| frontend/src/components/Cursors/CursorAnimations/DotTrail/DotTrail.jsx | Portals cursor dot into document.body and adds scroll handling for inside-state reset. |
| frontend/src/components/Cursors/CursorAnimations/DotTrail/DotTrail.scss | Moves .dt-cursor-dot to top-level so styles apply when rendered via portal. |
| frontend/src/components/Cursors/CursorAnimations/ColorCircles/ColorCircles.jsx | Switches container targeting to a local ref instead of querying .animation-container. |
| frontend/src/components/Cursors/CursorAnimations/ColorCircles/ColorCircles.scss | Removes pointer-events: none from the container so enter/leave tracking works. |
| frontend/src/components/Animation/GalleryAnimation.jsx | Adds live-editor metadata (id + raw JSX/SCSS) for additional Text animations. |
| frontend/src/AnimationsLibrary.jsx | Registers additional Text animations and their raw source for gallery/live-editor use. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -132,23 +140,26 @@ const TrailingDots = () => { | |||
| }, [isMouseInsideContainer]); | |||
Comment on lines
45
to
52
| useEffect(() => { | ||
| parentAnimationContainerRef.current = document.querySelector('.cursors-container .animation-container'); | ||
| parentAnimationContainerRef.current = containerRef.current; | ||
| const currentParentContainer = parentAnimationContainerRef.current; | ||
|
|
||
| if (!currentParentContainer) { | ||
| console.warn("RainingSquares: Parent '.animation-container' not found."); | ||
| return; | ||
| } | ||
| if (!currentParentContainer) return; | ||
|
|
||
| parentContainerBoundsRef.current = currentParentContainer.getBoundingClientRect(); | ||
|
|
Comment on lines
49
to
58
| currentContainer.addEventListener('mouseenter', handleMouseEnter); | ||
| currentContainer.addEventListener('mouseleave', handleMouseLeave); | ||
|
|
||
| const handleWindowScroll = () => { | ||
| isMouseInsideRef.current = false; | ||
| }; | ||
| window.addEventListener('scroll', handleWindowScroll, true); | ||
| window.addEventListener('mousedown', handleGlobalMouseDown); | ||
| window.addEventListener('mouseup', handleGlobalMouseUp); | ||
|
|
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.
No description provided.