Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Title here</title>
<title>Quote generator app</title>
<script defer src="quotes.js"></script>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h1>hello there</h1>
<p id="quote"></p>
<p id="author"></p>
<button type="button" id="new-quote">New quote</button>
<div id="poster">
<p id="quote"></p>
<p id="author"></p>
<button type="button" id="new-quote">New quote</button>
</div>
</body>
</html>
13 changes: 13 additions & 0 deletions Sprint-3/quote-generator/quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,3 +491,16 @@ const quotes = [
];

// call pickFromArray with the quotes array to check you get a random quote

function updateQuoteAndAuthor() {
const { quote, author } = pickFromArray(quotes);
document.getElementById("quote").innerText = quote;
document.getElementById("author").innerText = author;
}

window.onload = () => {
updateQuoteAndAuthor();
document
.getElementById("new-quote")
.addEventListener("click", updateQuoteAndAuthor);
Copy link

Choose a reason for hiding this comment

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

You have implemented the first part of this task quite well. However, you have yet to attempt the "auto-generate" task. Why is that?

Copy link
Author

Choose a reason for hiding this comment

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

I was concerned that I couldn't figure out why the second test keeps failing. So, I made this pull request to seek for guidelines. However, if it is ok to move on, I would love to try implementing new features.

Copy link
Author

Choose a reason for hiding this comment

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

Hi sambabib,
I have added an auto-update feature for the quote generator.

};
35 changes: 35 additions & 0 deletions Sprint-3/quote-generator/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,36 @@
/** Write your CSS in here **/
:root {
--primary-bg-color: #e9b066;
--primary-color: #ffffff;
}

body {
display: flex;
align-items: center;
justify-content: center;
text-align: center;
background-color: var(--primary-bg-color);
}

#poster {
width: 80%;
padding: 25px;
background-color: var(--primary-color);
color: var(--primary-bg-color);
font-size: larger;
font-style: italic;
position: relative;
top: 100px;
}

#quote {
font-weight: bold;
}

button {
border-radius: 8px;
font-size: medium;
background-color: var(--primary-bg-color);
color: var(--primary-color);
border: none;
}
Loading