Open ghost opened 6 years ago
Trying to write down my thinking on how to animate in CSS & JavaScript
var width = document.getElementById('square selected').offsetWidth;
-Toggle classlist of selected chip, which is clicked again.
-Add class "movingNE" to the chip.
-Get current square width from DOM with var width = document.getElementById('square selected').offsetWidth;
-pass width to CSS for the animation to be executed
@mcynowicz all comments and help are appreciated, in case I'm going in the wrong direction with this execution
Now that I have merged the two outstanding Pull Requests, you can open up your terminal at the
master
branch and run agit pull
to get the changes to your local copy of the project.When you open the
checkers-flex.html
file in your browser, you should be able to see the fully-setup board of chips and that they highlight when you click. The highlight is just a border that's applied via the.selected
class from the CSS. The javaScript is handling the add-and-remove of the.selected
class on the.chip
elements.If you want to toy with the CSS for how this looks, go ahead and make a branch for that and add some styles or effects to give it the look you want.
While you're working on that, please also consider an additional class that can be added/removed for animating the movement of a chip when a
move
is selected.You'll need to consider: