Your colleague started writing handlers.
But the handler for the .chapter element does not fire when clicking on nested .section elements.
But should. Help your colleague figure it out.
You just need to fix one line in the script, don鈥檛 change anything else....
The layout designer has prepared a layout. It remains to add logic.
When pressing the dial buttons, the digit value must be added to the inner text of the #entered-number element....
Each element in the index.html file needs to add a click handler.
The handler should print the element鈥檚 id to the console.
As a result, when you press the Click me button, 4 messages should appear in the console....
Hey, Hero! This is your first task that consists of multiple stages. You鈥檒l be submitting your solution multiple times implementing a smaller piece of the big task. Be mindful not to break what was already working on previous stages....
After implementing a producer purchase we need to make sure they do the work!
Each second the producer should give us the amount of gold equal to their baseProduction.
Add a new field productionRate to the config object exported from constants....
The core of our mining game is implemented now.
However, there are a few cosmetic things that we need to work on to provide a pleasant user experience.
For starters, we鈥檒l improve our config by adding two flags isInitCompleted: false and isProducerListUpdated: true...
The prep is done, so let鈥檚 start from the beginning.
Once the user has enough gold to purchase the first producer, it makes sense to change the welcome message.
I suggest creating a function checkInitCompleted that should be called from handleKeyPress once the user has enough gold to purchase the first producer....
Next, we鈥檙e going to improve the UX by displaying the current list of producers.
We鈥檒l implement the function updateProducerList(term, state) in functions.js
It should print the list of producers, each on the new line starting from line 5....
Wow! The previous stages must have been hard. We still have some work to do, though.
It鈥檇 be very useful for the user to see the current production rate of their mining empire....
You might have noticed, that there are occasional issues with displaying the numbers in our game.
Sometimes, there appear long weird tails after the decimal point.
The other times the numbers get so big that it鈥檚 hard to make sense of them....