المشاركات
Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated
Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated
Here's a simple color game that meets your requirements:
HTML:
```
Color Game
```
CSS (in style.css file):
JavaScript (in script.js file):
How it works:
1. The HTML file creates a button and a div element.
2. The CSS file styles the div element to have a white background color and a transition effect for smooth color changes.
3. The JavaScript file selects the button and div elements, defines an array of colors (green and red), and adds an event listener to the button.
4. When the button is clicked, it becomes disabled for 5 seconds.
5. After 5 seconds, the div element's background color changes to a random color (either green or red) for 5 seconds.
6. After the color change, the div element's background color reverts to white, and the button becomes clickable again.
Save the HTML, CSS, and JavaScript code in separate files (index.html, style.css, and script.js) and open the HTML file in a web browser to play the game!