Open
Conversation
HIPPIEKICK
approved these changes
Sep 19, 2024
Contributor
HIPPIEKICK
left a comment
There was a problem hiding this comment.
Great job creating this chatbot! 🥳 Let's go through some feedback.
JavaScript
- You've structured the code by grouping similar blocks together (e.g., DOM selectors, functions). This is a solid approach and helps readability. 🧹
- Great conditionals, I like that you used .includes() to match more options
Clean Code
- Naming conventions are consistent and descriptive (locationForm, locationInput, showMessage). This makes your code easy to read and understand. Well done! 🎯 Some could maybe be even more descriptive, for example - how do I know the difference between the functions handleOccasonInput and occasionInputHandler 👀 And change OutfitSuggestion to camelCase (and maybe verb form as well) -> suggestOutfit
- Be consistent with if you're using single or double quotes
Keep up the good work! 🤖
Comment on lines
+80
to
+89
| chat.innerHTML += ` | ||
| <section class="bot-msg clothing-options"> | ||
| <img src="assets/bot.png" alt="Bot" /> | ||
| <div class="bubble bot-bubble"> | ||
| <p>Would you prefer casual or formal clothing?</p> | ||
| <button class="clothing-choice" data-choice="casual">Casual</button> | ||
| <button class="clothing-choice" data-choice="formal">Formal</button> | ||
| </div> | ||
| </section> | ||
| ` |
Contributor
There was a problem hiding this comment.
You already have the showMessage to handle this! If you want buttons, use the input wrapper instead.
|
|
||
| // Eevent listeners to the buttons to handle the user's choice | ||
| const buttons = document.querySelectorAll('.clothing-choice'); | ||
| buttons.forEach(button => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://rococo-stroopwafel-4da0eb.netlify.app/