Design comparison
SolutionDesign
Community feedback
- @Kamlesh0007Posted over 1 year ago
Congratulations on completing the challenge! That's a great achievement, and I'm sure you put a lot of effort into it. I really liked the way you approached the challenge and the code you wrote. You demonstrated a good understanding of the concepts and applied them effectively to solve the problem.I have a few suggestions to improve your code further. You need to add a loader while fetching data from an API, you can follow these steps: add this code in ur javascript with css of loader in ur stylesheet
const loader = document.getElementById('loader'); function showLoader() { loader.style.display = 'block'; } function hideLoader() { loader.style.display = 'none'; } // Example of fetching data from an API function geratorAdvice() { showLoader(); fetch('https://api.adviceslip.com/advice').then((data) => { if (!data.ok) { throw new Error(`ERRO ${data.status}`) } return data.json() }).then((body) => { hideLoader() idAdvice.innerText = `ADVICE #${body.slip.id}`; message.innerText = `"${body.slip.advice}"`; }).catch(erro => console.log(erro)); }
and also add letterspacing in paragraph .container p { font-size: 20px; margin-bottom: 12px; color: hsl(150, 100%, 66%); letter-spacing: 4.2px; // add letter spacing }
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