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
19 changes: 13 additions & 6 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
<!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>
<link rel="stylesheet" href="style.css" />
<script defer src="quotes.js"></script>
</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>Quote Generator</h1>
<section>
<span class="quote-mark quote-mark-open">"</span>
<p id="quote"></p>
<p id="author"></p>
<span class="quote-mark quote-mark-close">"</span>
</section>
<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 quoteP = document.querySelector("#quote");
const authorP = document.querySelector("#author");
const newQuoteBtn = document.querySelector("#new-quote");

function displayQuote() {
const quote = pickFromArray(quotes);
quoteP.innerText = quote.quote;
authorP.innerText = quote.author;
}

window.addEventListener("load", () => {
displayQuote();
newQuoteBtn.addEventListener("click", displayQuote);
});
// DO NOT EDIT BELOW HERE

// pickFromArray is a function which will return one item, at
Expand Down
91 changes: 90 additions & 1 deletion Sprint-3/quote-generator/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,90 @@
/** Write your CSS in here **/
* {
box-sizing: border-box;
margin: 0;
padding: 0;
border: none;
}

body {
height: 100vh;
background: var(--main-bg-colour);
font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
color: var(--font-colour);
display: flex;
justify-content: center;
padding: 2rem 1.25rem 3rem;
}

main {
width: 1100px;
display: flex;
flex-direction: column;
align-items: center;
}

h1 {
font-size: 3rem;
font-weight: 900;
margin-bottom: 2rem;
text-align: center;
}

section {
max-width: 800px;
background: var(--card-bg-colour);
border-radius: 1rem;
border: solid 2px #e7dcfb;
padding: 5rem;
position: relative;
text-align: center;
box-shadow: 0 14px 32px rgba(80, 40, 140, 0.14);
}

#quote {
font-size: 1.75rem;
font-weight: 600;
padding-bottom: 25px;
max-width: 60ch;
}

#author {
font-size: 1.35rem;
}

.quote-mark {
font-size: 7rem;
position: absolute;
font-family: "Times New Roman", Times, serif;
}

.quote-mark-open {
left: 3rem;
top: 0.2rem;
}

.quote-mark-close {
right: 3rem;
bottom: -3rem;
}

button {
margin: 30px;
padding: 10px 25px;
font-family: inherit;
font-size: 1.15rem;
font-weight: 400;
color: white;
background-color: var(--font-colour);
border-radius: 0.5rem;
}

:root {
--main-bg-colour: linear-gradient(
35deg,
#90a3ff 0%,
#b893ff 50%,
#f2a1ff 100%
);
--card-bg-colour: rgba(245, 246, 255, 0.6);
--font-colour: #3f2475;
}
Loading