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
32 changes: 19 additions & 13 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
<!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>
<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>
</body>
</html>

<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Quote Generator</title>
<script defer src="quotes.js"></script>
<link rel="stylesheet" href="style.css">
</head>

<body>
<div class="quote-box">
<h1>Quote of the Day</h1>
<p id="quote">"this is the quote"</p>
<p id="author">- Author Name</p>
</div>
<button type="button" id="new-quote" onclick="generateQuote()">New quote</button>
</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 generateQuote() {
const randomQuote = pickFromArray(quotes);
document.getElementById("quote").textContent = `"${randomQuote.quote}"`;
document.getElementById("author").textContent = `- ${randomQuote.author}`;
}
generateQuote();

// DO NOT EDIT BELOW HERE

// pickFromArray is a function which will return one item, at
Expand Down
49 changes: 48 additions & 1 deletion Sprint-3/quote-generator/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,48 @@
/** Write your CSS in here **/
body {
margin: 0;
padding: 0;
justify-content: center;
font-family: Arial, sans-serif;
background-color: #d4b4ec;
}

.quote-box {
margin: 50px auto;
width: 80%;
max-width: 600px;
padding: 30px;
text-align: center;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

h1 {
margin-bottom: 25px;
}
#quote {
min-height: 60px;
margin-bottom: 25px;
font-size: 1.5em;
line-height: 1.5;
font-style: italic;
}

button {
display: block;
margin: 20px auto;
font-weight: bold;
padding: 12px 20px;
font-size: 1.5em;
background-color: rgba(96, 55, 92, 0.2);
color: #232b2e;
border: none;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:hover {
background-color: rgba(53, 31, 51, 0.2);
font-weight: bold;
text-shadow: 0 1px 2px white;
}
Loading