-
Notifications
You must be signed in to change notification settings - Fork 411
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
The French Bot - Chatbot project - Jenny A #295
base: main
Are you sure you want to change the base?
Conversation
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.
What a cute bot idea 🇫🇷 😊 Let's look at some feedback!
JavaScript
- Nice addition with a sound! Crazy idea - would be fun with different sounds if the user answers right or wrong
- The code is divided into logical functions, which is a good practice. For instance, separating the playSendSound and playReceiveSound functions helps keep the code modular.
- If the user clicks the send button multiple times quickly, it might cause unintended behavior (e.g., repeated messages). To prevent this, consider disabling the input field and button temporarily during processing.
Clean Code
- Variables and functions have clear and descriptive names, such as handleNameInput, createFrenchButtons, and playSendSound. This makes the code readable and maintainable. Consider changing e.g. goodByeMessage to follow the same convention
Nice idea and well executed ⭐
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.
haha 👌
Send | ||
</button> | ||
</form> | ||
<div id="button-container" style="display: none;"></div> |
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.
Keep styling out of the HTML file 👀
buttonContainer.style.display = 'flex'; // Show buttons | ||
|
||
// Add event listeners to buttons | ||
buttonContainer.querySelectorAll('button').forEach(button => { |
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.
Nice usage of forEach 👍
https://thefrenchbot.netlify.app/