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
14 changes: 9 additions & 5 deletions Sprint-3/quote-generator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
<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>
</head>
<body>
<h1>hello there</h1>
<p id="quote"></p>
<p id="author"></p>
<button type="button" id="new-quote">New quote</button>
<div class="main">
<p id="quote"></p>
<p id="author"></p>
<button type="button" id="new-quote" onclick="newquote()">
New quote
</button>
</div>
</body>
</html>
8 changes: 8 additions & 0 deletions Sprint-3/quote-generator/quotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,3 +491,11 @@ const quotes = [
];

// call pickFromArray with the quotes array to check you get a random quote
function newquote() {
let QuoteID = document.getElementById("quote");
let authorID = document.getElementById("author");
const randomQuote = pickFromArray(quotes);
QuoteID.innerText = randomQuote.quote;
authorID.innerText = randomQuote.author;
}
window.onload = newquote();
36 changes: 35 additions & 1 deletion Sprint-3/quote-generator/style.css

Choose a reason for hiding this comment

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

On my screen, this page shows an unnecessary vertical scrollbar - can you find out how to fix that?

Copy link
Author

Choose a reason for hiding this comment

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

I have updated.

Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
/** Write your CSS in here **/
* {
box-sizing: border-box;
}
:root {
--bg-color: rgba(5, 18, 4, 0.838);
--text-color: #ffffff;
--shado-color: #524f4f;
}
body {
margin: 0;
padding: 0;
font-size: 1.5rem;
font-family: sans-serif;
background-color: var(--bg-color);
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.main {
background-color: var(--text-color);
padding: 30px 50px;
max-width: 600px;
text-align: right;
max-height: 80vh;
color: var(--bg-color);
}
#new-quote {
background-color: var(--bg-color);
padding: 10px;
box-shadow: 1px 1px 2px var(--shado-color);
border-radius: 10px;
color: var(--text-color);
font-size: large;
}