Recently I started playing a game of Dungeons and Dragons with friends, and the first night I noticed I lacked the various sets of dice you need to play. My wife ordered a few sets, however I realized this was a great chance to put some of my HTML/CSS skills to the test with some JavaScript I recently learned.
On a Saturday morning, I got up early, slammed a few cups of coffee, and got to work. I wrote out the HTML and basic CSS first, since I'm a visual person and it helps to get a basic design down first. Then I went to work and created several functions for each type of dice. Lastly, I created a delete function to clear the board.
What do you think? Below are a few links:
Version 1.0 (individual delete function): https://codepen.io/aaronmac/pen/XWXZGYY
Version 1.1 (universal delete function): https://codepen.io/aaronmac/pen/eYJrKeO?editors=0010
Github repository for version 1.1: https://github.com/aaronmccollum/game_dice_set
A few updates I want to make soon:
- Using less "ids" and more "classes" in HTML
- Updating functions with ES6 shortcuts
- Using "let" and "const" instead of var
If you have any tips or recommendations, let me know!