A simple and interactive Gradient Generator built with HTML, CSS, and JavaScript. This tool allows users to create linear gradients, generate random gradients, and copy the CSS code for their designs.
- Custom Gradients: Select two colors and a direction to create a linear gradient.
- Random Gradients: Generate random gradients with a single click.
- Copy CSS Code: Copy the generated gradient's CSS code to your clipboard for easy use.
- Real-Time Preview: Instantly preview the gradient on the webpage.
Check out here - Gradient Generator
- Clone or download this repository to your local machine.
- Open the
index.html
file in your browser. - Use the color pickers to select your desired colors.
- Choose a gradient direction from the dropdown menu.
- Click Generate Gradient to see your gradient in action.
- Alternatively, click Generate Random to create a random gradient.
- Click Copy CSS to copy the gradient's CSS code to your clipboard.
No installation is required! Just download the files and open the index.html
file in any modern web browser.
GradientGenerator/
│
├── index.html # HTML structure for the gradient generator
├── styles.css # Styling for the application
└── script.js # JavaScript for interactivity
- HTML5: Structure of the webpage.
- CSS3: Styling the application and previewing gradients.
- JavaScript: Adding interactivity for gradient generation and clipboard functionality.
Here’s an example of the CSS code generated by this tool:
background: linear-gradient(to right, #ff0000, #0000ff);
- Add radial gradient support.
- Enable gradient saving as an image.
- Add more customizable options (e.g., opacity, more color stops).
Contributions are welcome! If you have suggestions or improvements, feel free to fork the repository and submit a pull request.