Design comparison
SolutionDesign
Solution retrospective
It was a nice project. Many things to fix and to do. I try to use asynchrone function for get the api. I fixed user website links problems I limited the number of characters in "textContent" for the profiles with long bio or long name. I used "prefer-color-sheme" and switch.
Community feedback
- @fazzaamiarsoPosted about 2 years ago
Hello Stevan! Great Work!
I have a quick tip for you to simplify your code.
function checkDataEmpty (value){ return value === null || value === ""; } //if company is empty get the empty message and opacity 0.5, else display the company name const isCompanyEmpty = checkDataEmpty(data.company) profileCompany.textContent = isCompanyEmpty ? "Not Available" : data.company; profileCompany.style.opacity = isCompanyEmpty ? 0.5 : 1; iconcompany.style.opacity = isCompanyEmpty ? 0.5 : 1;
I hope it helps! Cheers!
Marked as helpful0@Stv-devlPosted about 2 years ago@fazzaamiarso Thank you for advice. I felt my function was to big also. And don't need to repeat too much the same things.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord