Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Countries API with Dark Mode

@iElvisJosue

Desktop design screenshot for the REST Countries API with color theme switcher coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
4advanced
View challenge

Design comparison


SolutionDesign

Solution retrospective


All buttons work, feel free to press them! 😝

1.- Can someone explain to me how the paths work in fecth?

For example: On my local server I can use this path './data.json' but on github pages it gives me an error, what would be the problem and its solution? 🤔

2.- Can someone give me optimization tips?

For example: On the computer the times are fine, but on cell phones it is super slow! That frustrates me, I'm really new to consuming API's, your help would be great! 😫

Community feedback

@mehmetakifakkus

Posted

Hey, congratulations for completing the challenge 👏

I have investigated your code on your github page. And I list my advice here down below:

  • I definitely advise you to choose a frontend library such as React.js or Vue.js. They help you to manage html elements and also style. React's main focus is making everything component wise. It also makes management the code easy.
  • Another thing is that you can use fetch API to fetch data from endpoints of https://restcountries.com/ instead of use of static data.json. Another problem is using data in data.json is that it might be outdated. Fetching data guaranties that you have the up-to-date data all the time.

Marked as helpful

1

@iElvisJosue

Posted

@mehmetakifakkus Thanks bro, I will adapt the project with React and that API, thank you very much!

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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