Skip to content

Adds draggable functionality to marquee #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

waleed-salama
Copy link

This pull request introduces a new draggable functionality to the Marquee component, allowing users to drag the marquee content using mouse or touch interactions. The changes include modifications to the component's styles, properties, and event handling logic. Resolves #93.

Draggable Functionality:

  • Added new styles for draggable states in src/components/Marquee.scss:

    • .rfm-draggable for the default draggable cursor.
    • .rfm-dragging for the dragging cursor and disabling user selection.
  • Updated MarqueeProps in src/components/Marquee.tsx to include a new draggable property:

    • Added draggable property with a default value of false. [1] [2]
  • Implemented drag event handling in Marquee component:

    • Added state and refs for managing drag state, start position, and animation position.
    • Created functions for handling drag start, move, and end events, including smooth transitions using requestAnimationFrame. [1] [2]
    • Updated the component's rendering logic to apply draggable styles and event handlers conditionally. [1] [2]

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.

Request Draggable Marquee
1 participant