Tuesday 30 October 2018

Hacktoberfest Fourth Pull Request

For my fourth pull request I choose small project. It's a guess number game: user should guess a number in given range. When user types wrong number, he gets hints.
Try it

What I did

I tried playing this game and didn't like how "Show Hints" slider works. So, I decided to change it.
Before changes slider changed his state in the following case:

  • you clicked and released button inside slider
After changes:

  • you clicked inside slider and released button in the same coordinate
  • or you clicked inside slider, moved mouse to the correct side and released button
That's, for exampe, if slider is inactive, you click on it, move mouse to the left, and release button, slider will not change its state
Now, slider behaves like real slider (pull request is not merged yet)

This slider is using a Bootstrap class that defines its design and behaviour. The problem was that I did not want to change its design, so I did not remove a Bootstrap class. And because I didn't remove a Bootstrap class, I did not cancel its behaviour. That's, I had to write code "above that class" (default behaviour + my code = desired behaviour).

Links

No comments:

Post a Comment