A simple Random Quote Generator built using HTML, CSS, and JavaScript.
It fetches random inspirational quotes from an external API and even allows you to tweet your favorite quotes!
- Fetches a new random quote with the click of a button.
- Displays the quote and the author.
- Share quotes directly on Twitter.
- Fully responsive design for mobile, tablet, and desktop.
Follow these simple steps to run the project locally:
git clone https://github.com/your-username/random-quote-generator.gitOr simply download the ZIP and extract it.
random-quote-generator/
βββ index.html
βββ style.css
βββ twitter icon.png
- index.html β Main HTML file containing the structure and logic.
- style.css β Styling for the quote box and responsiveness.
- twitter icon.png β Twitter icon used in the "Tweet" button.
You can simply double-click the index.html file or open it through a local server.
-
API Used: Quotable API
Huge shoutout to Quotable for providing an amazing free API for random quotes! -
Fetching a Quote:
- On page load and when you click "New Quote", a new quote is fetched from the Quotable API using
fetch(). - The quote text and author name are updated dynamically.
- On page load and when you click "New Quote", a new quote is fetched from the Quotable API using
-
Tweeting the Quote:
- Clicking the "Tweet" button opens a Twitter sharing window with the quote and author pre-filled.
Feel free to fork the repo, make improvements, and create a pull request. Contributions are welcome!
- Thanks to Quotable API for providing a simple and free way to access awesome quotes.
- Designed and developed with π using pure HTML, CSS, and JavaScript.
This project is open source and available under the MIT License.
