A simple web application that fetches and displays a new inspirational quote every time you click the New Quote button. It also allows users to tweet the quote directly with one click.
- Fetches real-time quotes from ZenQuotes API
- Displays both quote text and author
- Clean UI with smooth styling
- "Tweet" button to directly share the quote on Twitter
- Responsive design using HTML, CSS, and vanilla JavaScript
- Error handling for API failures
The project fetches quotes using:
https://api.allorigins.win/raw?url=https://zenquotes.io/api/random
The following elements update dynamically:
<blockquote> → Quote text
<span> → Author name
Users see the new quote instantly on button click.
If the API fails or responds slowly:
- A fallback message appears
- Errors are logged in the console This ensures the app doesn’t break unexpectedly.
- When we click 'New Quote', the API may take time to generate a new quote due to traffic.
- When we click 'Tweet', it will open into your twitter account, or ask you to login/signup for it.