nrandecker / particle

A simple portfolio Jekyll theme:
https://nrandecker.github.io/particle/
MIT License
1.04k stars 1.1k forks source link

Fix mouse click y offset #34

Closed j3soon closed 5 years ago

j3soon commented 6 years ago

When clicking on the top particle space when scrolled, the newly created particle will be at the wrong spot. Originally the particle will be created by the y value with respect to the viewport. After this fix, the particle will be created by the y value with respect to the canvas.

j3soon commented 6 years ago

Currently this fix works when using gulp command on localhost. However it doesn't work on git pages...

nrandecker commented 6 years ago

I’ll look into it thanks for your work.

j3soon commented 6 years ago

It now works on github pages. It seems like there are 2 particleJS config in this repo, app.js and main.js. I think the gulp command uses the app.js and github pages uses the main.js file.

See here for an working sample.

j3soon commented 5 years ago

Hi, I really like this template, but I think this small bug isn't fixed yet.

The problem occurs when the user scrolls the page and start clicking their mouse. I've made a short GIF below for your reference. (The first one is the master branch, the second one is the code I wish to merge)

Basically the code only changes "detect_on": "window" to "detect_on": "canvas", so I think merging this won't affect other functions.

scroll-bug

nrandecker commented 5 years ago

Yes, sorry I closed this by mistake I'm testing your changes now.

j3soon commented 5 years ago

Thanks!

nrandecker commented 5 years ago

The change was a bit hard to test but I believe it fixed the problem. Thanks for your work. 👍

j3soon commented 5 years ago

Yes, I also believe that the problem is fixed. However, I think the GitHub pages are not updated yet. Maybe you need to set the GitHub page source to the master branch, or merge master into gh-pages branch.