@isprutfromua
Posted
Hi there. You did a good job 😎
keep improving your programming skills🛠️
your solution looks great, however, if you want to improve it, you can follow these steps:
✅ instead of duplicating a large chunk of code, you can place all the elements in an array and iterate it by setting the appropriate values
✅ use code formatters for structuring your code. It’s very important. As programs get more complex, they get harder and harder to understand - and at some point you can’t even understand code that you yourself wrote without being able to re-read it. Good style makes reading code a pleasurable and consistent experience.
clicked = e.target.textContent;
clicks = e.target;
if(clicked.length < 8){
if(document.querySelector(".active")){
document.querySelector(".active").classList.remove("active");
}else{}
}else{}
clicks.classList.add("active");
fetch("data.json")
.then(function(response) {
return response.json();
})
✅ You Should Stop Using Pixels. They are static and aren’t truly relative to the root font-size like REM and EM units. Fixed sizes it's also bad idea for dynamic content.
.contain{
flex-basis: 31.54%;
height: 190px;
margin-bottom: 0px;
}
.person{
display: flex;
flex-flow: column nowrap;
flex-basis: 23.5%;
height: 400px;
}
Good luck and fun coding 🤝⌨️