Skip to content

Commit a9ba9ed

Browse files
committed
updated display setting
1 parent 11a4d4b commit a9ba9ed

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

Sprint-3/quote-generator/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@
1717
<div id="poster">
1818
<p id="quote"></p>
1919
<p id="author"></p>
20-
<button type="button" id="new-quote">New quote</button>
20+
<div id="button-field">
21+
<button type="button" id="new-quote">New quote</button>
22+
</div>
23+
<div id="display-notice">
24+
<p id="auto-play-notice" style="display: none">Auto-Play: On</p>
25+
</div>
2126
</div>
2227
</body>
2328
</html>

Sprint-3/quote-generator/quotes.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,15 +499,21 @@ function updateQuoteAndAuthor() {
499499
}
500500

501501
function autoUpdateQuoteAndAuthor() {
502-
let autoQuote = document.getElementById("toggle-btn");
502+
const autoQuote = document.getElementById("toggle-btn");
503+
const newQuoteButton = document.getElementById("new-quote");
504+
const autoDisplayNotice = document.getElementById("auto-play-notice");
503505
let intervalId;
504506
autoQuote.addEventListener("change", () => {
505507
if (autoQuote.checked) {
508+
newQuoteButton.style.display = "none";
509+
autoDisplayNotice.style.display = "block";
506510
intervalId = setInterval(() => {
507511
updateQuoteAndAuthor();
508512
}, 3000);
509513
} else {
510514
clearInterval(intervalId);
515+
newQuoteButton.style.display = "block";
516+
autoDisplayNotice.style.display = "none";
511517
}
512518
});
513519
}

Sprint-3/quote-generator/style.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ body {
3535
width: 90%;
3636
}
3737

38+
#button-field {
39+
display: flex;
40+
justify-content: end;
41+
margin-bottom: -10px;
42+
}
43+
44+
#display-notice {
45+
display: flex;
46+
justify-content: end;
47+
}
48+
49+
#auto-display-notice {
50+
font-size: 12px;
51+
}
52+
3853
button {
3954
border-radius: 8px;
4055
font-size: medium;

0 commit comments

Comments
 (0)