Online quote generator where you click a button and it gives you a random quote.
- For the simple HTML/CSS/JS version, please open default-quote-generator.
- For the React version, created with create-react-app v2, open react-quote-generator.
This project is part of the FreeCodeCamp Frontend Libraries Projects, and follows a series of requested user stories. Please add <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
to the index.html
files and select the Random Quote Machine test suite to see the below tests pass.
- User Story #1: I can see a wrapper element with a corresponding id="quote-box".
- User Story #2: Within #quote-box, I can see an element with a corresponding id="text".
- User Story #3: Within #quote-box, I can see an element with a corresponding id="author".
- User Story #4: Within #quote-box, I can see a clickable element with a corresponding id="new-quote".
- User Story #5: Within #quote-box, I can see a clickable element with a corresponding id="tweet-quote".
- User Story #6: On first load, my quote machine displays a random quote in the element with id="text".
- User Story #7: On first load, my quote machine displays the random quote's author in the element with id="author".
- User Story #8: When the #new-quote button is clicked, my quote machine should fetch a new quote and display it in the #text element.
- User Story #9: My quote machine should fetch the new quote's author when the #new-quote button is clicked and display it in the #author element.
- User Story #10: I can tweet the current quote by clicking on the #tweet-quote a element. This a element should include the "twitter.com/intent/tweet" path in it's href attribute to tweet the current quote.
- User Story #11: The #quote-box wrapper element should be horizontally centered. Please run tests with browser's zoom level at 100% and page maximized.
- Use RGB colors to add an opacity-like effect to the quotes background without affecting the other elements.
- Use HTML and CSS classes in the JavaScript code to make them update in real time when the user clicks the buttons.
- Use Math.floor() and Math.random() to randomize the quotes by length and show them randomly without following an order.