Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
18 changes: 11 additions & 7 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<!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>
<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>
<body onload="main()">
Comment thread
cjyuan marked this conversation as resolved.
Outdated
<div class="container">
<p id="quote"></p>
<p id="author"></p>
<div id="new-quote">
<button type="button">New quote</button>
</div>
</div>
</body>
</html>
7 changes: 7 additions & 0 deletions Sprint-3/quote-generator/quotes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
function main() {
Comment thread
cjyuan marked this conversation as resolved.
Outdated
document.querySelector("#quote").innerText = pickFromArray(quotes).quote;
document.querySelector("#author").innerText = pickFromArray(quotes).author;
}
Comment thread
cjyuan marked this conversation as resolved.
Outdated

document.getElementById("new-quote").addEventListener("click", main);

Comment thread
cjyuan marked this conversation as resolved.
Outdated
// DO NOT EDIT BELOW HERE

// pickFromArray is a function which will return one item, at
Expand Down
44 changes: 43 additions & 1 deletion Sprint-3/quote-generator/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
/** Write your CSS in here **/
body {
background-color: orange;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
background-color: white;
width: 60%;
padding: 50px 50px;
}
#quote {
text-align: center;
color: orange;
font-size: 28px;
}
#quote::before {
content: open-quote;
}
#quote::after {
content: close-quote;
}
#author {
color: orange;
text-align: right;
font-size: 20px;
}
#author::before {
content: "- ";
}
#new-quote {
display: flex;
justify-content: end;
}
button {
background-color: orange;
color: white;
border: none;
font-size: 18px;
padding: 15px;
cursor: pointer;
}
Loading