Skip to content
15 changes: 9 additions & 6 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<!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>
<main>
<h1>"</h1>
<p id="quote"></p>
<p id="author"></p>
<button type="button" id="new-quote">New quote</button>
</main>
</body>
</html>
14 changes: 14 additions & 0 deletions Sprint-3/quote-generator/quotes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
const newQuoteButton = document.querySelector("#new-quote");

function displayQuote() {
const randomQuote = pickFromArray(quotes);
const quote = document.querySelector("#quote");
const author = document.querySelector("#author");

quote.textContent = randomQuote.quote;
author.textContent = `- ${randomQuote.author}`;
}

newQuoteButton.addEventListener("click", displayQuote);
window.addEventListener("load", displayQuote);

// DO NOT EDIT BELOW HERE

// pickFromArray is a function which will return one item, at
Expand Down
65 changes: 65 additions & 0 deletions Sprint-3/quote-generator/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,66 @@
/** Write your CSS in here **/
:root {
--primary-color: #ffa500;
--secondary-color: #ffffff;
}

* {
box-sizing: border-box;
margin: 0;
padding: 0;
}

body {
background-color: var(--primary-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 1rem;
font-family:
system-ui,
-apple-system,
sans-serif;
}

main {
background-color: var(--secondary-color);
color: var(--primary-color);
width: 100%;
max-width: 850px;
min-height: 300px;
padding: clamp(3rem, 6vw, 5rem);
text-align: right;
padding: 4rem;
}

h1,
#quote {
display: inline;
font-weight: bold;
}

h1 {
font-size: clamp(2.5rem, 6vw, 3rem);
font-family: Theseadow, serif;
}

#quote {
font-size: clamp(1rem, 3vw, 1.5rem);
}

#author {
margin-top: 1rem;
margin-bottom: 1rem;
font-style: italic;
}

button {
background-color: var(--primary-color);
color: var(--secondary-color);
border: none;
padding: 0.5rem 1rem;
cursor: pointer;
font-weight: bold;
font-size: large;
}
Loading