Skip to content

feat(cursor): improve animated cursor accessibility and performance (…#486

Open
NirajK017 wants to merge 1 commit intoRamakrushnaBiswal:mainfrom
NirajK017:feat/animated-cursor-accessibility-issue-273
Open

feat(cursor): improve animated cursor accessibility and performance (…#486
NirajK017 wants to merge 1 commit intoRamakrushnaBiswal:mainfrom
NirajK017:feat/animated-cursor-accessibility-issue-273

Conversation

@NirajK017
Copy link
Copy Markdown

@NirajK017 NirajK017 commented Sep 28, 2025

…hover-only, reduced-motion)\n\n- Scope cursor hiding to hover-capable, fine pointers\n- Respect prefers-reduced-motion to disable animations\n- Keep existing cursor types and trail effects intact\n\nRefs: #273

Summary by CodeRabbit

  • New Features
    • Introduces an animated cursor with a teardrop shape and a subtle trailing effect.
    • Context-aware cursor styles for links, buttons, inputs, navigation, and hero sections.
    • Interactive states for hover and click with pulses, ripples, and glow effects.
  • Style
    • Smooth gradients, shadows, and animations for a polished, responsive feel.
    • Automatically hides on mobile and respects reduced-motion settings for accessibility.

…hover-only, reduced-motion)\n\n- Scope cursor hiding to hover-capable, fine pointers\n- Respect prefers-reduced-motion to disable animations\n- Keep existing cursor types and trail effects intact\n\nRefs: RamakrushnaBiswal#273
@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 28, 2025

@NirajK017 is attempting to deploy a commit to the bunty's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown
Contributor

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 28, 2025

Walkthrough

Introduces a CSS-based animated cursor system with a primary conical cursor, trailing element, and stateful variants (hover, clicking, and type-specific: link, button, input, nav, hero). Includes multiple keyframe animations, pseudo-element effects, responsive/mobile fallbacks, and prefers-reduced-motion handling.

Changes

Cohort / File(s) Summary
Animated cursor CSS
frontend/src/components/AnimatedCursor.css
Adds base animated cursor and trail, pseudo-element glows, state modifiers (hover/click), type-specific variants (link/button/input/nav/hero), multiple keyframes (pulse/trail/hover/click/nav/hero/ripple/glow), responsive mobile hide, and reduced-motion overrides.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I dipped my paws in gradients bright,
A teardrop spark to chase the night—
Trails that twirl where cursors roam,
Ripples bloom like frothy foam.
Hush, on phones I softly hide;
In gentle motion, I rabbit-glide. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the primary change by specifying it as a feature (“feat(cursor)”) that improves animated cursor accessibility and performance, aligning directly with the PR’s objectives to scope cursor hiding to hover-capable devices and respect reduced-motion preferences.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 997f924 and c57803d.

📒 Files selected for processing (1)
  • frontend/src/components/AnimatedCursor.css (1 hunks)

Comment on lines +105 to +123
@keyframes pulse {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
}

@keyframes trailPulse {
0%, 100% {
transform: scale(1);
opacity: 0.3;
}
50% {
transform: scale(1.1);
opacity: 0.2;
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Animated cursor loses positioning whenever pulse/trailPulse runs

Both keyframes overwrite the whole transform property with just a scale. As soon as the animation ticks, we drop the translate(-50%, -50%) rotate(45deg) that keeps the cursor aligned with the pointer, so the cursor and trail jump away from the pointer (top-left anchored) and flicker orientation. This breaks the feature on every hover-capable device.

Please preserve the base translate/rotate in each keyframe:

 @keyframes pulse {
- 0%, 100% {
-    transform: scale(1);
-  }
- 50% {
-    transform: scale(1.05);
-  }
+  0%, 100% {
+    transform: translate(-50%, -50%) rotate(45deg) scale(1);
+  }
+  50% {
+    transform: translate(-50%, -50%) rotate(45deg) scale(1.05);
+  }
 }
 
 @keyframes trailPulse {
-  0%, 100% {
-    transform: scale(1);
+  0%, 100% {
+    transform: translate(-50%, -50%) rotate(45deg) scale(1);
     opacity: 0.3;
   }
   50% {
-    transform: scale(1.1);
+    transform: translate(-50%, -50%) rotate(45deg) scale(1.1);
     opacity: 0.2;
   }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@keyframes pulse {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
}
@keyframes trailPulse {
0%, 100% {
transform: scale(1);
opacity: 0.3;
}
50% {
transform: scale(1.1);
opacity: 0.2;
}
}
@keyframes pulse {
0%, 100% {
transform: translate(-50%, -50%) rotate(45deg) scale(1);
}
50% {
transform: translate(-50%, -50%) rotate(45deg) scale(1.05);
}
}
@keyframes trailPulse {
0%, 100% {
transform: translate(-50%, -50%) rotate(45deg) scale(1);
opacity: 0.3;
}
50% {
transform: translate(-50%, -50%) rotate(45deg) scale(1.1);
opacity: 0.2;
}
}
🤖 Prompt for AI Agents
In frontend/src/components/AnimatedCursor.css around lines 105 to 123, the pulse
and trailPulse keyframes overwrite the entire transform so the base
translate(-50%,-50%) rotate(45deg) is lost during animation; update every
keyframe step to include the base translate and rotate while applying scale (and
opacity for trailPulse) — e.g. use transform: translate(-50%,-50%) rotate(45deg)
scale(... ) at 0%, 50% and 100% (and keep opacity changes only in trailPulse) so
the cursor stays positioned and oriented while pulsing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant