Skip to content

smlmxrk/Cat-Fact-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Random Cat Facts

A static web application built with Vanilla JavaScript, HTML, and CSS that displays random cat facts from the Cat Facts API.

License: MIT Technologies: HTML, CSS, JS

Features

  • Display a random cat fact
  • Fetch multiple cat facts on demand
  • Responsive, mobile-friendly design

Prerequisites

No build tools or frameworks required. A modern web browser is sufficient.

Installation

# Clone the repository
git clone https://github.com/smlmxrk/Cat-Fact-Generator
cd random-cat-facts

Usage

  1. Open index.html in your web browser.
  2. The page will fetch and display a random cat fact.
  3. 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.

Configuration

By default, the app fetches one fact per request. In the future, I plan on adding functionality to retrieve several facts in one click!

API Reference

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>.

Demo

image

Contributing

  1. Fork the repository
  2. Create a branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -m 'Add new feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a Pull Request

Please ensure any new code includes tests (if applicable) and follows existing style guidelines.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

Mark — feel free to reach out to me at any time!

About

Website to retrieve different random facts about cats!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published