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

Country API made with HTML, CSS, JS, SASS and Bootstrap

Franco Bernardi• 150

@francobernardii

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


Let me know what you think about this project, all feedbacks are welcomed :D

Community feedback

Fazza Razaq Amiarso• 2,340

@fazzaamiarso

Posted

Hi Franco, Great work!

A tip from me for cleaner or more readable code is by breaking-up your createCard DOM creation into functions. for example

const createImageContainer = (image) => {
 let containerImage = document.createElement('div')
    containerImage.setAttribute('style',`background: url("${image}") center no-repeat;background-size: cover;`)
    let containerTitle = document.createElement('div')
    let containerDetail = document.createElement('div')
}

const createHeader = title => {
  let h1 = document.createElement('h1')
  let contentT = document.createTextNode(title)
}

//in createCard you just need to do this
const createCard = (image,title,population,region,capital) => {
   createHeader(title);
   createImageContainer(image);

//other codes
}

I hope it helps! Cheers!

Marked as helpful

1

Franco Bernardi• 150

@francobernardii

Posted

@fazzaamiarso Thank you so much Fazza, I'll update my date with your recomendations.

Cheers!

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