Skip to content

Commit bc8c283

Browse files
committed
generalise variables in js, remove scroll bar using css morgin:0, change <p> to <blockquote in Html
1 parent 9927f3f commit bc8c283

3 files changed

Lines changed: 12 additions & 14 deletions

File tree

‎Sprint-3/quote-generator/index.html‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@ <h1>Quote Generator</h1>
1313
</header>
1414
<main>
1515
<section>
16-
<p id="quote"></p>
16+
<blockquote id="quote"></blockquote>
1717
<p id="author"></p>
18-
<div></div>
1918
</section>
2019
</main>
2120
<section>
2221
<button type="button" id="new-quote">New quote</button>
2322
</section>
24-
25-
2623
</body>
2724
</html>

‎Sprint-3/quote-generator/quotes.js‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -498,17 +498,17 @@ const quotes = [
498498
//4. when an event happens produce author of that quote in the other <p>
499499
const button = document.querySelector("#new-quote");
500500
const initialQuote = pickFromArray(quotes);
501-
const placeInitialQuote = document.querySelector("#quote");
502-
const placeInitialAuthor = document.querySelector("#author");
503-
placeInitialQuote.innerText = `${initialQuote.quote}`;
504-
placeInitialAuthor.innerText = `${initialQuote.author}`;
501+
const quotePlacement = document.querySelector("#quote");
502+
const authorPlacement = document.querySelector("#author");
503+
quotePlacement.innerText = `${initialQuote.quote}`;
504+
authorPlacement.innerText = `${initialQuote.author}`;
505505

506506
function newQuoteEveryTime() {
507507
const quote = pickFromArray(quotes);
508-
const quotePlace = document.querySelector("#quote");
509-
const authorPlace = document.querySelector("#author");
510-
quotePlace.innerText = `${quote.quote}`;
511-
authorPlace.innerText = `${quote.author}`;
508+
//const quotePlace = document.querySelector("#quote");
509+
//const authorPlace = document.querySelector("#author");
510+
quotePlacement.innerText = `${quote.quote}`;
511+
authorPlacement.innerText = `${quote.author}`;
512512
}
513513

514514
button.addEventListener("click", newQuoteEveryTime);

‎Sprint-3/quote-generator/style.css‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ h1 {
55
}
66

77
body {
8+
margin: 0;
89
font-family: Arial, sans-serif;
910
background: rgb(24, 25, 24);
1011

1112
display: flex;
1213
flex-direction: column;
1314
align-items: center;
1415

15-
min-height: 100vh;
16+
min-height: 100dvh;
17+
1618
}
1719
#quote {
1820
max-width: 700px;
@@ -35,7 +37,6 @@ body {
3537
font-size: 18px;
3638
color: white;
3739
background-color: rgb(225, 71, 36);
38-
3940
cursor: pointer;
4041
}
4142

0 commit comments

Comments
 (0)