Skip to content

liuzzle/cat-image-generator

Repository files navigation

Random Cat Picture Generator 🐱

This project is a simple webpage that fetches and displays a random cat picture from The Cat API when a button is clicked.

Features

  • Fetches random cat pictures from The Cat API.
  • Displays the cat picture on the webpage.
  • Button to load a new cat picture on demand.
  • Built with HTML, CSS, and JavaScript.
  • Responsive layout using Bootstrap.

How to Run the Project

  1. Clone the repository:

    $ git clone https://github.com/yourusername/random-cat-picture-generator.git

  2. Navigate to the project directory:

    $ cd random-cat-picture-generator

  3. Open the index.html file in your browser:

    $ open index.html

Alternatively, you can host the project locally using a tool like Live Server in VSCode.

How It Works

  1. The webpage contains a button labeled “Give me a Cat picture!” and an empty image placeholder.
  2. When the button is clicked, a request is sent to The Cat API.
  3. A random cat picture URL is fetched and displayed inside the image element.
  4. You can click the button multiple times to load new random cat images.

Dependencies

Bootstrap 5.1 for responsive layout and styling. https://getbootstrap.com/

API Used

The Cat API https://thecatapi.com/

License

This project is open-source and available under the MIT License.

About

Click the button and receive random cat images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published