The Color Flipper is a simple web application that allows users to change the background color of the page by clicking on color buttons. It’s a lightweight and intuitive project aimed at beginners, providing a fun way to explore HTML, CSS, and JavaScript fundamentals.
- Preset Colors: Select from Green, Red, Blue, and Yellow buttons to quickly set the page's background color.
- Random Color: Click the "Random" button to change the background to a random color.
- Responsive Design: Adapts to various device sizes for a smooth user experience on both mobile and desktop.
The project uses HTML buttons styled with inline CSS to display different color options. JavaScript functions handle the color changes, updating the background color dynamically based on button clicks.
- index.html: Contains the HTML structure and inline CSS for basic styling.
- index.js: Contains the JavaScript functions to handle color-changing logic.
- Clone or download this repository.
- Open
index.html
in your browser. - Click on any of the color buttons or the "Random" button to see the background color change.
- setColor(color): Changes the background to the specified color.
- randomColor(): Generates a random color and applies it to the background.
No additional setup is required. Simply open index.html
in a web browser.
Possible improvements could include:
- Adding more color options.
- Enabling custom color input.
- Animating the background transition for a smoother effect.