Task #250, Stage #5 - Gold Mine
Now, let’s work on the function that will be called if the user clicks the key G on the keyboard. Implement and export the function handleKeyPress(term, state) in the handlers.js....
Now, let’s work on the function that will be called if the user clicks the key G on the keyboard. Implement and export the function handleKeyPress(term, state) in the handlers.js....
The handler is ready, so we need to connect it with the keypress event. But before that we need to improve the init function. It accepts a single parameter and should call on it:...
So, now we can start mining gold in manual mode by pressing key ‘G’ key. Let’s print the result of our actions on the screen. Implement and export the function updateGold(term, state) from functions....
Great! The manual mode is done, so we should think about automating our mining empire. Add a new field producers into the config constant that was exported from solution.js. It should be an array of objects....
Now let’s add the ability for the user to purchase new producers. If you’ve created producers with single digit ids, you did everything right. If not, you can still fix it....
The document has already added a title and five colored button elements. When you click on any of the buttons, the text color of the h2 heading should change to the one indicated on the button....
There are two buttons in the document: + and -. When the + button is clicked, the font size of the .story element should increase by 1px by default. If the current font size of the ....
There are three fortune cookies (.cookie) in the document. To read the prediction, you need to open the cookie. When you click on a .cookie, you need to add the opened class to it....
When dialing a number, it is desirable to highlight the pressed button. When clicking on any button in the index.html file, the pressed class must be added to it for 500ms....
You were given access to control traffic lights in the city. The task you need to solve is to manually control them. To turn on the red light, the .traffic-light element must have a second class stop....