Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to change the angle with the mouse #8

Open
captainbrosset opened this issue Apr 16, 2015 · 4 comments
Open

Make it possible to change the angle with the mouse #8

captainbrosset opened this issue Apr 16, 2015 · 4 comments

Comments

@captainbrosset
Copy link
Owner

Dragging the gradient-line edges would be a good way to do this.
Maybe also dragging from the angle arc could work.

@mirceapiturca
Copy link

I've implemented a drag function for this. I've added a rotate handle at one end of the gradient line. Not really happy on how it moves as the offset is off at certain angles. Maybe the handle should be added at both ends and look more like the color label.
http://codepen.io/mircea/pen/MwgKaZ

If the code looks right to you I can make a pull.
Thanks

@captainbrosset
Copy link
Owner Author

Maybe the handle should be added at both ends and look more like the color label.

Yes, I was about to propose: what about making the 2 end points of the gradient line draggable instead? which is the same thing.

I'll take a look at the code. Thanks for helping.

@mirceapiturca
Copy link

Sure will do that.
I do not like the position. Looking into your color label position function to see how you've added the labels.

As far as the code goes, I had to use few global variables. I would usually create a closure or abject for the drag. I guess that if this goes into DevTools it will be in its own window.
Its a fun and cool thing you made there.

@captainbrosset
Copy link
Owner Author

Thanks!
Yeah, eventually, when this goes into devtools, it will either be in its own window, or a commonjs-style module, so no sweat about the global variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants