How do i answer this particular Javascript Animation Question?

Viewed 77

Create a webpage (as shown below) that has one text field (multiplier) and two buttons 'Start' and 'Stop'. When the 'Start' button is pressed, Animation starts - the multiplier (entered by the user) is multiplied by a randomly generated two-digit number and the equation is shown on the web page; After 1.5 seconds the multiplier (entered by the user) is multiplied by the result of the previous equation and the equation is displayed under the first one. Before and after each equation, randomly chosen emojis are displayed.

For example

the user has entered 5 in the text field; when the animation starts, a two-digit random number is generated (e.g. 58) and the following is displayed on the web page:

                                       58 * 5 = 290 

after 1.5 seconds, the number entered by the user is multiplied by the result of the previous equation (290) and the following is displayed on the web page

                                       58 * 5 = 290 
                                       290 * 5 = 1450 

then another 1.5 seconds later, the number entered by the user is multiplied by the result of the previous equation (1450) and the following is displayed on the web page

                                       58 * 5 = 290 
                                       290 * 5 = 1450 
                                       ‍♂️1450 * 5 = 7250 

and so on... In this animation, you must use a randomly generated two-digit number. The emoji is randomly chosen from a predefined list of at least 10 emoji.

When the button “Stop” is clicked, the animation stops, the text field is cleared and whatever is currently displayed will stay on the page. When the user clicks the start button again, the previously displayed equations are cleared, and the animation is starting with a newly generated random number.

The user can click the start animation button many times, but only one animation can run at any given time.

NOTE: PLEASE USE SIMPLE CODE, for example not "EventInformation", no "let". Javascript basics please

Another example:

enter image description here

0 Answers
Related