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
7 changes: 4 additions & 3 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<!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>
<link rel="stylesheet" href="style.css" />
<title>Quote Generator App</title>
<script defer src="quotes.js"></script>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctly linked JavaScript file.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

</head>
<body>
<h1>hello there</h1>
<h1>Welcome to the Quote Generator</h1>
<p id="quote"></p>
<p id="author"></p>
<button type="button" id="new-quote">New quote</button>
Expand Down
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 @@
window.addEventListener("DOMContentLoaded", () => {
const quoteElement = document.getElementById("quote");
const authorElement = document.getElementById("author");
const newQuoteBtn = document.getElementById("new-quote");


function displayRandomQuote() {
const randomQuote = pickFromArray(quotes);
quoteElement.textContent = `"${randomQuote.quote}"`;
authorElement.textContent = randomQuote.author;
}

newQuoteBtn.addEventListener("click", displayRandomQuote);

displayRandomQuote();
});

// DO NOT EDIT BELOW HERE

// pickFromArray is a function which will return one item, at
Expand Down
30 changes: 30 additions & 0 deletions Sprint-3/quote-generator/style.css
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
/** Write your CSS in here **/
body {
display: grid;
place-items: center;
min-height: 100vh;
margin: 0;
font-family: Arial, sans-serif;
text-align: center;
margin-top: 40px;
background-color: aqua;
}
h1 {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
color: green;
}

#quote {
font-size: 45px;
margin-bottom: 10px;
color: purple;
}
#author {
font-size: 30px;
color: red;
margin-bottom: 10px;
font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
}
#new-quote {
padding: 10px 20px;
font-size: 16px;
}
Loading