Design comparison
Solution retrospective
I'm just starting in WebDev, so I found it challenging enough. I could've used fetch to import the data.json file, but I couldn't figure out what logic would I have to use to place the data. So I just hardcoded the data into the html file. The CSS part I was probably the easiest part for me, but I'd appreciate any comments/suggestions on that! The most difficult part as I mentioned was the logic behind importing the json data to the html file, I really don't know what to do after i fetched it.
Community feedback
- @marianefelixPosted over 2 years ago
Hey, congrats on completing the challenge!
First of all, I think you could center the main content on the page, following the design. How about the
justify-content: center
?Now, about the logic to show the data in html, I did this:
- Used the fetch API to get the data from json file;
- When I got the data, just called the listener function passing it. Then, since we know witch is the active link and the keys "daily", "monthly" and "weekly" are in the timeframes object in the data, you can use the active link to access the object that should be shown in the page.
I don't know if this help, but I hope so. You can also check out my code on github. :)
Marked as helpful0@BrazilianMemeMasterPosted over 2 years ago@marianefelix thanks for the feedback, I'll try to use the fetch API following your suggestions xD
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