Skip to content
Closed
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
18 changes: 18 additions & 0 deletions Sprint-3/quote-generator/Quote_generator_app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Quotes Generator</title>
<link rel="stylesheet" href="style.css" />
<script defer src="quotes.js"></script>
</head>
<body>
<div id="quote-box">
<p id="quote"></p>
<p id="author"></p>
<button type="button" id="new-quote">New quote</button>
</div>

</body>
</html>
15 changes: 0 additions & 15 deletions Sprint-3/quote-generator/index.html

This file was deleted.

19 changes: 19 additions & 0 deletions Sprint-3/quote-generator/quotes.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
function setup() {
const quoteButton = document.getElementById("new-quote");
const quoteText = document.getElementById("quote");
const authorText = document.getElementById("author");

function showRandomQuote() {
const randomQuote = pickFromArray(quotes);
quoteText.textContent = `“${randomQuote.quote}”`;
authorText.textContent = `- ${randomQuote.author}`;
}

quoteButton.addEventListener("click", showRandomQuote);

showRandomQuote();
}

document.addEventListener("DOMContentLoaded", setup);


// DO NOT EDIT BELOW HERE

// pickFromArray is a function which will return one item, at
Expand Down
42 changes: 42 additions & 0 deletions Sprint-3/quote-generator/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
/** Write your CSS in here **/
body {
font-family: Arial, sans-serif;
background-color: #605f5f;
margin: 0;
padding: 20px;
}
h1 {
color: #4DD0E1;
text-align: center;
}

#quote-box {
background-color: #222121;
border-radius: 10px;
padding: 20px;
max-width: 600px;
margin: 20px auto;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
height: 250px;
position: relative;
}
#quote {
font-size: 24px;
color: #ffffff;
}
#author {
font-size: 20px;
color: #cccccc;
text-align: right;
}
#new-quote {
background-color: #4DD0E1;
color: #000000;
border: none;
padding: 10px 20px;
font-size: 16px;
border-radius: 5px;
cursor: pointer;
position: absolute;
bottom: 20px;
left: 20px;
}