This is a simple website that allows users to generate a random superhero by clicking on the "Get New Hero" button. The website is built using HTML and JavaScript, and it utilizes a backend API to fetch random superhero images for display.
To run the website locally, follow these instructions:
- Clone the repository to your local machine:
git gh repo clone Sainarendra21/Random-super-hero-generator
cd Random-super-hero-generator
- Open the
index.html
file in your preferred web browser.
- When the user clicks the "Generate Superhero" button, a request is made to the backend API to fetch a random superhero image.
- The API returns a JSON response with the URL of the random superhero image and powers.
- The JavaScript code then updates the image displayed on the website with the fetched superhero image.
- HTML
- JavaScript
The backend API used for generating random superhero images is provided by [https://superheroapi.com/api.php/${SUPERHERO_TOKEN}
]`. This API returns a JSON response containing the URL of a random superhero image. The API is publicly accessible and does not require any authentication.
The website has no external dependencies and should run smoothly on any modern web browser.
If you want to contribute to this project, you can follow these steps:
- Fork the repository on GitHub.
- Create a new branch with a descriptive name for your feature or bug fix.
- Commit your changes and push the branch to your forked repository.
- Create a pull request on the main repository with a detailed description of your changes.