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

Rework the combat component #6

Open
1 of 2 tasks
SThor opened this issue Jul 3, 2020 · 2 comments
Open
1 of 2 tasks

Rework the combat component #6

SThor opened this issue Jul 3, 2020 · 2 comments

Comments

@SThor
Copy link
Owner

SThor commented Jul 3, 2020

  • Smoother animation
  • Set values for target & timer with props
@gfaugere
Copy link
Collaborator

gfaugere commented Jul 7, 2020

See eb4c469 for "Set values for target & timer with props"

@SThor
Copy link
Owner Author

SThor commented Jul 7, 2020

Regarding the first point, I see two points of possible improvement:

  • The "progress bar" element of all three of the progress button, the hover zone, and the timer component is currently made with a gradient background with a hard step between the main color (hardcoded at the moment) and the transparent background. This means that the true background before the progress bar fills can only be transparent for now and that the progress bar itself can only be a solid color or linear gradient in the same direction as the filling. Something like a stacked div with varying width may be better suited for our need.
  • That code sits entirely in the javascript code, and the length of the bar is determined only by the current value and the target value. The advantage of this is that the model and view are totally linked, but the drawback is that we don't take advantage of the smooth interpolations that css animations would allow. At the moment it isn't the main issue as we can't animate the position of a gradient step, but with a varying-width div it may be interesting.

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