Skip to content

Site doesn't work on mobile devices. #2

@Spirko

Description

@Spirko

I love ManyTinyThings and look forward to using it to enlighten my physics students.

Currently ManyTinyThings.github.io doesn't work on mobile devices. Fixing this isn't too difficult:

  • Change the mouse events on the Canvas elements to pointer events. This can be done by just changing the first argument to the *.addEventListener() calls. "mousedown" becomes "pointerdown", etc. Since PointerEvent is derived from MouseEvent, the handler code still works.
  • Update the style of the simulation canvas elements to include touch-action: none; or maybe touch-action: pinch-zoom;. This prevents the browser from intercepting the pointer events for scrolling of the page. (As a side effect, the user has to scroll by dragging from outside the canvas.)

-Jeff

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions