-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NW6| Bakhat Begum | MODULE-JS2 | Js quotes/week 3 | WEEK-3 #189
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for cute-gaufre-e4b4e5 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
<input type="checkbox" id = "check-box"/> | ||
<p id="auto-play-text"></p> | ||
</div> | ||
</section> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great to see that you're using semantic elements like <section>
, <h1>
, <p>
, and <button>
.
As a further step, you can consider using a <form>
and, you can improve the accessibility of your checkbox by adding a <label>
element:
<form>
<label for="check-box">Auto Play:</label>
<input type="checkbox" id="check-box" />
</form>
@@ -25,469 +25,509 @@ function pickFromArray(choices) { | |||
const quotes = [ | |||
{ | |||
quote: "Life isn't about getting and having, it's about giving and being.", | |||
author: "Kevin Kruse", | |||
author: "- Kevin Kruse", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of manually adding the dash ("-") to each quote in the array, you could use JS to insert it into your HTML code dynamically :)
quoteParagahraph2.innerText = `- ${currentQuote.author}`;
By using JS to handle the quote and formatting, your code becomes more flexible and easier to maintain!
week-3/quote-generator/quotes.js
Outdated
const quoteParagahraph2 = document.getElementById("author"); | ||
quoteParagahraph2.innerText = currentQuote.author; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! In the future, consider using more meaningful variable names like authorName
for better clarity and readability.
function eventhandler(event){ | ||
console.log("click"); | ||
getQoutes(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While console logs
can be helpful during development and debugging, they are typically not necessary in the final version of the code. It would be helpful to remove the console log statements before submitting your code!
week-3/quote-generator/style.css
Outdated
#check-box{ | ||
position: absolute; | ||
margin-top: 80px; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your preview looks great! Well done @BakhatBegum !
Thank you very much for your feedback. I made changes as per your feedback.
…On Sun, 28 Jan 2024 at 20:52, Musa ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In week-3/quote-generator/index.html
<#189 (comment)>
:
> <p id="author"></p>
<button type="button" id="new-quote">New quote</button>
+ <input type="checkbox" id = "check-box"/>
+ <p id="auto-play-text"></p>
+ </div>
+</section>
It's great to see that you're using semantic elements like <section>, <h1>
, <p>, and <button>.
As a further step, you can consider using a <form> and, you can improve
the accessibility of your checkbox by adding a <label> element:
<form>
<label for="check-box">Auto Play:</label>
<input type="checkbox" id="check-box" />
</form>
------------------------------
In week-3/quote-generator/quotes.js
<#189 (comment)>
:
> @@ -25,469 +25,509 @@ function pickFromArray(choices) {
const quotes = [
{
quote: "Life isn't about getting and having, it's about giving and being.",
- author: "Kevin Kruse",
+ author: "- Kevin Kruse",
Instead of manually adding the dash ("-") to each quote in the array, you
could use JS to insert it into your HTML code dynamically :)
quoteParagahraph2.innerText = `- ${currentQuote.author}`;
By using JS to handle the quote and formatting, your code becomes more
flexible and easier to maintain!
------------------------------
In week-3/quote-generator/quotes.js
<#189 (comment)>
:
> +const quoteParagahraph2 = document.getElementById("author");
+quoteParagahraph2.innerText = currentQuote.author;
Great job! In the future, consider using more meaningful variable names
like authorName for better clarity and readability.
------------------------------
In week-3/quote-generator/quotes.js
<#189 (comment)>
:
> +
+function getQoutes(evet){
+const quoteParagahraph = document.getElementById("quote");
+const currentQuote = pickFromArray(quotes);
+quoteParagahraph.innerText = currentQuote.quote;
+const quoteParagahraph2 = document.getElementById("author");
+quoteParagahraph2.innerText = currentQuote.author;
+
+}
+getQoutes();
+
+const button = document.getElementById("new-quote");
+function eventhandler(event){
+ console.log("click");
+ getQoutes();
+}
While console logs can be helpful during development and debugging, they
are typically not necessary in the final version of the code. It would be
helpful to remove the console log statements before submitting your code!
------------------------------
In week-3/quote-generator/style.css
<#189 (comment)>
:
> + align-items: flex-end;
+ margin-right: 50px;
+}
+button{
+ font-size: 0.6em;
+ font-weight: bold;
+ padding: 15px 19px;
+ border: none;
+ border-radius: 5px;
+ background-color: rgb(187, 156, 156);
+ color: rgb(57, 43, 43);
+}
+#check-box{
+ position: absolute;
+ margin-top: 80px;
+}
Your preview looks great! Well done @BakhatBegum
<https://github.com/BakhatBegum> !
—
Reply to this email directly, view it on GitHub
<#189 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7AJUM5SC3FO3EZ3OZMIM7LYQ227NAVCNFSM6AAAAABB2JYA2KVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNBXGYZDMNZTGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Learners, PR Template
Self checklist
Changelist
When the page loads it should show a random quote from the
quotes
array on the screen. It should also show who said the quote.When you click a button on the screen it should change the quote on the screen.
Questions
Is it good practice to do style in CSS?