mrhut10 / todaysCuriosity

a set of single_image_processing effects inspired by the art work by Kensuke Koike. See live demo on
https://todayscuriosity.netlify.com/
5 stars 9 forks source link

Remove settors, optimize slider updating #9

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi bro,

So don't know if you noticed (maybe I should have created an issue) but the first time you moved a slider after loading an image noting would happen, but it would work after that. This first slider move also put an error in the console. I was able to figure out that the error was from the reductionRatio being 0, but did end up tracking down why it's wasn't being set correctly on init.

But then I started reading about gettors and settors in ES6 classes and came to the following opinionated conclusion, tell me what you think.

gettors and settors in JS are kinda usless since everything is public and it's not worth the effort of using closures to make things public, If you want to write an unbreakable library, don't use JS. For now we'll instead concentrate on making the public interface clear is '_' notation for private things, (TODO). This commits removes settors.

Also on a separate note to settors, slider changes was updating every slider on the page instead of using the event and focusing on the slider that changed, now fixed. though there are two distinct things happening in this PR, I probably should have made two. Sorry.

ghost commented 6 years ago

fixes https://github.com/mrhut10/todaysCuriosity/issues/10#issue-360553121

mrhut10 commented 6 years ago

I'm going to quickly make a change in a PR where you are appending the elements to the page.