Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
19 changes: 13 additions & 6 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<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>
<link rel="stylesheet" href="style.css" />
<script defer src="quotes.js"></script>
</head>

<body>
<h1>hello there</h1>
<p id="quote"></p>
<p id="author"></p>
<button type="button" id="new-quote">New quote</button>
<div class="quote-container">
<div class="quote-content">
<span class="quote-icon">&ldquo;</span>
<p id="quote"></p>
</div>

<p id="author"></p>
<button type="button" id="new-quote">New quote</button>
</div>
</body>
</html>
12 changes: 12 additions & 0 deletions Sprint-3/quote-generator/quotes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const quoteSpace = document.querySelector("#quote");
const authorSpace = document.querySelector("#author");
const newQuoteButton = document.querySelector("#new-quote");

// DO NOT EDIT BELOW HERE

// pickFromArray is a function which will return one item, at
Expand Down Expand Up @@ -489,5 +493,13 @@ const quotes = [
author: "Zig Ziglar",
},
];
const selectedQuote = pickFromArray(quotes);
quoteSpace.innerHTML = selectedQuote.quote;
authorSpace.innerHTML = selectedQuote.author;

newQuoteButton.addEventListener("click", function () {
const selectedQuote = pickFromArray(quotes);
quoteSpace.innerHTML = selectedQuote.quote;
authorSpace.innerHTML = selectedQuote.author;
});
// call pickFromArray with the quotes array to check you get a random quote
50 changes: 49 additions & 1 deletion Sprint-3/quote-generator/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,49 @@
/** Write your CSS in here **/
body {
background-color: orange;
margin: 0;
font-family: Arial, sans-serif;
}
.quote-container {
background-color: white;
width: 70%;
margin: 150px auto;
padding: 60px;
Comment on lines +8 to +10

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

On a narrow phone viewport, what width does this container occupy after its 60px padding is added on each side?

To "like" or "dislike" this comment, please follow this link

box-sizing: border-box;
}
.quote-content {
display: inline-flex;
align-items: flex-start;
}

.quote-icon {
font-size: 80px;
color: orange;
font-weight: bolder;
flex-shrink: align-self;
}

#quote {
font-size: 24px;
color: orange;
line-height: 1.5;
text-align: center;
}
#author {
text-align: right;
font-size: 18px;
color: orange;
}
#author::before {
content: "- ";
}
#new-quote {
display: block;
margin-left: auto;
margin-top: 25px;
background-color: orange;
color: white;
border: none;
padding: 18px 25px;
font-size: 18px;
cursor: pointer;
}
Loading