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
9 changes: 6 additions & 3 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Title here</title>
<title>Quote Generator</title>
<link rel="stylesheet" href="style.css" />
<script defer src="quotes.js"></script>
</head>
<body>
<h1>hello there</h1>
<h1>Quote of the Day</h1>
<p id="quote"></p>
<p id="author"></p>
<button type="button" id="new-quote">New quote</button>
<div id="new-quote">
<button type="button" >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
@@ -1,3 +1,16 @@
window.onload = function () {
function displayRandomQuote () {
const randomQuote = pickFromArray(quotes);

document.getElementById("quote").innerText = randomQuote.quote;
document.getElementById("author").innerText = " - " + randomQuote.author;
}
displayRandomQuote();
document
.getElementById("new-quote")
.addEventListener("click", displayRandomQuote);
};

// DO NOT EDIT BELOW HERE

// pickFromArray is a function which will return one item, at
Expand Down
40 changes: 40 additions & 0 deletions Sprint-3/quote-generator/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
/** Write your CSS in here **/
body {
background-color: grey;
margin: 0;
padding: 0;
}

h1 {
text-align: center;
color: bisque;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
font-size: 70px; /* slightly smaller for balance */
letter-spacing: 2px; /* minor polish */
}

#quote {
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
color: white;
background-color: black;
font-size: 45px; /* toned down for readability */
text-align: center;
padding: 20px; /* gives breathing room */
}

#author {
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
color: #ddd; /* softer contrast */
background-color: black;
font-size: 18px;
text-align: center;
padding-bottom: 15px;
}

#new-quote {
margin-left: 70px;
padding: 12px 18px;
border: 2px solid black;
border-radius: 12px;
cursor: pointer;
background-color: #f0f0f0;
}