Develop#2
Conversation
…ion about projects
| <ul class="menu-sublist"> | ||
| ` | ||
| submenu.forEach((item) => { | ||
| switch(item){ |
There was a problem hiding this comment.
Do you really need switch case here? It's a rare construction that you can usually avoid.
| </li> | ||
| ` | ||
| } | ||
| } |
There was a problem hiding this comment.
idk what's wrong with your IDE but set up proper formatting. Getting comfortable with tools you use should be step 1. It saves a lot of headache later down the road.
| </ul> | ||
| </nav> | ||
| ` | ||
| for (let i = 0; i < ROOT_NAV_ITEMS.length; i++) { |
There was a problem hiding this comment.
Read about map, filter, reduce, forEach and other array methods. Using default for loop is highly discouraged.
| class Projects { | ||
| render() { | ||
| let htmlCatalog = ""; | ||
| PROJECTS.forEach(({ id, imageUrl, title, text }) => { |
There was a problem hiding this comment.
Why spacing is different in this file? Code style should be united across all files.
| ); | ||
| } | ||
| } | ||
| if(isMobile.any()){ |
There was a problem hiding this comment.
I doubt this should be done with a lot of copy pasted js code. CSS feels more appropriate.
| document.body.classList.add('_touch'); | ||
| let menuArrows = document.querySelectorAll('.menu-arrow'); | ||
| if(menuArrows.length > 0){ | ||
| for(let i = 0; i < menuArrows.length; i++){ |
There was a problem hiding this comment.
Again, don't use default for loops.
| } | ||
|
|
||
| document.querySelector('.proj-input').oninput = function(){ | ||
| setTimeout(() => { |
There was a problem hiding this comment.
This whole fucntion is a huge mess. I'm sure there's a much cleaner way to do it.
Add serach input for projects, and add arays of projects and nav items.