Skip to content

Commit a655e9a

Browse files
committed
Refactor HTML structure and enhance quote display formatting
1 parent fff2726 commit a655e9a

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

Sprint-3/quote-generator/index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
<script defer src="quotes.js"></script>
1010
</head>
1111
<body>
12-
<p id="quote"></p>
13-
<p id="author"></p>
14-
<button type="button" id="new-quote">New quote</button>
12+
<div>
13+
<p id="quote"></p>
14+
<p id="author"></p>
15+
<button type="button" id="new-quote">New quote</button>
16+
</div>
1517
</body>
1618
</html>

Sprint-3/quote-generator/quotes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,8 @@ let quoteButton = document.getElementById("new-quote");
497497

498498
function displayQuote() {
499499
let randomQuote = pickFromArray(quotes);
500-
quote.textContent = randomQuote.quote;
501-
author.textContent = randomQuote.author;
500+
quote.textContent = `"${randomQuote.quote}"`;
501+
author.textContent = `-${randomQuote.author}`;
502502
}
503503
displayQuote();
504504
quoteButton.addEventListener("click", displayQuote);

Sprint-3/quote-generator/style.css

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
11
/** Write your CSS in here **/
2+
body {
3+
background-color: antiquewhite;
4+
display: flex;
5+
justify-content: center;
6+
align-items: center;
7+
height: 100vh;
8+
font-family: Arial, Helvetica, sans-serif;
9+
}
10+
11+
div {
12+
background-color: azure;
13+
width: 500px;
14+
padding: 60px;
15+
border-radius: 10px;
16+
box-shadow: 5px 5px 10px black;
17+
}
18+
19+
#quote {
20+
font-size: 24px;
21+
}
22+
23+
#author {
24+
font-size: 18px;
25+
}
26+
27+
#new-quote {
28+
padding: 16px 10px;
29+
border-radius: 10px;
30+
}

0 commit comments

Comments
 (0)