fix: correct marquee animation direction and improve smoothness#25
fix: correct marquee animation direction and improve smoothness#25madhavansingh wants to merge 2 commits intoAOSSIE-Org:mainfrom
Conversation
WalkthroughUpdates marquee rendering and animation in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
I’ve fixed the marquee animation issue (#24). The scrolling now flows smoothly and no longer starts from the center. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/Pages/Demo/marqu.tsx`:
- Around line 34-43: The marquee's infinite motion should respect the user's
reduced-motion preference: import useReducedMotion from 'framer-motion', call it
(e.g., const isReducedMotion = useReducedMotion()) and conditionally disable or
simplify the animation props on the motion.div (the element currently using
initial, animate, and transition). If isReducedMotion is true, remove the
infinite repeat (set repeat to 0 or omit transition/animate) and keep a static
or subtle non-moving state (e.g., use initial only), otherwise keep the existing
animate/transition with duration:45, ease:"linear", repeat:Infinity. Ensure the
hook is used in the same component that renders the motion.div so the animation
props are set based on isReducedMotion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 62a6b7a6-b503-4056-aa8c-799f45622d96
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (1)
src/Pages/Demo/marqu.tsx
|
Added support for reduced motion preference and updated animation accordingly. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/Pages/Demo/marqu.tsx (1)
27-77:⚠️ Potential issue | 🟠 MajorPrevent screen readers from reading duplicated marquee items 16×.
The repeated visual track is decorative, but currently exposed semantically; assistive tech may announce the same tags many times. Hide the animated track and provide one accessible list.
Proposed fix
<motion.div + aria-hidden="true" className="flex w-max items-center" initial={shouldReduceMotion ? undefined : { x: "-50%" }} animate={shouldReduceMotion ? { x: 0 } : { x: "0%" }} @@ {duplicatedTechnologies.map((tech, index) => ( @@ ))} </motion.div> + <ul className="sr-only"> + {technologies.map((tech) => ( + <li key={tech.text}>{tech.text}</li> + ))} + </ul>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Pages/Demo/marqu.tsx` around lines 27 - 77, The repeated marquee track is decorative and being announced repeatedly; mark the animated duplicate track and its repeated items as presentation (add aria-hidden="true" on the motion.div that renders duplicatedTechnologies and on each duplicated item/motion.span, and ensure they are not focusable e.g., tabIndex={-1}). Then render a single accessible list (e.g., a semantic <ul> with one mapping over technologies to produce <li> entries, include an appropriate aria-label or visually-hidden heading) so screen readers only encounter one set. Update references: duplicatedTechnologies, the motion.div container rendering duplicatedTechnologies, each motion.span and the duplicated <div> item, and create a single accessible <ul> that maps the original technologies array.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/Pages/Demo/marqu.tsx`:
- Around line 27-77: The repeated marquee track is decorative and being
announced repeatedly; mark the animated duplicate track and its repeated items
as presentation (add aria-hidden="true" on the motion.div that renders
duplicatedTechnologies and on each duplicated item/motion.span, and ensure they
are not focusable e.g., tabIndex={-1}). Then render a single accessible list
(e.g., a semantic <ul> with one mapping over technologies to produce <li>
entries, include an appropriate aria-label or visually-hidden heading) so screen
readers only encounter one set. Update references: duplicatedTechnologies, the
motion.div container rendering duplicatedTechnologies, each motion.span and the
duplicated <div> item, and create a single accessible <ul> that maps the
original technologies array.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: ecdfd508-baca-47ea-9c3f-9682f3210419
📒 Files selected for processing (1)
src/Pages/Demo/marqu.tsx
Addressed Issues:
Fixes #24
Screen Recordings:
Before:
Screen.Recording.2026-03-18.at.3.43.04.PM.mov
After:
Screen.Recording.2026-03-18.at.6.53.39.PM.mov
Additional Notes:
Checklist
Summary by CodeRabbit