Skip to content

imaaryan/Random-Quote-Website

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Random Quote Website

Screenshot

A simple random quote generator that fetches quotes from an API and allows users to copy, tweet, and save them as an image.

πŸš€ Live Demo

Click here to view the website

🎯 Features

  • Fetch Random Quotes: Retrieves a new quote from an API.
  • Copy Quote: Allows users to copy the quote to the clipboard.
  • Tweet Quote: Shares the quote on Twitter (X).
  • Save Quote as Image: Converts the quote into an image and downloads it.

πŸ› οΈ Technologies Used

  • HTML, CSS, JavaScript
  • FreeAPI for quotes
  • html2canvas (for saving quotes as images)

πŸ“œ How It Works

  1. Fetching Quotes

    • The fetchData function retrieves a random quote from https://api.freeapi.app/api/v1/public/quotes/quote/random.
    • The displayQuote function updates the UI with the fetched quote and author.
  2. User Interactions

    • Clicking "New Quote" fetches another random quote.
    • "Copy to Clipboard" copies the quote text.
    • "Share on Twitter" opens Twitter with the quote pre-filled.
    • "Save as Image" uses html2canvas to generate an image of the quote.

πŸ“‚ Installation

  1. Clone the repository:
    git clone https://github.com/imaaryan/Random-Quote-Website.git
  2. Open index.html in your browser.

πŸ’‘ Contributing

Feel free to submit a pull request if you'd like to improve the project!

πŸ“„ License

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

About

A Random Quote Generator Website - Build for ChaiCode Cohort Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published