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
14 changes: 9 additions & 5 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
<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>
<h1>Quote Generator</h1>
<div class="quote-box">
<blockquote id="quote" class="quote-text"></blockquote>
<cite id="author" class="quote-author"></cite>
</div>
<button type="button" id="new-quote" class="quote-button">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,15 @@
function getRandomQuote() {
const randomQuote = Math.floor(Math.random() * quotes.length);
return quotes[randomQuote];
}
function showQuote() {
const quote = pickFromArray(quotes);
document.getElementById("quote").innerText = `"${quote.quote}"`;
document.getElementById("author").innerText = `- ${quote.author}`;
}
window.onload = showQuote;
document.getElementById("new-quote").addEventListener("click", showQuote);

// DO NOT EDIT BELOW HERE

// pickFromArray is a function which will return one item, at
Expand Down
53 changes: 52 additions & 1 deletion Sprint-3/quote-generator/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,52 @@
/** Write your CSS in here **/
h1 {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 58px;
color: #0b013d;
text-align: center;
}

body {
background-color: #6396d9;
font-family: Georgia, "Times New Roman", Times, serif;
text-align: center;
padding: 40px;
}

.container {
width: 60%;
margin: auto;
}

.quote-box {
background: rgb(242, 242, 243);
padding: 20px;
border-radius: 12px;
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
margin: 20px 0;
}

.quote-text {
font-size: 28px;
font-weight: bold;
color: #2e1717;
}

.quote-author {
font-size: 24px;
color: #191919;
margin-top: 10px;
}

.quote-button {
background: #f4efef;
color: rgb(19, 8, 80);
margin-top: 20px;
padding: 10px 18px;
border-radius: 8px;
font-size: 24px;
cursor: pointer;
}

.quote-button:hover {
background: #bbbfc2;
}