A static web application built with Vanilla JavaScript, HTML, and CSS that displays random cat facts from the Cat Facts API.
- Display a random cat fact
- Fetch multiple cat facts on demand
- Responsive, mobile-friendly design
No build tools or frameworks required. A modern web browser is sufficient.
# Clone the repository
git clone https://github.com/smlmxrk/Cat-Fact-Generator
cd random-cat-facts
- Open
index.html
in your web browser. - The page will fetch and display a random cat fact.
- Click the "Load More" button to fetch additional facts.
Alternatively, serve the folder with a static server:
# Install http-server globally (optional)
npm install -g http-server
# Serve the directory
http-server .
Then navigate to http://localhost:8080
(or the port whatever port it's beinig hosted on) in your browser.
By default, the app fetches one fact per request. In the future, I plan on adding functionality to retrieve several facts in one click!
This project uses the Cat Facts API.
- GET
/fact
Returns a single random cat fact. - GET
/facts?limit=<number>
Returns an array of cat facts of length<number>
.
- Fork the repository
- Create a branch (
git checkout -b feature/your-feature
) - Commit your changes (
git commit -m 'Add new feature'
) - Push to the branch (
git push origin feature/your-feature
) - Open a Pull Request
Please ensure any new code includes tests (if applicable) and follows existing style guidelines.
This project is licensed under the MIT License. See the LICENSE file for details.
Mark — feel free to reach out to me at any time!