Skip to content

WESTMIDLANDS | ITP-MAY2025 | Peter Lui | Sprint3 Quotes Generator #739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

petergmlui
Copy link

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Initial Submission

Questions

Ask any questions you have for your reviewer.

@petergmlui petergmlui added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Aug 2, 2025
@@ -1,3 +1,73 @@
function displayRandomQuote() {
if (!quotes.length) return; // Guard against empty quotes array
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error handling is a good practice! 👍

Comment on lines +12 to +28
quoteElement.style.backgroundColor = "#f0f4f8"; // Light blue-gray background
quoteElement.style.padding = "20px"; // Padding for spacing
quoteElement.style.borderRadius = "8px"; // Rounded corners
quoteElement.style.fontSize = "1.2em"; // Larger font for readability
quoteElement.style.color = "#333"; // Dark text for contrast
quoteElement.style.margin = "20px"; // Margin for separation
quoteElement.style.textAlign = "center"; // Center the text
quoteElement.style.fontStyle = "italic"; // Italicize quote
quoteElement.style.borderLeft = "4px solid #007bff"; // Blue accent border

// Style the author
authorElement.style.color = "#007bff"; // Blue color for author
authorElement.style.padding = "10px 20px"; // Padding for spacing
authorElement.style.fontSize = "1em"; // Slightly smaller than quote
authorElement.style.textAlign = "right"; // Right-align author
authorElement.style.fontWeight = "bold"; // Bold for emphasis
authorElement.style.margin = "0 20px 20px 20px"; // Margin for separation
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can control styles using the DOM; however, it's recommended to use CSS files rather than controlling them with JavaScript because of performance, separation of interest, and maintenance reasons.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can control styles using the DOM; however, it's recommended to use CSS files rather than controlling them with JavaScript because of performance, separation of interest, and maintenance reasons.

Hi Day! I totally agree with you - but I think we are not allowed to change the CSS file? Also it wasn't a requirement to style the page, so it was more of an experiment for me. Would you like me to delete the section? Thanks for your help!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @petergmlui, It's just a recommendation. You don't have to create a new css file only for this. Just wanted to share the best practice. Well done!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Day! Highly appreciated!

@day-lee day-lee added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 5, 2025
@petergmlui petergmlui added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Aug 6, 2025
@day-lee day-lee added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and all review comments have been addressed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants