Skip to content

Site doesn't work on mobile devices. #2

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

Activity

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

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