Giter Site home page Giter Site logo

coreyshuman / constellation Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 2.0 880 KB

A configurable physics-based animation in JavaScript which can produce many designs and effects, including constellation-like star fields. You can interact with the animation using the mouse or multiple touch points on touch devices.

License: GNU Lesser General Public License v3.0

JavaScript 100.00%

constellation's Issues

Queued line draw are significantly slower in Firefox (Gecko)

Queued line draw performance in Gecko:
FPS: 7
image

Non-queued line draw performance in Gecko:
FPS: 62
image

Comparison: queued line draw performance in Chrome (V8):
FPS: 237
image

Comparison: non-queued line draw performance in Chrome (V8):
FPS: 150
image

Code

Most time appears to be spent in the 'moveTo()' function call here:

ctx.moveTo(line.x1, line.y1);

Possible solutions

  • Select queue or non-queued based on browser (accurate browser detection becomes a maintenance issue)
  • Troubleshoot/research moveTo() performance in Gecko and work on alternative implementation or submit fix upstream.

Touch events conflict with mobile browser built-in motions

Swiping actions in the demo conflict with browser actions, especially in chrome. For example:

  • Swiping right to open menu drawer also triggers "go back" action
  • Swiping down triggers "refresh" action
  • Swiping up triggers scroll even when not selecting the menu drawer

The usage of event.preventDefault() doesn't address the issue and triggers an error:

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See <URL>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.