Skip to content

Support Touch Events for Mobile Drag and Drop #2168

Description

@nishtha-agarwal-211

Description

Add touch support to the chess board pieces, allowing mobile and tablet users to drag and drop pieces to make moves.

Goals

  • Make the Chess Opening Trainer responsive and fully interactive on mobile devices.
  • Prevent default scrolling when dragging pieces on touch screens.

Technical Details & Files to Modify

  • JavaScript: opening_trainer.js
    • Bind touchstart, touchmove, and touchend events to the chess pieces.
    • Track touch coordinates relative to the viewport, map the touch position to the nearest .square element, and trigger makeUserMove upon touch release.
  • CSS: opening_trainer.css
    • Ensure piece images have touch-action: none applied during active dragging to avoid page panning.

Acceptance Criteria

  • Users can touch and drag pieces smoothly on mobile devices.
  • Releasing a piece on a valid square triggers the move validation system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GSSoCUnder GirlScript Summer of CodeenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions