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: 8 additions & 6 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<!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>
<p id="quote"></p>
<p id="author"></p>
<button type="button" id="new-quote">New quote</button>
</main>
</body>
</html>
17 changes: 17 additions & 0 deletions Sprint-3/quote-generator/quotes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
function displayQuote() {
const randomQuote = pickFromArray(quotes);
const quote = document.querySelector("#quote");
const author = document.querySelector("#author");

quote.textContent = randomQuote.quote;
author.textContent = randomQuote.author;
}

function setup() {
const newQuoteButton = document.querySelector("#new-quote");
newQuoteButton.addEventListener("click", displayQuote);
displayQuote();
}

window.addEventListener("load", setup);

// DO NOT EDIT BELOW HERE

// pickFromArray is a function which will return one item, at
Expand Down
66 changes: 66 additions & 0 deletions Sprint-3/quote-generator/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,67 @@
/** 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;
}

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

#quote::before {
content: "“ ";
font-size: clamp(5rem, 6vw, 3rem);
font-family: Theseadow, serif;
}

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

#author::before {
content: "— ";
}

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